summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/dstr
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/class/dstr')
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-no-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-name-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-empty.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-null.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-undefined.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-null.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-undefined.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-list-err.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-name-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-empty.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-null.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-null.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-undefined.js61
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js62
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js65
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js63
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js64
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-name-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-empty.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js72
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js66
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js70
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js69
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js73
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js68
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js75
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/browser.js0
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-get-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-no-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-name-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-step-err.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js108
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js114
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-name-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js108
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js114
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-init-null.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-init-undefined.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-empty.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js102
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-init-null.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-init-undefined.js77
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-empty.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-list-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js102
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js79
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-getter.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-no-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-name-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js108
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js114
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js108
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js114
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-undefined.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js102
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-undefined.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-empty.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-list-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js102
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-no-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-name-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-hole.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-throws.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-undef.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-done.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-step-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-empty.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elem.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elision.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-empty.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-rest.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-direct.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-exhausted.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-no-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-name-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-empty.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-undefined.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-list-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-getter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-init-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-init-undefined.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-list-err.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-eval-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-null.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-getter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-val-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-no-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-name-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-step-err.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-empty.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-direct.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-no-close.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-name-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-empty.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-undefined.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-list-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-null.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-undefined.js74
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-get-value-err.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-skipped.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-list-err.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-eval-err.js78
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js83
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id.js81
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js76
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-getter.js80
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-val-obj.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-no-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-name-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js109
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js118
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js109
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js118
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-empty.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-name-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js109
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js118
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js100
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js109
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js105
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js112
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js118
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js101
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-empty.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js106
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/statements/class/dstr/shell.js0
1922 files changed, 161032 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..e52d69ed69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..ce97457026
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,73 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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];
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..8c57224e66
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-get-err.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..171bf0f296
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,78 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..60999d9c15
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..5b9c858723
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..e05a3010b1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,70 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..d428628e0d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,76 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..58ea24c4a0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4a26167874
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..d64ac8883f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..9bb20c8f84
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..41e2ce249d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,76 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..29f41a0e69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..0540907fe6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,68 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..04ec410fa8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..a29b23a43c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..63a66a6cb7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..67cb08e087
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..901fc42146
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..601e2a9aab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,64 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..42ee26b072
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..4c3b3bd5d8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..113dd7e7f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,67 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..516c834aaa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..bb03bdbfb6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..1d2e7bbc2f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,66 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..c8c823b57d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,74 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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();
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..ea17e8512f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,87 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..402298502a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,85 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..c2f1cfafea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,77 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..553277bde1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..5f738e9357
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..6a1328ba7e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,79 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..61f05a2259
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..9ab8b92d34
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..2b20e89eac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ async *method([{ x }]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..a1bdac3020
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..457de21945
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..1a0920e99f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..b6566e2cc3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..e81767de0a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,90 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..36d6da2178
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,96 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..8b2e2fa166
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,79 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..9b47ffc1c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..7e6b33b674
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,70 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..34e0f7161c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,67 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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(); })();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..0478749315
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..9eb02b9a14
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,67 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..da9cbda40a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,78 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..0f712cf9a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,80 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..de0c817075
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..ae4025e39e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..1580c8310f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..fe3880a2ca
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..2c40934196
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..f395919c5d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..b219be6368
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..cebed99c3c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,68 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..f7f49a5be4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..162eed1127
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..d41a8fb1cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,73 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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];
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..ee58f513d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..11213ed108
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,78 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..e8da6e9f22
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..0602357580
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..f7493c1180
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,70 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..75dd18901f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,76 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..14942f4890
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..6c43533ffd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..352754eab3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..e73fcb966e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..d58b98598d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,76 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..03d238b882
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Nested array destructuring with a null value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..cd8c161d4b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..f248fca743
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..66e035212e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..991e23bbe3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..0dafa09666
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..48511b4b87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..2c51f84ac0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,64 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..45821f3294
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..03f6cdc031
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..9b5f181940
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..e8c67667bb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..3e98ff9928
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..98a2baabf6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..1e7f455700
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,74 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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();
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..16b17212d4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,87 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..a987cf315e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,85 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..78272a3339
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,77 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..c58596ee46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..b8c9f3d8cd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..1e5abee4af
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..f038e24eab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..772a6879cd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a null value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..daa4ea3751
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ async *method([{ x }] = []) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..7c1991dfef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..ea6fa2a080
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..ec98123e8a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..e2c7870d7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..939ac76037
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,90 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..2e91589278
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,96 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0e1604370d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..699583754c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..96b68d3ba9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,70 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..58f7007841
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,67 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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(); })();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..edeca7938f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..1e6aa07f19
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..3a06c3ab1d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,78 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..0e17ed2e5a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,80 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..cb89a4f210
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Lone rest element (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..c4c17626e1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..7da673cbb2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..87425aff6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..dd2194eac3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..40f347b7b9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..cd23b30fc7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..94876d16fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..8ce08c2a48
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..5fc3947140
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-null.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ async *method({} = null) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..6502002000
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-init-undefined.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ async *method({} = undefined) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..6248fd6ef2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..26412acd49
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..18991eefac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..162576df10
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..4332321b44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e43bb913bc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..eb045be12f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..8f568a542c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..cf7056ea20
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..5a564f7bec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..10b50bcb3a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..1b6bff73a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..64dbf4c15e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..e04be13381
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..441f6e316c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..de82c9e44c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..6faf6b9799
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..658645d003
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,70 @@
+// 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-decl-async-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..2f026aa34c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,84 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..22bdd6f755
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..d6890f7930
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..dc09c1a1dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..c3eb6f0665
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..22354b9a40
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..0f0870753a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..e451ff0189
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..142c493f7a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..91b9319bf1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..2d58553a9a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..63103c4019
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..f9764b2671
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-null.js
new file mode 100644
index 0000000000..a9e32f626b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-null.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ async *method({}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-undefined.js
new file mode 100644
index 0000000000..325cc00c3e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-init-undefined.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ async *method({}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..d1e1606f13
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..ae3744f57d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..96fa1aa0cd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,68 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..83429e1d61
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..e35fd0a17c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..19e34a34c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..d5105aee06
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..cd15b40515
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..2e9f281940
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..ef6e4e26ec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..3d4614787b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..139a9d575e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-list-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..5d4a2b7024
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..20c2f315a7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..50e63756bd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..0c74e8bdb7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..4b4c336319
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..5959bd5a73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,70 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..969a368938
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,84 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..7419a220df
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..f513d7dd05
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..b5117c66e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,65 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..8a94cff2f0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..4a3f8f7e97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..fc8be8bf01
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..d0f6f94b3b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..7afbbc89dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..8f14e47aef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..e89218806a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..18fce78018
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..420b69863e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..264fc3650d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..83ff3cd622
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,73 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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];
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..f1e480eb36
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..0ba8cda8be
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,78 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..be0ded9375
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b4a1c05177
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..3b672fa971
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,70 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..1291b8a61e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,76 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..22cf0bb1fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..fdd08e13de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..4c7b96ebf6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..1e83aea613
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..a994c08eec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,76 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..92bccd2f19
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..db48fb18f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..f91dae6afe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..9883c8793f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..e2b5985794
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e9e958075a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..4075c26454
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..df73e759f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,64 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..8033b54a51
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..669f46c9ae
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..38590711d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..ab2486d02b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..e997bec484
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..8fb843e1b0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..7c66ed8916
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,74 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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();
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..adc51fd8f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,87 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..8bbff5b802
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,85 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..28164141f3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,77 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..962c02103c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..fc3fd08746
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..391f6c9d92
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..608cdcf3b3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..890afb4b54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..1ae4b3664c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ static async *method([{ x }]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..28bdcce3ba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..15e7202f5a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..0c8b703d37
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: Elision advances iterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..af51f844c0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..f77842eeb4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,90 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..f0694f6b25
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,96 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..19a9ba4bdb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..9d13583ead
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..a3d0749da5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,70 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..b46b9a32e3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,67 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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(); })();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..fed54ab1bf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..0a7695bfd3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..ae5b780a95
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,78 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..0cb5f53348
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,80 @@
+// 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-decl-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..2943babe60
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: Lone rest element (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..929395eb1f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..237f12a497
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..ede5a1ca14
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..137caddb0a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..a10ff3f23c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..c9049f79f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..daa530dcb7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..51cc05ad01
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..99b3888c2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..26fbf0cc9c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,73 @@
+// 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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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];
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..5c964493d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..289080308e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,78 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..ac1539d0cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..bb4beb7f09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..706041e007
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,70 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..68ef8dc464
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..2bd89a1a65
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..f9731d8045
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..2b6f2152b3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..7a04459d6c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..35c05296a0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..b4501ed495
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..28e8e79396
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2d255dd6d8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..77a3266c18
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..92478e1c91
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..cbd6d5e978
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..ebe90e587b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..5ca980671f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,64 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..a25d3f4972
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..2b2adac10f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..6c7bf940b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..2a2a0086eb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..f090a1a837
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..5988258232
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..e7224906ed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,74 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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();
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..6f5ec9b021
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,87 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..82883f7c68
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,85 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..f0a07fe7e0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,77 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..896f137ef1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..1c6909db21
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..5ba5d0ca8a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,79 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..15691fb960
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..cff11ddcd1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..bb9dd84eaa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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).
+---*/
+
+
+class C {
+ static async *method([{ x }] = []) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..aa97ecd0c6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..81eda9cb2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..d2f0237750
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..d401a805b6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..ecda6d24ff
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,90 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..10c59b812a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,96 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..2f30bb2ef3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,79 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..09707435a1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..e537cff630
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,70 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..423e11010b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,67 @@
+// 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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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(); })();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..00869aaa8c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..b0abbbe2af
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,67 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..0ae2c20d79
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,78 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+}();
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..ae31b2d57d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,80 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+ }
+ };
+};
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..5b589769a3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..44044f3eb0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..1f4ef2d193
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..69208aad8f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..3bcc910267
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..ec1fa94da8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..0a29490a51
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..20c1d49c0a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..a4b95d0178
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,75 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..f7d708093b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-null.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ static async *method({} = null) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..fce7b7bca5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ static async *method({} = undefined) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..8fa75e42e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..55ed81fa09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2cff36cace
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..cdbd26b9f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..5708745091
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..a96d8af870
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..af20584145
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..ca6e9dcd51
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..d2b1224a33
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..0d19825c5e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..0d6894ecc8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..03cba933f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..ef3df6831a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,71 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..bd79302bf9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..9ecc524d73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..3188294db9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..86a97070e9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..0f81e66f30
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,70 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..d2451af9dc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,84 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..19a9bae376
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..d7991065a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..0c37300bc1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,65 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..c1d6d17e58
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..a0230cf9c9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..073fa8b160
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,71 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..01294eb59d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..98d4fb877a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..2eb83ddd26
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..1699c9ccce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..76b2c8c842
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..194ab1b44d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-null.js
new file mode 100644
index 0000000000..4a6f5b4aa4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-null.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ static async *method({}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..ac8d57a607
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-init-undefined.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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).
+---*/
+
+
+class C {
+ static async *method({}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..ce0ebbb71e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..1d626564fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..9b0b599f1c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,68 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..9dc36e1874
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0e684035fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..d635b0ce41
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..533c81af0e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..03b6e64266
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..1dcc2f6b66
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..fe893ae967
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..89465e0b5b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..61738dde65
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..6f1defad0c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..b558efeed2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,62 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..282fd957f2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..2df85585ac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..a4148bacb8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..5f461c108c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,70 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+ }
+});
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..def869a0ff
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,84 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..b7e27bc6e3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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();
+}
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..e7a8ab369a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..ce52efd73e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,65 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..c6d8e8be1b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..64293ac1a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-async-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..3c7522b6a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..ae4da3648a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..cc6e3d1357
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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.
+---*/
+
+
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..3d2294027f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..38dcd2d773
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..5143f9a9f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,72 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..5ebfa1d74f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,71 @@
+// |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-decl-async-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..19a24ded09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..03e28fa087
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..410e8902a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..5b9050bf5d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..41844de008
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,74 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..5520244e7d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,80 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..8d993e9bbd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,77 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..9fde66c362
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,76 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..cb066b1376
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..dd12f44406
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,77 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..20b151978e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,80 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..5496a30304
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..6a3470a3fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..2ca0c5e3e1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..529e0a93b6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..c06b4c9979
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..7dd6dfa167
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..b352098f81
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,68 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..3f9c1bcec0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..0c3ab10e36
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..bff211d1be
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..c8b73f1cd3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,70 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..78b68a7461
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,91 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..c28800c85e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,81 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..622a8bd8c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..e00fd0737f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,73 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..1efefe8023
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,83 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..17fa349cc0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,83 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..9329d9ee2d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..59ddb2ba59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..127a9cf0a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..1763b65583
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,94 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7b5a1d1863
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,100 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..bf6b4a50a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,83 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..f2d040c084
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,79 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..996e20e05f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,74 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..7a70484532
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..babfadc7ea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,71 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..3cf9745d9c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..8173c0d217
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..8e5b3fc77f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..d885c8e0d1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..575416a727
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..644df958f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..61b0792d2e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..177f8bd1f6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..1a3bd5ce97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..e7802751a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..4d8454731f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,82 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..aa340a7755
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..52852c8b6b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..e567750f7e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,74 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..40f784086a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,80 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..c1b2f5da1d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,77 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..b68b78d842
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,76 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..9d94e82d62
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..9abfa99a2d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,77 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..b8c1f86af1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,80 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..904198433c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7a25e06852
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..00bdef46f3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..6c0f3b4422
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..f81e864f80
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..4bb0e06d85
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..3f519190a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,68 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..fc2aa2375b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..a79633a795
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,71 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..6fb0aed962
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..fcad842088
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,70 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..b48b5f926e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,91 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..d549b378de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,81 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..77dfeffcc9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..4afeb42775
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..a8ca812ea5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,83 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..e93618201b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,83 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..0a9e02aaac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..679d0d7712
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..ccb5fe4d87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..fec42478c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,94 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..fd6a038345
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,100 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0ac607d8f1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,83 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..d45f6b8ae1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,79 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..74daeb06a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,74 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..b8518cd2f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..b0cae39208
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,71 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..16fd9b9b2f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..908d9daf18
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..b9ab976e1e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..6c7606de6d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..1aa6beda6d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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 parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..de0c49ee6f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..0087343fe4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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 parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..b2fe912932
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..ca4df07606
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..6cfe0efc2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7210a2fc8b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..b5e1486c4e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0a179ba8f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..b7922da54b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..41bee58fde
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..2dc7b1da97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,76 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..658536a8ad
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..8f487d0075
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..3039764b91
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..1f1ac22b38
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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 parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..767b3ca69f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,88 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..2bb4af2d67
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..bcf99d52d2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,70 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..5ef002c189
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..94b88cef28
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..67a318fdee
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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 parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..fe3c5ffc6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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 parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..442f06f168
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,76 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..e5c559f729
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression async generator method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..61d4d48861
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..50f6297ec2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,72 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..e9948991f1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2f21f174da
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..f75b183ff7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..92a1366562
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..96c193c3ad
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,76 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..244c353400
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..d6c07d1864
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..e0dda00e3f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..297066a35a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..903b371b5a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,88 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..665d55bc64
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..5aad3d9a13
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,70 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..5cad542b70
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..3037b1934a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..c1fa963d96
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..054aef19b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..46cda116e9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,76 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..240351f74b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,75 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..66a972d383
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..fd7ebdf0c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,82 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..9abdc616de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..bb2ba2f067
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..84915cb853
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,74 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..8dc61c0f97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..3bd83f8ad1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..028c11548f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..81e33ffeba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..f79eb67627
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..e5487f3f69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..e206146701
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..36f5c9b13d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..9f59830c46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..61b74f9d51
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..c55a90eebb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..5d212cdf6b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..2239a72507
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,68 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..4bb0151085
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..536c0b3e27
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,71 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..24bc7cc81d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..35dc2af10b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,70 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..b019de73d0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,91 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..8c0f250c87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,81 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..0e4dc249a8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..a7bcfa0be6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..f925a3978f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,83 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..572361b5b3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,83 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..23311821c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..55759400ee
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..432da14434
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..808fe116ff
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,94 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..95d2e48743
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,100 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..2682225934
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,83 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..35c78d5e2f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,79 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..ada04375e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,74 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..a55d278363
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..bc1e06fd64
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,71 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..5edb8a8c64
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: Lone rest element (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..fdad69769b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..1273c42bbe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,69 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..7d95130a27
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..ba3efaaed1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..8def309cf6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..af8f46ec29
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..e582e00655
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..2138358f15
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..28a6af3211
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..81970976b1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,82 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..da5e4e4d2c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..6e23720a1d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..2669c6b221
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,74 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..1968c9e22a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..dfa634b0d7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..d5ebfdf456
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..5fea8f88b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..1ae393ea4a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..931019587f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..d447402f19
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..56d87f8a92
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f649f6ef50
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0a3e35af26
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..2cf6c7f89e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..b284579b73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..936674029a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,68 @@
+// |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-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..28f90531cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..1df59acff9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,71 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..e7a12e886f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..53b706eabc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,70 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..311051b6a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,91 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..4173a19f99
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,81 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..b0678e4e9c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..246b8f2e77
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,73 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..092e48c799
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,83 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..e4f6807b5a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,83 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..afa632e671
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..526a289070
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..e2ecdcd8cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..8ee224c8b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,94 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..fb1fdb9163
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,100 @@
+// |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-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..6e8d7be1f6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,83 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..b6e5e406eb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,79 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..704abfad48
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,74 @@
+// |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-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..57c15a4170
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..d5ce0307a0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,71 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..865ebc51dc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression async generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..a4d551ad4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..98737ae8b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..75c51f5725
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..56c522be3d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..15a5482253
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..8dd17cbcf7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..e5f5eb8a37
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..a7b3375013
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,79 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..ea9d36dbfe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..eb613df976
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,72 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f00a43e200
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..1f39ccad4e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e3392ea16d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..224933e9a3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..c43913f345
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..2de5d499be
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..6ad473ebd5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..d37273c692
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..f3f8e4c585
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..73805697a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,88 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..d6ddc3b435
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..f503d2b36b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,70 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..cfdbe14355
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..a3e3b63c78
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..a02754ce1e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..329ab3412a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..2e16bc72fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..6b4fa0c5a9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,75 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..9da9ee901e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..91af8421c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,72 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c29cb50aba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.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-class.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..c3548fc2f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.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-cover.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..c872338099
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.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-fn.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..29c6cb6d02
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.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-gen.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..57c11c9ec8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,76 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..2e804c4278
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..7de01e3581
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..69df272711
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,66 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d4641d51cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..84cdb306de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,88 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..9adc2a6838
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,69 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..8bcc12a4e7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,70 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..af2601e576
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-async-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..2686a72d90
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,75 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..f0a49a842f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..0590d88ed6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..913b83b81a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,76 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..d88e0414db
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,75 @@
+// |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-decl-async-private-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression async generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise 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;
+class C {
+ 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/statements/class/dstr/browser.js b/js/src/tests/test262/language/statements/class/dstr/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/browser.js
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..60f8762b99
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..6d109041dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ *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/statements/class/dstr/gen-meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..7a49a318e7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..f8168190de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..6e007890ef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-name-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..e900afa05e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..ebb9072276
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e7a6728f0a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..38e712609c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..d8fb02b065
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..7da1531868
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..89e570be58
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..7358b4b9a7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..45d18bbfdb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([[x]]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..e925049d88
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..a968f65793
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,87 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..3325408c54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,89 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2210300270
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,88 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..620b3f4c83
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,88 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..5437fef254
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,89 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..905c2fddeb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..2874fe472b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..e5b20512dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..bd91406569
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..d07e7e0581
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *method([ x = unresolvableReference ]) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..36d8c27df3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..56f7eacfd4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..e8d9e954bc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..92185b6425
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,105 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..77431f912f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..392cc78b3a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..f120020eca
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..2551614b44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..eb07682d7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,97 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..765472dadd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..caf17f56d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([{ x }]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..9ecce046aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([{ x }]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..8bd26ce047
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..bc284194bd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..8a12b5b037
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth.template
+/*---
+description: Elision advances iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..f3527a3f1c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..5b866bb28b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..bdee78b8b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..6c3f3e5c5f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..233928fd22
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..a3b2f44b6d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..85b69a2327
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ *method([, ...x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..9f130353aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..3cd99f1515
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..07ea6817ed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..c472664e6f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ *method([...x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..7ad33056b6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth.template
+/*---
+description: Lone rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..cbb298e900
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..49bb698e7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..1fa29db40a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..a9774c5ae3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..a7e5be6e6e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..33c6f5c0f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..5479300a4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..64ebfbc9fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..cfcbe4ea69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..f348b2fc00
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..ee72353d3b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ *method([x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..9b23534760
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..88958102ec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..9eacb9ef6e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..48e49cf3a9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..4d043eb182
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..886051a0d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..b092e8a660
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..9c9cc980fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..053f3d1efd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..58283e5804
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..03bc2d230c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([[x]] = [null]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..b2098fed17
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7d23bbdcba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..5471431d8a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..1828e71634
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..6f1642b4fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..0931a63e13
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..e82a3df6cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..56e457f2e3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..7bbc85e5fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..eecfbf8d14
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..6e7a339f33
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *method([ x = unresolvableReference ] = []) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..68b2a5290a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..02d0772a78
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..c617460958
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ *method([x] = g) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..f22588a401
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,105 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..aaad4685c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ *method([x] = g) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..2d7bf80199
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..2b462e3380
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..4722fe8d09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..16c9d00275
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,97 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..78c5ca1cfb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..0917834752
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([{ x }] = [null]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..fb34d8d82a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ *method([{ x }] = []) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..f5413c7c7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..bb7338d6d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..d167145dd6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..37f8dc6aec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..4fea96c065
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..48e9025589
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..dba39b1949
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..fa021d284b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..6925899c92
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..05387d8438
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ *method([, ...x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..2f1298217e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..e99a2b7b0f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..665fe77298
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..c94e0f6659
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ *method([...x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..728e7a642e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Lone rest element (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..08ea4666b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..409d798503
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..3741aa88d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..8283c7463b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..e22718babc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..312d328db3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..25f0cb92f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..41427219bf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..4395e91747
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ *method({} = null) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..f115e339d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ *method({} = undefined) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..5c24f90ccf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..8c41bcb23a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ *method({ poisoned } = poisonedProperty) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e99280252a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..bfd333f0e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0065e7b980
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..177633fd22
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..6bb67edddf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..d4c4876ade
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..b793663a73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ *method({ x = thrower() } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..00664b78a6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *method({ x = unresolvableReference } = {}) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..dba2e28897
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..3725990759
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..e72f38564b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..bf00460a7a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..0cd2840e41
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..74866111c0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..904950e1e9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ *method({ [thrower()]: x } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..c4e1c9db3c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..ac98760dd6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..7dec62ce79
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..7692318e73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..4abf16cd7c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..97ab5b3fe7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..0aefdeec97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..9a92c631d8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..9f19d4f352
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..4d1195bac2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..5ff981ed8f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..51409659a3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..ad488f077c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..5d0d7432d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-init-null.js
new file mode 100644
index 0000000000..ad20c081cd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ *method({}) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-init-undefined.js
new file mode 100644
index 0000000000..569d3cc1f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ *method({}) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..0e9aa3d97a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..05cfd3eeeb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ *method({ poisoned }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..3f6883e35e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..4fccb76131
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..815c048576
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..60773be254
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..01dd1f669f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..16a058c0d1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..9a6a7a50aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ *method({ x = thrower() }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..47b81f95bf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *method({ x = unresolvableReference }) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..bd77979097
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..546a5f8472
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..7eb51afb83
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..1628761752
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..43b84378d2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..b942628839
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..9b9d37c223
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ *method({ [thrower()]: x }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..8b81f05740
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..ba0674aa04
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..8f3618919e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..6dd3658aee
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..8eb689f206
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..6147800da2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..a0b0435795
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..7adfb5287f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..38eb7c1859
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..d64dc82e19
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..3eb571e88b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..32c9e80a9a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..20d9f89818
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..8d272c8273
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ *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/statements/class/dstr/gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..3a3d91d039
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..a488358c5b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..ec7bc1288e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..f4e91c513d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..45b68377c5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..7ad4563944
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..132ea0c923
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..9f72547316
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..40fcc2f144
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..64903ad17b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..c357654f9a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..073749c71e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..08326bb80e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..0a3c9fad87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([[x]]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..c8321ead6c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..d2a9930873
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c5ad7cdad5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..64adf969ac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..f23d95c569
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..63abad2c3b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..345ca0e8f1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..98eac43502
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..7feef62677
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..efccb8a3cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..004d863005
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method([ x = unresolvableReference ]) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..f36b552cfb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..0216f63489
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..a509bba319
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..68860f3f69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,105 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..705a3a03f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,100 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..4f011e0701
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..1517c7038a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..1fb34c42e5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..fcd72cd0b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,97 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..a5e71946c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..924beb7a1d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..60fc8fa75b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..dfd2b53f64
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..62ddc8cbfc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..c7250ca05c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Elision advances iterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..f68b91f4b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..166f67d6fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7cf8377d43
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..6e73d5c0fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..4a6a2e7c35
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..8a107ed1c2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..c5a89eb956
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,82 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ static *method([, ...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..719b55c61a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..6426ecf207
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..0990a7bafc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,93 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..faab033428
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,95 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static *method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..8e7fdd3e98
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Lone rest element (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..473e6eaa98
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..bebffcfdbe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..74137c3696
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..7820542366
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..71fc80a8ec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..b3bd8c84a2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..0e17d0f97b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..81820ac50b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..c215d6656b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..911ef43eb0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..1b7496d07c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ static *method([x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..51fdd14c5d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..2469ff5c6f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..da84e745df
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..2c06f60599
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..3e317c4701
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..fc374e0f44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..a28746a7ae
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..70f13b13f0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..8c758022e6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..bea4026d96
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..d844c24475
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([[x]] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..be61a9d8f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..383abd12c0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..1ee19dc8e7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..9b593d072b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,88 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..6d6b0a714f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..3d3cc773fb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..908345bb13
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..4db81f201a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..2fc460b448
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..047af41234
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..c5f816ba20
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method([ x = unresolvableReference ] = []) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..6160d0b401
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..44e4238e1f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..1293c8a74c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,89 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ static *method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..522e14dd85
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,105 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..709208fd61
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,100 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static *method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..7618e04432
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..991e3c9bdc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..2867b76609
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..02ce6b0c0f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,97 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..1a8b30b593
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..f051c6b331
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([{ x }] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..a804b5eb17
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static *method([{ x }] = []) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..eaf3c5f4dc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..1d318233ab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..41fa6cca35
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..5a545c2c2b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..709bf8f2d7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..266b6e8faf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..56b39ef77e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..3d3c3f923b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..b6f3327a44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..bfa213cecf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,82 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ static *method([, ...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..d43cc7a748
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..4fac33c15f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..18d925e236
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,93 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..0239380bc3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,95 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static *method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..12dde164e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..89fd8a30e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..40bb240d07
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..b24b90b955
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..4851b08cfb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,82 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..40f1add548
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,82 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..e325248831
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,82 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..76b85b23a7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..b1a0dfae26
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..35e88231ca
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static *method({} = null) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..42a9e2a75e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static *method({} = undefined) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..ad1960b0b0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..43a917c57c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ static *method({ poisoned } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..48944fc65b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..025bd7d90d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..662fb849d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..c636fd2d4e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..9bbb3b06d2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..b4b2787963
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..9739de71c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static *method({ x = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..e25fb1b496
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ x = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..c7f99ae884
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..2bbdb4261d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..26742762cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..bfa832e1d0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..724095625c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..4277491363
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..873dc625c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ static *method({ [thrower()]: x } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..55a6fea28c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,85 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..668c518f36
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..4036ce4dd1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static *method({ x: y = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..272edfbc99
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ x: y = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..4a4b492bca
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..346669cbd0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..b157c71677
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..4b929c3ca3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..a2b51e2f45
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..62b845667a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ w: { x, y, z } = undefined } = { }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..aaf80b4764
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..f73c062841
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..07bc5f9764
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..f4f3d799c5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-null.js
new file mode 100644
index 0000000000..2ef714fd6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static *method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..9e983ee2cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-init-undefined.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static *method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..0cb56067ea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..e9185fa545
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ static *method({ poisoned }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..87997fca05
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..7e6d35bc59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..21965c66b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..d7b1d4d2c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..44a81b541f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..83ff468f2c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..d6e7e9e883
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static *method({ x = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..0e27e7c683
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ x = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..3b09a587ce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..248afa936c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..1d8e2f1b5c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..fdf2ab2476
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..3ea5b90bc6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..88b59b373a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..bfb43c4555
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ static *method({ [thrower()]: x }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..6f70fc507a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,85 @@
+// 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-decl-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..1d7a5f67f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..c9be76292d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static *method({ x: y = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..3920ec1b93
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ x: y = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..648afc2365
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..e049b373cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..a444b24983
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..6dc29d04c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..6d5453ea3e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..4af1f1ec0b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static *method({ w: { x, y, z } = undefined }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..50eb623cb3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..3d02788c95
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..ceed609fce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..a7bba684b3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..005ab4212b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..3ea10b1bba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,88 @@
+// 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-decl-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..f35ae02a6b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-get-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..ef34711a63
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-init-iter-no-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..de708238d2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-name-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..0ab7d31f63
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..bff42e9ed6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..6664c608dc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..d039d4a783
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..ea075f405c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..afaa677dfa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..0d70ed2f3a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..973529fd11
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..17ecd68f3a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Nested array destructuring with a null value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([[x]]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..f646aeeb91
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..386cf5f99a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..cbb022ae7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..3ff3b6d099
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..cf77ae9bb8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..d5d602bcac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..ffc7ee9150
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..e42b431c4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..5d64c1244c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..d637e61223
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..4e2298f444
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ method([ x = unresolvableReference ]) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..ad42383ae3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..5104806e25
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..cf3dfa6ef2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,89 @@
+// 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-decl-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..14d0ad72ea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,103 @@
+// 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-decl-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..96b3148560
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,100 @@
+// 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-decl-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..68833d503e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..6cbe47422c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..95650ac497
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..db9badd5e6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,95 @@
+// 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-decl-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..8304975b93
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..7657d0414d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Nested object destructuring with a null value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([{ x }]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..df76a7f537
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([{ x }]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..46ac9945fc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Elision accepts exhausted iterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..ea26c3aaf7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..94695ff321
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-elision.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Elision advances iterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..fef6b48e0c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-empty.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..21cd0216f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7522fe40c6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing an elision (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..155abede58
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..4bd1b7640c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing a rest element (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..88b8749969
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Lone rest element (direct binding) (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..aae9152dc8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,82 @@
+// 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-decl-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ method([, ...x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..c8e14a5038
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..36b68b678e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..4e8dbe5587
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,93 @@
+// 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-decl-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..017032252e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,95 @@
+// 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-decl-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ method([...x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..2dd80d774b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Lone rest element (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..d2bc0a9903
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..996eec5e90
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..388e6f26b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..2a6de08dfa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..0ee09dfa59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..140b929319
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..a9a9252c74
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..a9d8735976
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..d5fd2fde69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..7447e35f81
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,88 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..3e33190ed1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ method([x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..4d2b4afbe3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..a750f1a5f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b9a8aaa625
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..ed81931b07
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..18a060e4b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..ca7a23457d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..7557d56e0a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..5a2e1e20f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..8106d4e1c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..d9739b0256
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..f52f2de2cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Nested array destructuring with a null value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([[x]] = [null]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..401917ddc4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2880a9e9a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..127d3c4cc2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..9879ac042c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..8981ce4a2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..756deb15da
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..9e2d008c33
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..364f518c22
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..636e8b17c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..0aa4f7af54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..5f3153fb69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ method([ x = unresolvableReference ] = []) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..4c9d487bd8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..9e3930e1c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..32dd893be0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,89 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ method([x] = g) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..2b19156b41
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,103 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..75827ac733
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,100 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ method([x] = g) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..e605a40034
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..ed59a156b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..89f8f2a890
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..2916687ce2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,95 @@
+// 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-decl-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..162a807165
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..4fca071ff6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Nested object destructuring with a null value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([{ x }] = [null]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..cd17eac0cb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ method([{ x }] = []) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..86f9bbf5b9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..e7be6aac4e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..4b19df93bf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..7a98296dd6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..af0957121c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..4b92ccdcb6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..17fc39a214
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..bc541b73f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..129fb000db
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..987bec94f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,82 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ method([, ...x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..6f27b0b9cd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..9d7adc641f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..aef6bb4a49
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,93 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..2e505bfba1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,95 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ method([...x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..d4e5e0f892
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Lone rest element (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..1d009b3318
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..d494273cbc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..590b6cc240
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..cec717b63f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..937a57aaf4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..9a75b35c3d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..a5ff0b91eb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..40a7166178
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..b999133400
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ method({} = null) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..11234a1875
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-init-undefined.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ method({} = undefined) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..01594d5443
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..6f39d99969
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ method({ poisoned } = poisonedProperty) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..6cfefaf62f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,84 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..aba947c3e4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..5a31c9cf3e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..7593b3c947
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..80974cc4ef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..a2754f9944
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..02dde5b5a9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ method({ x = thrower() } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..376a67c7e6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ method({ x = unresolvableReference } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..38236ebb18
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..fadaa36c49
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..264340a818
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..776d3bf0b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..d93c5454c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..53a57ce4ae
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..b9eb618795
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ method({ [thrower()]: x } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..970e57ae02
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..273e568703
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..f0a0b526b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..5e6109f2a8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..508b41ffaf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..360ec7e092
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..417188f461
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..68bf8916e1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..2c78d5ca19
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..d182ca7445
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..9a01630eab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..89b6da687f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..3952729118
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..18908855db
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-init-null.js
new file mode 100644
index 0000000000..d6f298a8f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-init-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ method({}) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-init-undefined.js
new file mode 100644
index 0000000000..a06de3fe97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-init-undefined.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ method({}) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..dc950e43ae
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..1a1937db61
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ method({ poisoned }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2d22819e73
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,84 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..464465222b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,86 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2f5349cdf6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,85 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..6b3c83bc9d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,85 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..5c33c28105
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,86 @@
+// 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-decl-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..c4d4b79c48
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..dd55f4bce6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ method({ x = thrower() }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..c8cbe8551a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ method({ x = unresolvableReference }) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..bd34550744
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..d95d4e82b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-list-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..b15189fcf4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..881d22c338
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..d63a34a3cc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d34fdd1dda
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..5c3fa0712e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ method({ [thrower()]: x }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..673cfab5d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,85 @@
+// 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-decl-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..46cbd78ea0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..085d3a2db1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..ce537ad84c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..3fb9ca6909
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..77d1feff57
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..4183736d42
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-id.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Binding as specified via property name and identifier (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..adf11a5ed1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..0055aeac99
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..fee809c44d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..40121ab0d5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..9bd46cfd6e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..0507093351
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..256e56ef0c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-meth.template
+/*---
+description: Rest object contains just unextracted data (class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..500e8143c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..a0e1a411bb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..aabe99798b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..f0e2c20b70
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..2dae5048f0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-name-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..c2d94c04f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..701808e01d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..151ced0c89
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..60f4dc10d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..e5baeeb181
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..96fe933c77
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..2dc3a0a2fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..3cb5844ac6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..26d4a15eab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([[x]]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..1a855e64e6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..41822de003
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..1c3a215c7c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..87555c71ce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..cb90504051
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..123fee6fa6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..008697629e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..61072d87c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..bf484b0875
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..8581e1c790
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..d547915dd4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method([ x = unresolvableReference ]) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..406883eba1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..366e8bbb4d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..bc5e9491c6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..6c1e06ecc5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,103 @@
+// 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-decl-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..545132ea44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,98 @@
+// 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-decl-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..23fbd2b225
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..d0c7653682
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..8bd1848300
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..cae912d565
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,95 @@
+// 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-decl-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..f734f70da7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..c634ba1566
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..f79592341c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..809296796d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..6dec356bd6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..fb75ef7921
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-elision.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Elision advances iterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..bfd4073a97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-empty.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..e53d40f16e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..9ec22d241c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..7f82bd1ad8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..6e2f19c1fc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..53b80e77e5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..b272895f4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,80 @@
+// 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-decl-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ static method([, ...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..bfb6ddb88e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..36dcf31e01
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..f15808f0fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,91 @@
+// 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-decl-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..b030b5c809
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,93 @@
+// 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-decl-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..801bd582fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Lone rest element (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..da6176dbf7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..e056fd74a8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..bcc72d51bd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..fbead3414b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..0c56098718
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..04dccb553b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..3eaf12affe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..580e6e2474
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..a2d21847dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..62bd70103c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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];
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..008df29b09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+};
+
+class C {
+ static method([x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..c06666e67b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..87e353dca5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..151b7b08ff
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..444eb1131f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..21a1ece746
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..b2bbd718b6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..fbf6db5f0c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..deed39c61d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..ee024c106e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..46d39662c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..6f2266bc2c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([[x]] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..93d288f4be
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..41c1c034a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..64fe77970d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..3ca7b8fa46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..ce09d93690
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..7d3bd26dea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..b54ce90f2d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..6e132d3fa6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..8d7c82bd21
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..98be07a5d7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..11660bc235
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method([ x = unresolvableReference ] = []) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..0c185833ed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..1a7875583c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..413d2db6ce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,87 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+ };
+};
+
+class C {
+ static method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..1dbf119c2c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,103 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..78d689ed44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,98 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..b687c1d24a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..8bee682ca7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..078ed2493c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..7c1e5eeba7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,95 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..8b0ea301c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..824f63ef6b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([{ x }] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..a52286646a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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).
+---*/
+
+class C {
+ static method([{ x }] = []) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..8d536d8bf9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..478c54ebc6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..974efa1e98
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..2abad8546c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..9d05ce26f7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7985bce454
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..82489d494b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..5532e679b0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..23e357765e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..1fda23354a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,80 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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(); })();
+
+class C {
+ static method([, ...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..bd1bd72375
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..4dac070b95
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..789cce3fcc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,91 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+}();
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..3f8c537878
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,93 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+ }
+ };
+};
+
+class C {
+ static method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..9196483b26
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..becf98ed27
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..cb38592a52
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..8df5adb4b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ static method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..47c21d6b6e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..aa6f0654d5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,80 @@
+// |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-decl-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..c936e7d16a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,80 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..bfe824cd54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..8616c2eaf9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..0df12743b0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static method({} = null) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..5482a527df
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static method({} = undefined) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..1dcb78a2f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..0c8e610e1f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ static method({ poisoned } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..db5d64d7c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,84 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..8a6acdd653
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..4c92b603ee
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..33fe20608e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..254a45fb30
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..16d7f045a0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..7f26af06e0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static method({ x = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..3f296a8bbc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ x = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..09fc7b81f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..100b54214c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..ef6b6e1a85
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..32afec6816
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..b9fec2f199
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d40c513688
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..1f4fd2c000
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ static method({ [thrower()]: x } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..6d011ce820
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,83 @@
+// 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-decl-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..533e81f45e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..331ef4acfd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static method({ x: y = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..34e0fe5d3f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ x: y = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..c6cf8b08a7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..6571168670
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..4fe6779887
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..9012ab99f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..2511427ef0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..e44cb5afa4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ w: { x, y, z } = undefined } = { }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..fc5fe12ffb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..6c44ed25f6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..421c74c656
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..920a42ae46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-init-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-null.js
new file mode 100644
index 0000000000..1dcebc3119
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-null.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-undefined.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..0d40623806
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-init-undefined.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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).
+---*/
+
+class C {
+ static method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..430b92a748
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..8a0bbac390
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ static method({ poisoned }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..23866529ed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,84 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..38873156c9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2a32fa47d0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..0eb3c8a31d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,85 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..0c91023450
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,86 @@
+// 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-decl-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..e1bd4dd951
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..8527fddbf5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static method({ x = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..02566d98d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ x = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..293689da4c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..99f50db21a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..ab3d9d65c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..958a69030d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..ab18550b2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..c650a387f9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..65afb213f1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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();
+}
+
+class C {
+ static method({ [thrower()]: x }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..77c09b30e6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,83 @@
+// 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-decl-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+ }
+});
+
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..e98bd1afb5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..bf83fa005b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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();
+}
+
+class C {
+ static method({ x: y = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..2ee5ed2af0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ x: y = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..3cd7d23406
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..b1c8a4d136
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..3ee0df407f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..49f17c6bbc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..ae37b91542
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..da1f927804
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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.
+---*/
+
+class C {
+ static method({ w: { x, y, z } = undefined }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..fea57dfe98
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..a770ea90a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..8072fe7119
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..32f93bfb90
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..5c392dcaa9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..c7afd65354
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..b6c8621b1a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b766f51794
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..79277a3f43
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..6cf6800fa6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..7ce755b4bb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4c0acc17f8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..ee466b2981
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..ade7fd21b9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..c74564f74e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..022cfb465a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..4a73424ab5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,91 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..abba0898ec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,93 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2ac4a448a9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,92 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..33ea96854c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,92 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..f9305418c3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,93 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..5ead11567a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..4db37e6b11
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..b4f31dcd6c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..079828c06a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..d58b13b9e3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..d2234a84dd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,109 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..b67ef13002
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..4ebaa3fa2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..91a9a0a157
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..c80fbbeae0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,101 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..8df54c1df5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..744d5fc2c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..5c9a25c370
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..73d1f05312
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..e75150ffba
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..fdc9602258
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,118 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..df1a672ec3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..5dd8852652
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..85c1ac7d59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..7dbcd84d6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..f2838c5b39
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..770a9a20ec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..c2d7216d9a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..c7549dac21
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..a10e288457
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..8ef03afce7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..1c358e07fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..166f55992c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..96b737df5d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..3924bf84cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..14cde88b29
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..3d6c1e35db
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..54f160cf23
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..3823e65211
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..24c7ad7b41
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..4d53cf4f3b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..f8963641df
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..3e6b0f7fc7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..88ee6b1757
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..57e549ed5e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..ddc9a9ad8e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..8720e6173a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..b6a784c5f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..de6eba1e62
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a73ce63344
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..12632d7677
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..ffdbd3602b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..9523fa58b6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..b55a511180
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..fc619299e8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..e7d42ad280
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..7248cb7412
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..2d918abaa8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,109 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..de945caba9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..da7b8871d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..7769013735
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..c56193ac17
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,101 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..e064b7fbbd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..056d49f571
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..ff9c600fe2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..b3c3060b2d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..5e4a7baef3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..b4d4a26e9b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,118 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..6db82a5215
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..af1f67bfbf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..977b261cdc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..8a8ab60709
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..2a3b4ffe36
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..2471513fcd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..a8f1dc96c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..59c17b3e83
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..0587e01b0f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..ca1a6cb75c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..352a65595c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..b1c63e5154
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..85010b5246
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..e7162c2ef9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..965a2c6306
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..c0fc68acc5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c65aac3dab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..7950cae0f0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..8bdf510a84
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..99cc90f75c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..9b8613fe4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..2d41f62d11
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..617fd832da
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..1c786ab378
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..bbdcb45d6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..45b5316041
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..3f0adefb70
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..0c95a50eed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..cce7a615a4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..6176c1e7fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..25a0f5b49e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method (default parameters))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..a1e57c2956
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..73a2e88fe1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..2420235701
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression method (default parameters))
+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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..f87909cbf6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..864d7c02c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..ddbf88da04
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..d297311c54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..afa707d2ef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..6b93f34787
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// 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-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..43dc08e2bc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..75e9f31a63
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..fae83b5565
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..a3391bbf10
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..fd4d92aecc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..95cdaa1c78
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..2397f74699
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..4e8ad1b210
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..05418aa63d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..84a4815aea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..5b68fbc521
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..3ba88c7034
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..debb0886f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..4ca3a11464
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-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: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ * #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/statements/class/dstr/private-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..127435de5c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..7d156e7d3e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..b34129cd3c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b6c7405ead
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..09dcd9547f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..341dd3f8c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..e1c3adb7b1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..e12e6df246
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..157c58a65d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..dbe8c7beaa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..fbe8ef0952
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..5d9a566565
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..c097982786
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..988101c990
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..791be9102e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..3d527a6cc8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..479c84a633
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..8c031ae289
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..0ef744bfac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..6d17df77fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..954e1e06a1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..60b7713822
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..ebba9fb209
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,109 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..cbe2780269
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..118af221d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..c7c83f5e9b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..9de34b02cb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,101 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..fe33488c09
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..09e2dae315
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..4a183f15fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..557ddf2e3b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..6d88bd2098
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..8f04a77eb0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,118 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..a64ad48fa1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..613d9db4a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..e121847fb3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..9921121677
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..ba392de7f0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..04111f98aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Lone rest element (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..0c1e144905
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..04f38775a9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..412e2a26d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..cc39d9eba6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..4b048c5779
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..fd1fec1cf2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..c7e9e928fb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..bf51b08840
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..93e8efb994
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..7d385d15d7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..b6461f9c61
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..014e13d47a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..9744e916a1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..5c4d67f420
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..8d64a6fa67
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..0bf17c9718
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..2b58d43bec
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..bf711c5690
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..eaaf9f8737
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..ac83e65726
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..93d4296816
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..7f883119c1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a82d02a636
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,92 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..0a1ac078b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..57379d6be8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,93 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..8efab8fe79
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..7e79b330ef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..ada5adb6b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..7a41ca20c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..a9674abee6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..061cec1b0f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,109 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..c333b22617
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..428f27a538
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..e668c063aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..0856018c6e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,101 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..a720f8a56c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..7ae8335341
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..c51414d3fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..50e3c97c2c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..37b616dbb9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..8f02c70ddd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,118 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0c593ee363
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..ccd05a513e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..6e80363cf5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..e347414f1f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..1e67162ab6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..a078ffb200
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..21745f3e65
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..2d3b34b647
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,86 @@
+// |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-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..33203306c8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..17f882f817
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..50de85084f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..e94b86d533
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,86 @@
+// |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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..a6b62d5f53
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..2fd7a669cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..f53cd60905
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..53e9be9cf0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c0cdbb5846
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..096e11af4f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// 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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..3a8f97be53
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..5305891559
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..0322d8fc04
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..a74701c403
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..85ffc85b34
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..7ba68d5bdc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..ad13e6224e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..2c94cce370
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..16ff749460
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..1025b98f30
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..204d83334e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..029e9841ac
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..a0f1cf1196
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..8aaf613f2a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..6e5fa48892
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..eb89e8c38a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (private static class expression generator method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..1fffaa6251
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..f737f64f05
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..3824f5549b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..42be5450c2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e4c5198faf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..f89005dad8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// 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-decl-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..8a3870b9f5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..b9251d2ef8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..27390ef80a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..d3a8f48c77
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..71896ded79
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..b633c84655
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..2139b734c9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..382fe94c8e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..5555927ec6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..d2d132a25f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..1dec9e2a75
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..518777f02d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..660628a74c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..5f18d266b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-decl-private-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression generator method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..e67f314cf9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..80eafc152b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..027780a582
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..bf66e3f137
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..e1b2d300b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..3d0edf64e3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..41b0bbd28e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..a15d5f03b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..15a6a738f1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..07b66e65fa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..859c676e53
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..73bda913c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..530f7fb021
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..a20b579192
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2cf571fbde
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..7f69ab7bcb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..71080d2f59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..b1f9271bde
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..98e8938e8f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..b4bf7edd2f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..9d796f54b9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..3526bd3efb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..4485b87315
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..7b6b625439
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..cfc80094cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..da9b35a11f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..78d4f98170
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..26f2957c1b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..867d9001d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..c1cf084dd6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Elision advances iterator (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..01e416e359
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..62abf52a4b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..885840c43b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing an elision (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..c98ab4b72f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..a271cd9742
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing a rest element (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..41b1e92abc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Lone rest element (direct binding) (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..0fea03cdf7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element following elision elements (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..70926f7d70
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..4a062e5923
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Lone rest element (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..1caf23d11d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..e951bf6636
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..dd5a1a293d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..7d85a99478
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..564123314c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..3b293c3670
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..0813d1068f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..dd166a1b45
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..9a9529a6c9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..25e96952e7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..3f2f674dd4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..c0c419b439
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..49db54bded
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..213ce44ec1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..6cf5fa2f1c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..b6a61f3488
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..6e035507d2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..051f06268b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..65bc609182
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..61be2a8e69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..08d3628327
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..6cb3dd7dc3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..e3695c9aa0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..d479070e87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c4e5267b8e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..01bf4e1e62
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..7158fd9163
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..803968e748
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..81cb2bf874
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..f6a7172213
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..d9df8bda9d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..05fab51268
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..1c906c9262
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..27db293fbb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..70f555da9d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..41c1420324
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..6d67bd0032
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..c83d9d705e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..ec1ab86696
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..624564c5b7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..457bd3334d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..08361b0b02
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..41faa91bfb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..cb25bdd0f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..ce84f0b190
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..d275436ada
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..6cde98bae8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Lone rest element (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..5a897fd714
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..f659b3f79e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..949cd85abc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..5dc3556f1c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..3d87f97704
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..35419eb270
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..b7c3b6186a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..59877ad529
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..9a14bb6f69
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..1f5df25586
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..7e2f45b612
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..44e84582ce
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..8f1b11c85f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..fade38e1b0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..eaa3b6bd2f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..57f52851fb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..99fd8affa7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..212dc77a49
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..a5209a9c97
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..c9007f940b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..880544be5e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..5b23b7fe7a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..2acafc5edf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..9778adeb4b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..5842f1912c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..15f34504d9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..9a4f251c65
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..5437d9d9bc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..c0e13217a1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2330d077b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..4af2ecddda
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..ecbe73d7b1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e63746391e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..0303047613
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..8235421dd3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..6a82712de9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..1093eadb3c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..dcab838f14
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..334f8b2c57
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..c271947ded
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..ea288eb7dc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..ac53632f7a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..06d30c1eb3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..b8199b954a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..9b785b3758
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..48a01f4bd3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..53c2d12d13
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..ce05388c5c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth.template
+/*---
+description: Rest object contains just unextracted data (private class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ #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/statements/class/dstr/private-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..67fef4ff99
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..86276e0d00
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..dddf6a08aa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..6013316089
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..ce59e7de59
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..9074589b89
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..d8c4a42cef
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..e92c218389
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..fe07210890
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..463888fafa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..d0bd01db36
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..b2888b6bed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..3dbb00a948
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..8ccc0e9836
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..19951201fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..55b63b4054
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..205f141eaf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..2b8aa58d8b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..b6c585290c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..b090428f87
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..5a156fa06e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..75cf9a72a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..7139764c6f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..ecac85ffc5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..d2151a8aee
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..246df99536
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..1338f7693e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..306233bfb9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..8fa86fd5fb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..40dccdcdc1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..7b8c255b6a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..bd6f465685
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..6eb2d733b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0526dd7ea9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..239bd18659
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..c2bf23e660
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..0dd975f7a8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..d157abe604
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..6033c1228a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Lone rest element (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..950b8b2665
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..123354e379
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..59279e3f46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..e2ecaed254
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..3217fbee28
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..fd51675b7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..db91ba3dbd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..5dab0a6c60
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..1887cf6e5f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..885c4f67c5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..ac72b2656c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..543ec000b3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..96ff3f7c46
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..1ec8532a26
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..15ea70f430
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..41ea47e7f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..365b93402d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..bb2383e60c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..6f648b7b8a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..7c8b1be34e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..b9f0d35f7f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..257ddc0b23
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..37524d12eb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..97c8cc6ffe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..6dff2face9
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..8f68bcb24e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..fb8ae2242e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..90e17f939a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..af815e2508
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..ddf3bfe61f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..85f7fc70de
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..a7f4633384
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..7c751e1e55
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..c702b2cba0
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..70178f28c6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..0bf680efbd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..e256757602
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..cd4ae586ed
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..ec22da64b8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..2607eaf454
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..35078291d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..14432e9b54
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..fceae6e266
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..e45d9b9050
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..74b7ac453c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..cd7f0b4dfa
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..ab58474e1b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..b32f8f8f83
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..50b58ccc44
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..515b36e176
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..f0aeff0761
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..d3d6881ab1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..e93ed26e0d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..c26920b995
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..e346444e39
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..88f8d653b4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..435aee1ab6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..0071f451d3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..e3b53773bc
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e201800a28
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..99bca0477d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..e3bc0889cf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..efd4e14b89
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..770939a957
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..7a9044161d
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d9774777ad
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..d09b25c420
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..d351ac5afe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..ab4ecf7b62
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..39f15c0ae5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..2a6871aec1
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..ce24fef3c4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..cb0e46ae21
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-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-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..a5f96d22fd
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..277bda2fe2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (private static class expression method (default parameter))
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..ad80335aea
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..c7f15b925a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..41654d52fe
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..e3292e120e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..04c75fa9d6
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..1c45df27ab
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..3f12a20fcf
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..57eed183a8
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..b988415e5b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..3d9554b564
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d443705739
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..3427ed5583
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..da00572f52
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..dd2b10246e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..4c4f7311b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..42e0831d98
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..c1caf23a4e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is 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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..658d09f678
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..c2bbf73cb3
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/statements/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..2e8bbdc4c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/private-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-decl-private-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression method)
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(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;
+class C {
+ 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/statements/class/dstr/shell.js b/js/src/tests/test262/language/statements/class/dstr/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/class/dstr/shell.js