From 2e042d9f9d10e30d50f0e5aeac3abf40f2b9a6b9 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Thu, 21 Dec 2017 17:15:06 +0100 Subject: [PATCH] Regenerate tests --- ...elds-after-same-line-gen-computed-names.js | 12 +- ...ter-same-line-gen-static-computed-names.js | 56 --------- ...e-line-gen-static-computed-symbol-names.js | 70 ----------- ...fter-same-line-gen-static-literal-names.js | 73 ------------ ...fter-same-line-gen-static-private-names.js | 66 ----------- ...s-after-same-line-method-computed-names.js | 12 +- ...-same-line-method-static-computed-names.js | 56 --------- ...ine-method-static-computed-symbol-names.js | 70 ----------- ...r-same-line-method-static-literal-names.js | 73 ------------ ...r-same-line-method-static-private-names.js | 66 ----------- ...me-line-static-async-gen-computed-names.js | 12 +- ...-static-async-gen-static-computed-names.js | 60 ---------- ...-async-gen-static-computed-symbol-names.js | 74 ------------ ...e-static-async-gen-static-literal-names.js | 77 ------------- ...e-static-async-gen-static-private-names.js | 70 ----------- ...line-static-async-method-computed-names.js | 12 +- ...atic-async-method-static-computed-names.js | 59 ---------- ...ync-method-static-computed-symbol-names.js | 73 ------------ ...tatic-async-method-static-literal-names.js | 76 ------------ ...tatic-async-method-static-private-names.js | 69 ----------- ...ter-same-line-static-gen-computed-names.js | 12 +- ...e-line-static-gen-static-computed-names.js | 56 --------- ...static-gen-static-computed-symbol-names.js | 70 ----------- ...me-line-static-gen-static-literal-names.js | 73 ------------ ...me-line-static-gen-static-private-names.js | 66 ----------- ...-same-line-static-method-computed-names.js | 12 +- ...ine-static-method-static-computed-names.js | 56 --------- ...tic-method-static-computed-symbol-names.js | 70 ----------- ...line-static-method-static-literal-names.js | 73 ------------ ...line-static-method-static-private-names.js | 66 ----------- ...fields-computed-name-toprimitive-symbol.js | 3 - .../class/fields-computed-name-toprimitive.js | 3 - ...riable-name-static-propname-constructor.js | 33 ------ ...variable-name-static-propname-prototype.js | 33 ------ ...tion-error-computed-name-referenceerror.js | 3 - ...ion-error-computed-name-toprimitive-err.js | 3 - ...uation-error-computed-name-tostring-err.js | 3 - ...luation-error-computed-name-valueof-err.js | 3 - .../class/fields-init-value-incremental.js | 38 ++---- ...iteral-name-static-propname-constructor.js | 31 ----- ...-literal-name-static-propname-prototype.js | 31 ----- ...lds-multiple-definitions-computed-names.js | 12 +- ...tiple-definitions-static-computed-names.js | 92 --------------- ...efinitions-static-computed-symbol-names.js | 106 ----------------- ...ltiple-definitions-static-literal-names.js | 109 ------------------ ...ltiple-definitions-static-private-names.js | 102 ---------------- ...iple-stacked-definitions-computed-names.js | 12 +- ...acked-definitions-static-computed-names.js | 70 ----------- ...efinitions-static-computed-symbol-names.js | 84 -------------- ...tacked-definitions-static-literal-names.js | 87 -------------- ...tacked-definitions-static-private-names.js | 80 ------------- ...ds-new-no-sc-line-method-computed-names.js | 12 +- ...no-sc-line-method-static-computed-names.js | 57 --------- ...ine-method-static-computed-symbol-names.js | 71 ------------ ...-no-sc-line-method-static-literal-names.js | 74 ------------ ...-no-sc-line-method-static-private-names.js | 67 ----------- .../fields-new-sc-line-gen-computed-names.js | 12 +- ...s-new-sc-line-gen-static-computed-names.js | 57 --------- ...c-line-gen-static-computed-symbol-names.js | 71 ------------ ...ds-new-sc-line-gen-static-literal-names.js | 74 ------------ ...ds-new-sc-line-gen-static-private-names.js | 67 ----------- ...ields-new-sc-line-method-computed-names.js | 12 +- ...ew-sc-line-method-static-computed-names.js | 57 --------- ...ine-method-static-computed-symbol-names.js | 71 ------------ ...new-sc-line-method-static-literal-names.js | 74 ------------ ...new-sc-line-method-static-private-names.js | 67 ----------- ...elds-regular-definitions-computed-names.js | 12 +- ...gular-definitions-static-computed-names.js | 46 -------- ...efinitions-static-computed-symbol-names.js | 60 ---------- ...egular-definitions-static-literal-names.js | 63 ---------- ...egular-definitions-static-private-names.js | 55 --------- ...elds-same-line-async-gen-computed-names.js | 12 +- ...me-line-async-gen-static-computed-names.js | 60 ---------- ...-async-gen-static-computed-symbol-names.js | 74 ------------ ...ame-line-async-gen-static-literal-names.js | 77 ------------- ...ame-line-async-gen-static-private-names.js | 70 ----------- ...s-same-line-async-method-computed-names.js | 12 +- ...line-async-method-static-computed-names.js | 59 ---------- ...ync-method-static-computed-symbol-names.js | 73 ------------ ...-line-async-method-static-literal-names.js | 76 ------------ ...-line-async-method-static-private-names.js | 69 ----------- .../fields-same-line-gen-computed-names.js | 12 +- ...lds-same-line-gen-static-computed-names.js | 56 --------- ...e-line-gen-static-computed-symbol-names.js | 70 ----------- ...elds-same-line-gen-static-literal-names.js | 73 ------------ ...elds-same-line-gen-static-private-names.js | 66 ----------- .../fields-same-line-method-computed-names.js | 12 +- ...-same-line-method-static-computed-names.js | 56 --------- ...ine-method-static-computed-symbol-names.js | 70 ----------- ...s-same-line-method-static-literal-names.js | 73 ------------ ...s-same-line-method-static-private-names.js | 66 ----------- ...c-comp-name-init-err-contains-arguments.js | 35 ------ ...tatic-comp-name-init-err-contains-super.js | 28 ----- ...static-computed-name-toprimitive-symbol.js | 105 ----------------- ...fields-static-computed-name-toprimitive.js | 102 ---------------- ...tic-literal-init-err-contains-arguments.js | 34 ------ ...-static-literal-init-err-contains-super.js | 27 ----- ...tic-private-init-err-contains-arguments.js | 34 ------ ...-static-private-init-err-contains-super.js | 27 ----- .../fields-static-redeclaration-symbol.js | 50 -------- .../class/fields-static-redeclaration.js | 50 -------- ...iteral-name-init-err-contains-arguments.js | 34 ------ ...ng-literal-name-init-err-contains-super.js | 27 ----- ...string-name-static-propname-constructor.js | 32 ----- ...s-string-name-static-propname-prototype.js | 32 ----- .../fields-wrapped-in-sc-computed-names.js | 12 +- ...lds-wrapped-in-sc-static-computed-names.js | 48 -------- ...pped-in-sc-static-computed-symbol-names.js | 62 ---------- ...elds-wrapped-in-sc-static-literal-names.js | 65 ----------- ...elds-wrapped-in-sc-static-private-names.js | 57 --------- ...elds-after-same-line-gen-computed-names.js | 12 +- ...ter-same-line-gen-static-computed-names.js | 56 --------- ...e-line-gen-static-computed-symbol-names.js | 70 ----------- ...fter-same-line-gen-static-literal-names.js | 73 ------------ ...fter-same-line-gen-static-private-names.js | 66 ----------- ...s-after-same-line-method-computed-names.js | 12 +- ...-same-line-method-static-computed-names.js | 56 --------- ...ine-method-static-computed-symbol-names.js | 70 ----------- ...r-same-line-method-static-literal-names.js | 73 ------------ ...r-same-line-method-static-private-names.js | 66 ----------- ...me-line-static-async-gen-computed-names.js | 12 +- ...-static-async-gen-static-computed-names.js | 60 ---------- ...-async-gen-static-computed-symbol-names.js | 74 ------------ ...e-static-async-gen-static-literal-names.js | 77 ------------- ...e-static-async-gen-static-private-names.js | 70 ----------- ...line-static-async-method-computed-names.js | 12 +- ...atic-async-method-static-computed-names.js | 59 ---------- ...ync-method-static-computed-symbol-names.js | 73 ------------ ...tatic-async-method-static-literal-names.js | 76 ------------ ...tatic-async-method-static-private-names.js | 69 ----------- ...ter-same-line-static-gen-computed-names.js | 12 +- ...e-line-static-gen-static-computed-names.js | 56 --------- ...static-gen-static-computed-symbol-names.js | 70 ----------- ...me-line-static-gen-static-literal-names.js | 73 ------------ ...me-line-static-gen-static-private-names.js | 66 ----------- ...-same-line-static-method-computed-names.js | 12 +- ...ine-static-method-static-computed-names.js | 56 --------- ...tic-method-static-computed-symbol-names.js | 70 ----------- ...line-static-method-static-literal-names.js | 73 ------------ ...line-static-method-static-private-names.js | 66 ----------- ...s-comp-name-init-err-contains-arguments.js | 35 ------ ...ields-comp-name-init-err-contains-super.js | 28 ----- ...fields-computed-name-toprimitive-symbol.js | 3 - .../class/fields-computed-name-toprimitive.js | 3 - ...riable-name-static-propname-constructor.js | 33 ------ ...variable-name-static-propname-prototype.js | 33 ------ ...tion-error-computed-name-referenceerror.js | 3 - ...ion-error-computed-name-toprimitive-err.js | 3 - ...uation-error-computed-name-tostring-err.js | 3 - ...luation-error-computed-name-valueof-err.js | 3 - .../class/fields-init-value-incremental.js | 38 ++---- ...iteral-name-static-propname-constructor.js | 31 ----- ...-literal-name-static-propname-prototype.js | 31 ----- ...lds-multiple-definitions-computed-names.js | 12 +- ...tiple-definitions-static-computed-names.js | 92 --------------- ...efinitions-static-computed-symbol-names.js | 106 ----------------- ...ltiple-definitions-static-literal-names.js | 109 ------------------ ...ltiple-definitions-static-private-names.js | 102 ---------------- ...iple-stacked-definitions-computed-names.js | 12 +- ...acked-definitions-static-computed-names.js | 70 ----------- ...efinitions-static-computed-symbol-names.js | 84 -------------- ...tacked-definitions-static-literal-names.js | 87 -------------- ...tacked-definitions-static-private-names.js | 80 ------------- ...ds-new-no-sc-line-method-computed-names.js | 12 +- ...no-sc-line-method-static-computed-names.js | 57 --------- ...ine-method-static-computed-symbol-names.js | 71 ------------ ...-no-sc-line-method-static-literal-names.js | 74 ------------ ...-no-sc-line-method-static-private-names.js | 67 ----------- .../fields-new-sc-line-gen-computed-names.js | 12 +- ...s-new-sc-line-gen-static-computed-names.js | 57 --------- ...c-line-gen-static-computed-symbol-names.js | 71 ------------ ...ds-new-sc-line-gen-static-literal-names.js | 74 ------------ ...ds-new-sc-line-gen-static-private-names.js | 67 ----------- ...ields-new-sc-line-method-computed-names.js | 12 +- ...ew-sc-line-method-static-computed-names.js | 57 --------- ...ine-method-static-computed-symbol-names.js | 71 ------------ ...new-sc-line-method-static-literal-names.js | 74 ------------ ...new-sc-line-method-static-private-names.js | 67 ----------- ...elds-regular-definitions-computed-names.js | 12 +- ...gular-definitions-static-computed-names.js | 46 -------- ...efinitions-static-computed-symbol-names.js | 60 ---------- ...egular-definitions-static-literal-names.js | 63 ---------- ...egular-definitions-static-private-names.js | 55 --------- ...elds-same-line-async-gen-computed-names.js | 12 +- ...me-line-async-gen-static-computed-names.js | 60 ---------- ...-async-gen-static-computed-symbol-names.js | 74 ------------ ...ame-line-async-gen-static-literal-names.js | 77 ------------- ...ame-line-async-gen-static-private-names.js | 70 ----------- ...s-same-line-async-method-computed-names.js | 12 +- ...line-async-method-static-computed-names.js | 59 ---------- ...ync-method-static-computed-symbol-names.js | 73 ------------ ...-line-async-method-static-literal-names.js | 76 ------------ ...-line-async-method-static-private-names.js | 69 ----------- .../fields-same-line-gen-computed-names.js | 12 +- ...lds-same-line-gen-static-computed-names.js | 56 --------- ...e-line-gen-static-computed-symbol-names.js | 70 ----------- ...elds-same-line-gen-static-literal-names.js | 73 ------------ ...elds-same-line-gen-static-private-names.js | 66 ----------- .../fields-same-line-method-computed-names.js | 12 +- ...-same-line-method-static-computed-names.js | 56 --------- ...ine-method-static-computed-symbol-names.js | 70 ----------- ...s-same-line-method-static-literal-names.js | 73 ------------ ...s-same-line-method-static-private-names.js | 66 ----------- ...c-comp-name-init-err-contains-arguments.js | 35 ------ ...tatic-comp-name-init-err-contains-super.js | 28 ----- ...static-computed-name-toprimitive-symbol.js | 105 ----------------- ...fields-static-computed-name-toprimitive.js | 102 ---------------- ...tic-literal-init-err-contains-arguments.js | 34 ------ ...-static-literal-init-err-contains-super.js | 27 ----- ...tic-private-init-err-contains-arguments.js | 34 ------ ...-static-private-init-err-contains-super.js | 27 ----- .../fields-static-redeclaration-symbol.js | 50 -------- .../class/fields-static-redeclaration.js | 50 -------- ...iteral-name-init-err-contains-arguments.js | 34 ------ ...ng-literal-name-init-err-contains-super.js | 27 ----- ...string-name-static-propname-constructor.js | 32 ----- ...s-string-name-static-propname-prototype.js | 32 ----- .../fields-wrapped-in-sc-computed-names.js | 12 +- ...lds-wrapped-in-sc-static-computed-names.js | 48 -------- ...pped-in-sc-static-computed-symbol-names.js | 62 ---------- ...elds-wrapped-in-sc-static-literal-names.js | 65 ----------- ...elds-wrapped-in-sc-static-private-names.js | 57 --------- 222 files changed, 56 insertions(+), 11415 deletions(-) delete mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js delete mode 100644 test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js delete mode 100644 test/language/expressions/class/fields-literal-name-static-propname-constructor.js delete mode 100644 test/language/expressions/class/fields-literal-name-static-propname-prototype.js delete mode 100644 test/language/expressions/class/fields-multiple-definitions-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-multiple-definitions-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-multiple-definitions-static-private-names.js delete mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js delete mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-regular-definitions-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-regular-definitions-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-regular-definitions-static-private-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-same-line-async-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-same-line-gen-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-same-line-gen-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-same-line-gen-static-private-names.js delete mode 100644 test/language/expressions/class/fields-same-line-method-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-same-line-method-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-same-line-method-static-private-names.js delete mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js delete mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js delete mode 100644 test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js delete mode 100644 test/language/expressions/class/fields-static-computed-name-toprimitive.js delete mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js delete mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-super.js delete mode 100644 test/language/expressions/class/fields-static-private-init-err-contains-arguments.js delete mode 100644 test/language/expressions/class/fields-static-private-init-err-contains-super.js delete mode 100644 test/language/expressions/class/fields-static-redeclaration-symbol.js delete mode 100644 test/language/expressions/class/fields-static-redeclaration.js delete mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js delete mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js delete mode 100644 test/language/expressions/class/fields-string-name-static-propname-constructor.js delete mode 100644 test/language/expressions/class/fields-string-name-static-propname-prototype.js delete mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js delete mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js delete mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js delete mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-arguments.js delete mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js delete mode 100644 test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js delete mode 100644 test/language/statements/class/fields-literal-name-static-propname-constructor.js delete mode 100644 test/language/statements/class/fields-literal-name-static-propname-prototype.js delete mode 100644 test/language/statements/class/fields-multiple-definitions-static-computed-names.js delete mode 100644 test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-multiple-definitions-static-literal-names.js delete mode 100644 test/language/statements/class/fields-multiple-definitions-static-private-names.js delete mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js delete mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js delete mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js delete mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-new-sc-line-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-regular-definitions-static-computed-names.js delete mode 100644 test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-regular-definitions-static-literal-names.js delete mode 100644 test/language/statements/class/fields-regular-definitions-static-private-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-same-line-async-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-same-line-gen-static-computed-names.js delete mode 100644 test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-same-line-gen-static-literal-names.js delete mode 100644 test/language/statements/class/fields-same-line-gen-static-private-names.js delete mode 100644 test/language/statements/class/fields-same-line-method-static-computed-names.js delete mode 100644 test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-same-line-method-static-literal-names.js delete mode 100644 test/language/statements/class/fields-same-line-method-static-private-names.js delete mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js delete mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js delete mode 100644 test/language/statements/class/fields-static-computed-name-toprimitive.js delete mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-arguments.js delete mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-static-private-init-err-contains-arguments.js delete mode 100644 test/language/statements/class/fields-static-private-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-static-redeclaration-symbol.js delete mode 100644 test/language/statements/class/fields-static-redeclaration.js delete mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js delete mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-string-name-static-propname-constructor.js delete mode 100644 test/language/statements/class/fields-string-name-static-propname-prototype.js delete mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js delete mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js delete mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js delete mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-private-names.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-gen-computed-names.js index 276f5ea3ec..874f2cdfcb 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js deleted file mode 100644 index d4eb5d94a5..0000000000 --- a/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-gen.template -/*--- -description: Static Computed property names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 434717683a..0000000000 --- a/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-gen.template -/*--- -description: Static computed property symbol names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js deleted file mode 100644 index 385c526537..0000000000 --- a/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-gen.template -/*--- -description: Static literal property names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js deleted file mode 100644 index 5264b5e105..0000000000 --- a/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-gen.template -/*--- -description: literal private names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-method-computed-names.js index 3cf693950b..21da891022 100644 --- a/test/language/expressions/class/fields-after-same-line-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js deleted file mode 100644 index c9e4909fc9..0000000000 --- a/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-method.template -/*--- -description: Static Computed property names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js deleted file mode 100644 index ff9639338d..0000000000 --- a/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-method.template -/*--- -description: Static computed property symbol names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js deleted file mode 100644 index 11fd3d4eb2..0000000000 --- a/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-method.template -/*--- -description: Static literal property names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-method-static-private-names.js deleted file mode 100644 index a8e2ec2833..0000000000 --- a/test/language/expressions/class/fields-after-same-line-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-method.template -/*--- -description: literal private names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js index e6c23736e8..2a66b8ee76 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js deleted file mode 100644 index ed5ebb9125..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template -/*--- -description: Static Computed property names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static async *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js deleted file mode 100644 index f14ea7dc83..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template -/*--- -description: Static computed property symbol names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static async *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js deleted file mode 100644 index c536ba4760..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js +++ /dev/null @@ -1,77 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template -/*--- -description: Static literal property names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static async *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js deleted file mode 100644 index 7d535ac73f..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template -/*--- -description: literal private names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static async *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js index 8788d21cd6..e39f9c059d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js deleted file mode 100644 index 9eeea58274..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js +++ /dev/null @@ -1,59 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template -/*--- -description: Static Computed property names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static async m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js deleted file mode 100644 index 3b0d1ff862..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template -/*--- -description: Static computed property symbol names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static async m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js deleted file mode 100644 index b75f156063..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js +++ /dev/null @@ -1,76 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template -/*--- -description: Static literal property names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static async m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js deleted file mode 100644 index 5efb076bfe..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js +++ /dev/null @@ -1,69 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template -/*--- -description: literal private names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static async m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js index 90cb115906..4f3cf3e534 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js deleted file mode 100644 index d16244fc58..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template -/*--- -description: Static Computed property names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js deleted file mode 100644 index 40e7e89014..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template -/*--- -description: Static computed property symbol names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js deleted file mode 100644 index 68d70716dd..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template -/*--- -description: Static literal property names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js deleted file mode 100644 index 03c13aff6a..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template -/*--- -description: literal private names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js index 14055957b6..66eb3d0989 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js deleted file mode 100644 index a7af9730f5..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-method.template -/*--- -description: Static Computed property names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js deleted file mode 100644 index 5e87b77606..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-method.template -/*--- -description: Static computed property symbol names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js deleted file mode 100644 index 49df930792..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-method.template -/*--- -description: Static literal property names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js deleted file mode 100644 index 5d189f0ee2..0000000000 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-static-method.template -/*--- -description: literal private names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js index b5091ccf8b..c9437b784d 100644 --- a/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js @@ -24,9 +24,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-computed-name-toprimitive.js b/test/language/expressions/class/fields-computed-name-toprimitive.js index d31d76da0b..7329aa9b8f 100644 --- a/test/language/expressions/class/fields-computed-name-toprimitive.js +++ b/test/language/expressions/class/fields-computed-name-toprimitive.js @@ -24,9 +24,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js deleted file mode 100644 index b0926b084c..0000000000 --- a/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-expr-static-variable-name.template -/*--- -description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -var constructor = 'foo'; -var C = class { - static [constructor]; -}; - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js deleted file mode 100644 index dfd2688c61..0000000000 --- a/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-expr-static-variable-name.template -/*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -var prototype = 'foo'; -var C = class { - static [prototype]; -}; - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js b/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js index 55b8903ef2..66a6c14326 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js index 022302ffe8..0522c25592 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js index a62a628be0..cecb9de938 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js index 70cf9c1a42..f709947c11 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/expressions/class/fields-init-value-incremental.js b/test/language/expressions/class/fields-init-value-incremental.js index f2d9cc5b5d..b2b87b9924 100644 --- a/test/language/expressions/class/fields-init-value-incremental.js +++ b/test/language/expressions/class/fields-init-value-incremental.js @@ -28,57 +28,41 @@ info: | ... ---*/ -var x = 0; +var x = 1; var C = class { - static [x++] = x++; [x++] = x++; - static [x++] = x++; [x++] = x++; } var c1 = new C(); var c2 = new C(); -verifyProperty(C, "0", { +verifyProperty(c1, "1", { + value: 3, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "2", { value: 4, enumerable: true, configurable: true, writable: true, }); -verifyProperty(C, "2", { +verifyProperty(c2, "1", { value: 5, enumerable: true, configurable: true, writable: true, }); -verifyProperty(c1, "1", { +verifyProperty(c2, "2", { value: 6, enumerable: true, configurable: true, writable: true, }); - -verifyProperty(c1, "3", { - value: 7, - enumerable: true, - configurable: true, - writable: true, -}); - -verifyProperty(c2, "1", { - value: 8, - enumerable: true, - configurable: true, - writable: true, -}); - -verifyProperty(c2, "3", { - value: 9, - enumerable: true, - configurable: true, - writable: true, -}); diff --git a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js deleted file mode 100644 index 68f53fa6b9..0000000000 --- a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-expr-static-literal-name.template -/*--- -description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static constructor; -}; diff --git a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js deleted file mode 100644 index eeae36ff86..0000000000 --- a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-expr-static-literal-name.template -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static prototype; -}; diff --git a/test/language/expressions/class/fields-multiple-definitions-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-computed-names.js index 8ed1b87597..a2ee0a53a3 100644 --- a/test/language/expressions/class/fields-multiple-definitions-computed-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; var C = class { foo = "foobar"; m() { return 42 } - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] m2() { return 39 } bar = "barbaz"; @@ -76,16 +76,6 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js deleted file mode 100644 index 92ef982b74..0000000000 --- a/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js +++ /dev/null @@ -1,92 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-multiple-definitions.template -/*--- -description: Static Computed property names (multiple fields definitions) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - foo = "foobar"; - m() { return 42 } - static ["a"] = 42; ["a"] = 39 - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js deleted file mode 100644 index 65e1141c14..0000000000 --- a/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,106 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-multiple-definitions.template -/*--- -description: Static computed property symbol names (multiple fields definitions) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - foo = "foobar"; - m() { return 42 } - static [x]; static [y] = 42 - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js deleted file mode 100644 index 84a77a9fa8..0000000000 --- a/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js +++ /dev/null @@ -1,109 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-multiple-definitions.template -/*--- -description: Static literal property names (multiple fields definitions) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - foo = "foobar"; - m() { return 42 } - static a; b = 42; - static c = fn - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-names.js b/test/language/expressions/class/fields-multiple-definitions-static-private-names.js deleted file mode 100644 index 569bf4009f..0000000000 --- a/test/language/expressions/class/fields-multiple-definitions-static-private-names.js +++ /dev/null @@ -1,102 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-multiple-definitions.template -/*--- -description: literal private names (multiple fields definitions) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - foo = "foobar"; - m() { return 42 } - static #x; static #y - m2() { return 39 } - bar = "barbaz"; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js index d9e10fc185..fb384b1376 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] foo = "foobar" bar = "barbaz"; @@ -54,16 +54,6 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js deleted file mode 100644 index 9e68617be1..0000000000 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template -/*--- -description: Static Computed property names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39 - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js deleted file mode 100644 index c994b78a6f..0000000000 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,84 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template -/*--- -description: Static computed property symbol names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42 - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js deleted file mode 100644 index 6219861ca6..0000000000 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js +++ /dev/null @@ -1,87 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template -/*--- -description: Static literal property names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js deleted file mode 100644 index 21318d79cb..0000000000 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js +++ /dev/null @@ -1,80 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template -/*--- -description: literal private names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y - foo = "foobar" - bar = "barbaz"; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js index e8113932c1..50538a5dea 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js deleted file mode 100644 index 464a71538d..0000000000 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39 - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js deleted file mode 100644 index c1a27011cc..0000000000 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42 - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js deleted file mode 100644 index 45e689f095..0000000000 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js deleted file mode 100644 index ab4a9d7acd..0000000000 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template -/*--- -description: literal private names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y - m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js b/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js index 645cffcce4..5d1e910a38 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js deleted file mode 100644 index d2f0dc95bc..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-generator.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 909736bc13..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-generator.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js deleted file mode 100644 index ffaf1c5e19..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-generator.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js deleted file mode 100644 index e5db6f9d5b..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-generator.template -/*--- -description: literal private names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y; - *m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-method-computed-names.js b/test/language/expressions/class/fields-new-sc-line-method-computed-names.js index 70f8062e69..37a17dee8f 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js deleted file mode 100644 index a0ffe35ee5..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js deleted file mode 100644 index 04c6e69d49..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js deleted file mode 100644 index 93ca7e9f49..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js deleted file mode 100644 index 12b45da237..0000000000 --- a/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-new-sc-line-method.template -/*--- -description: literal private names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y; - m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-regular-definitions-computed-names.js b/test/language/expressions/class/fields-regular-definitions-computed-names.js index 8b59a90cba..fc724d59d0 100644 --- a/test/language/expressions/class/fields-regular-definitions-computed-names.js +++ b/test/language/expressions/class/fields-regular-definitions-computed-names.js @@ -24,22 +24,12 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] } var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-regular-definitions-static-computed-names.js b/test/language/expressions/class/fields-regular-definitions-static-computed-names.js deleted file mode 100644 index d2ccde7dab..0000000000 --- a/test/language/expressions/class/fields-regular-definitions-static-computed-names.js +++ /dev/null @@ -1,46 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-regular-definitions.template -/*--- -description: Static Computed property names (regular fields defintion) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39 - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js deleted file mode 100644 index c6048d94bc..0000000000 --- a/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-regular-definitions.template -/*--- -description: Static computed property symbol names (regular fields defintion) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42 - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-regular-definitions-static-literal-names.js b/test/language/expressions/class/fields-regular-definitions-static-literal-names.js deleted file mode 100644 index 8881f62da9..0000000000 --- a/test/language/expressions/class/fields-regular-definitions-static-literal-names.js +++ /dev/null @@ -1,63 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-regular-definitions.template -/*--- -description: Static literal property names (regular fields defintion) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-regular-definitions-static-private-names.js b/test/language/expressions/class/fields-regular-definitions-static-private-names.js deleted file mode 100644 index ca118a4844..0000000000 --- a/test/language/expressions/class/fields-regular-definitions-static-private-names.js +++ /dev/null @@ -1,55 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-regular-definitions.template -/*--- -description: literal private names (regular fields defintion) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js index 527601afad..d312f9c70d 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js deleted file mode 100644 index 854b7f0dd0..0000000000 --- a/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template -/*--- -description: Static Computed property names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - async *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js deleted file mode 100644 index ea307cbfd1..0000000000 --- a/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template -/*--- -description: Static computed property symbol names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - async *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js deleted file mode 100644 index ec1e03715b..0000000000 --- a/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js +++ /dev/null @@ -1,77 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template -/*--- -description: Static literal property names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - async *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js deleted file mode 100644 index 228f0842bc..0000000000 --- a/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template -/*--- -description: literal private names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - async *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-computed-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-names.js index 0de78443c7..82031be527 100644 --- a/test/language/expressions/class/fields-same-line-async-method-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js b/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js deleted file mode 100644 index 6ae4cc7ff9..0000000000 --- a/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js +++ /dev/null @@ -1,59 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-method.template -/*--- -description: Static Computed property names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - async m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js deleted file mode 100644 index 1852562e08..0000000000 --- a/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-method.template -/*--- -description: Static computed property symbol names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - async m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js deleted file mode 100644 index 411244ffd3..0000000000 --- a/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js +++ /dev/null @@ -1,76 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-method.template -/*--- -description: Static literal property names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - async m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-names.js b/test/language/expressions/class/fields-same-line-async-method-static-private-names.js deleted file mode 100644 index 688e0d1ff8..0000000000 --- a/test/language/expressions/class/fields-same-line-async-method-static-private-names.js +++ /dev/null @@ -1,69 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-after-same-line-async-method.template -/*--- -description: literal private names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - async m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-computed-names.js b/test/language/expressions/class/fields-same-line-gen-computed-names.js index 3306f8e5c2..3f9e73ae98 100644 --- a/test/language/expressions/class/fields-same-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-same-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } + [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-same-line-gen-static-computed-names.js b/test/language/expressions/class/fields-same-line-gen-static-computed-names.js deleted file mode 100644 index c420802c9a..0000000000 --- a/test/language/expressions/class/fields-same-line-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-same-line-generator.template -/*--- -description: Static Computed property names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 9f8d294a33..0000000000 --- a/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-same-line-generator.template -/*--- -description: Static computed property symbol names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-same-line-gen-static-literal-names.js b/test/language/expressions/class/fields-same-line-gen-static-literal-names.js deleted file mode 100644 index 1d767235b2..0000000000 --- a/test/language/expressions/class/fields-same-line-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-same-line-generator.template -/*--- -description: Static literal property names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-names.js b/test/language/expressions/class/fields-same-line-gen-static-private-names.js deleted file mode 100644 index 6d6b79f910..0000000000 --- a/test/language/expressions/class/fields-same-line-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-same-line-generator.template -/*--- -description: literal private names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y; *m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-method-computed-names.js b/test/language/expressions/class/fields-same-line-method-computed-names.js index f598057726..eb626db479 100644 --- a/test/language/expressions/class/fields-same-line-method-computed-names.js +++ b/test/language/expressions/class/fields-same-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; var C = class { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } + [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-same-line-method-static-computed-names.js b/test/language/expressions/class/fields-same-line-method-static-computed-names.js deleted file mode 100644 index 1cdb285ce9..0000000000 --- a/test/language/expressions/class/fields-same-line-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-same-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - static ["a"] = 42; ["a"] = 39; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js deleted file mode 100644 index b385bd8cc3..0000000000 --- a/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-same-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - static [x]; static [y] = 42; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-same-line-method-static-literal-names.js b/test/language/expressions/class/fields-same-line-method-static-literal-names.js deleted file mode 100644 index 5f89385b7c..0000000000 --- a/test/language/expressions/class/fields-same-line-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-same-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - static a; b = 42; - static c = fn; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-same-line-method-static-private-names.js b/test/language/expressions/class/fields-same-line-method-static-private-names.js deleted file mode 100644 index 1dd63147e5..0000000000 --- a/test/language/expressions/class/fields-same-line-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-same-line-method.template -/*--- -description: literal private names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - static #x; static #y; m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js deleted file mode 100644 index b844f22e12..0000000000 --- a/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template -/*--- -description: Syntax error if `arguments` used in class field (static computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -var C = class { - static [x] = arguments; -} diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js deleted file mode 100644 index d90ee31d66..0000000000 --- a/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js +++ /dev/null @@ -1,28 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template -/*--- -description: Syntax error if `super()` used in class field (static computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -var C = class { - static [x] = super(); -} diff --git a/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js b/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js deleted file mode 100644 index b868295db8..0000000000 --- a/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js +++ /dev/null @@ -1,105 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-name-toprimitive-symbol.case -// - src/class-fields/default/cls-expr.template -/*--- -description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) -esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, Symbol, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - Runtime Semantics: ClassDefinitionEvaluation - - ... - 27. For each ClassElement e in order from elements - a. If IsStatic of me is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. - b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. - c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). - ... - - Runtime Semantics: ClassElementEvaluation - - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - ClassElement: FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - ... - - Runtime Semantics: Evaluation - ComputedPropertyName: [ AssignmentExpression ] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - ----*/ -var s1 = Symbol(); -var s2 = Symbol(); -var s3 = Symbol(); -var err = function() { throw new Test262Error(); }; -var obj1 = { - [Symbol.toPrimitive]: function() { return s1; }, - toString: err, - valueOf: err -}; - -var obj2 = { - toString: function() { return s2; }, - valueOf: err -}; - -var obj3 = { - toString: undefined, - valueOf: function() { return s3; } -}; - - - -var C = class { - static [obj1] = 42; - static [obj2] = 43; - static [obj3] = 44; -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); - -verifyProperty(C, s1, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, s2, { - value: 43, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, s3, { - value: 44, - enumerable: true, - writable: true, - configurable: true -}); - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, s1), false); -assert.sameValue(Object.hasOwnProperty.call(c, s2), false); -assert.sameValue(Object.hasOwnProperty.call(c, s3), false); diff --git a/test/language/expressions/class/fields-static-computed-name-toprimitive.js b/test/language/expressions/class/fields-static-computed-name-toprimitive.js deleted file mode 100644 index 542791039c..0000000000 --- a/test/language/expressions/class/fields-static-computed-name-toprimitive.js +++ /dev/null @@ -1,102 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-name-toprimitive.case -// - src/class-fields/default/cls-expr.template -/*--- -description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) -esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - Runtime Semantics: ClassDefinitionEvaluation - - ... - 27. For each ClassElement e in order from elements - a. If IsStatic of me is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. - b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. - c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). - ... - - Runtime Semantics: ClassElementEvaluation - - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - ClassElement: FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - ... - - Runtime Semantics: Evaluation - ComputedPropertyName: [ AssignmentExpression ] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - ----*/ -var err = function() { throw new Test262Error(); }; -var obj1 = { - [Symbol.toPrimitive]: function() { return "d"; }, - toString: err, - valueOf: err -}; - -var obj2 = { - toString: function() { return "e"; }, - valueOf: err -}; - -var obj3 = { - toString: undefined, - valueOf: function() { return "f"; } -}; - - - -var C = class { - static [obj1] = 42; - static [obj2] = 43; - static [obj3] = 44; -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); - -verifyProperty(C, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, "e", { - value: 43, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, "f", { - value: 44, - enumerable: true, - writable: true, - configurable: true -}); - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "e"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "f"), false); diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js deleted file mode 100644 index f299e42c26..0000000000 --- a/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template -/*--- -description: Syntax error if `arguments` used in class field (static literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static x = arguments; -} diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-super.js b/test/language/expressions/class/fields-static-literal-init-err-contains-super.js deleted file mode 100644 index 97db70a41a..0000000000 --- a/test/language/expressions/class/fields-static-literal-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template -/*--- -description: Syntax error if `super()` used in class field (static literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static x = super(); -} diff --git a/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js deleted file mode 100644 index d98b9b0aaf..0000000000 --- a/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template -/*--- -description: Syntax error if `arguments` used in class field (static PrivateName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public, class-fields-private] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static #x = arguments; -} diff --git a/test/language/expressions/class/fields-static-private-init-err-contains-super.js b/test/language/expressions/class/fields-static-private-init-err-contains-super.js deleted file mode 100644 index 7a3fbfd5e8..0000000000 --- a/test/language/expressions/class/fields-static-private-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template -/*--- -description: Syntax error if `super()` used in class field (static PrivateName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public, class-fields-private] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static #x = super(); -} diff --git a/test/language/expressions/class/fields-static-redeclaration-symbol.js b/test/language/expressions/class/fields-static-redeclaration-symbol.js deleted file mode 100644 index c3aaa7bc30..0000000000 --- a/test/language/expressions/class/fields-static-redeclaration-symbol.js +++ /dev/null @@ -1,50 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-redeclaration-symbol.case -// - src/class-fields/default/cls-expr.template -/*--- -description: Redeclaration of public static fields with the same name (field definitions in a class expression) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js, compareArray.js] -info: | - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 30. Set the value of F's [[Fields]] internal slot to fieldRecords. - ... - 33. Let result be InitializeStaticFields(F). - - InitializeStaticFields(F) - - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - ----*/ -var x = []; -var y = Symbol(); - - -var C = class { - static [y] = (x.push("a"), "old_value"); - static [y] = (x.push("b"), "same_value"); - static [y] = (x.push("c"), "same_value"); -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); - -verifyProperty(C, y, { - value: "same_value", - enumerable: true, - writable: true, - configurable: true -}); - -assert(compareArray(x, ["a", "b", "c"])); - -var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/expressions/class/fields-static-redeclaration.js b/test/language/expressions/class/fields-static-redeclaration.js deleted file mode 100644 index 8d81f7f1dc..0000000000 --- a/test/language/expressions/class/fields-static-redeclaration.js +++ /dev/null @@ -1,50 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-redeclaration.case -// - src/class-fields/default/cls-expr.template -/*--- -description: Redeclaration of public static fields with the same name (field definitions in a class expression) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js, compareArray.js] -info: | - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 30. Set the value of F's [[Fields]] internal slot to fieldRecords. - ... - 33. Let result be InitializeStaticFields(F). - - InitializeStaticFields(F) - - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - ----*/ -var x = []; - - -var C = class { - static y = (x.push("a"), "old_value"); - static ["y"] = (x.push("b"), "another_value"); - static "y" = (x.push("c"), "same_value"); - static y = (x.push("d"), "same_value"); -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); - -verifyProperty(C, "y", { - value: "same_value", - enumerable: true, - writable: true, - configurable: true -}); - -assert(compareArray(x, ["a", "b", "c", "d"])); - -var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -assert(compareArray(x, ["a", "b", "c", "d"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js deleted file mode 100644 index d4d736ef9b..0000000000 --- a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template -/*--- -description: Syntax error if `arguments` used in class field (static string literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static 'x' = arguments; -} diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js deleted file mode 100644 index ed46f9eb9d..0000000000 --- a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template -/*--- -description: Syntax error if `super()` used in class field (static string literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static 'x' = super(); -} diff --git a/test/language/expressions/class/fields-string-name-static-propname-constructor.js b/test/language/expressions/class/fields-string-name-static-propname-constructor.js deleted file mode 100644 index ba3d61da94..0000000000 --- a/test/language/expressions/class/fields-string-name-static-propname-constructor.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-expr-static-string-name.template -/*--- -description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static 'constructor'; -}; diff --git a/test/language/expressions/class/fields-string-name-static-propname-prototype.js b/test/language/expressions/class/fields-string-name-static-propname-prototype.js deleted file mode 100644 index 318366aaec..0000000000 --- a/test/language/expressions/class/fields-string-name-static-propname-prototype.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-expr-static-string-name.template -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static 'prototype'; -}; diff --git a/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js b/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js index 657f2afece..607437f8f7 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js @@ -25,23 +25,13 @@ var x = "b"; var C = class { ;;;; - ;;;;;;static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];;;;;;; + ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;; ;;;; } var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js deleted file mode 100644 index 36c6fa44a3..0000000000 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js +++ /dev/null @@ -1,48 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-expr-wrapped-in-sc.template -/*--- -description: Static Computed property names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -var C = class { - ;;;; - ;;;;;;static ["a"] = 42; ["a"] = 39;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js deleted file mode 100644 index 1f93f5e6de..0000000000 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js +++ /dev/null @@ -1,62 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-expr-wrapped-in-sc.template -/*--- -description: Static computed property symbol names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -var C = class { - ;;;; - ;;;;;;static [x]; static [y] = 42;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js deleted file mode 100644 index c88ad83d6f..0000000000 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-expr-wrapped-in-sc.template -/*--- -description: Static literal property names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -var C = class { - ;;;; - ;;;;;;static a; b = 42; - static c = fn;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js deleted file mode 100644 index 95b1541431..0000000000 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-expr-wrapped-in-sc.template -/*--- -description: literal private names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -var C = class { - ;;;; - ;;;;;;static #x; static #y;;;;;;; - ;;;; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-gen-computed-names.js index 15d1dc9679..e7634a16bf 100644 --- a/test/language/statements/class/fields-after-same-line-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js deleted file mode 100644 index f89aeb9e00..0000000000 --- a/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-gen.template -/*--- -description: Static Computed property names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 5229e5dd46..0000000000 --- a/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-gen.template -/*--- -description: Static computed property symbol names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js deleted file mode 100644 index def6e69bb0..0000000000 --- a/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-gen.template -/*--- -description: Static literal property names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-gen-static-private-names.js deleted file mode 100644 index adce1dd110..0000000000 --- a/test/language/statements/class/fields-after-same-line-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-gen.template -/*--- -description: literal private names (field definitions after a generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-method-computed-names.js b/test/language/statements/class/fields-after-same-line-method-computed-names.js index fba7b3b901..21fb3b86d7 100644 --- a/test/language/statements/class/fields-after-same-line-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-method-static-computed-names.js deleted file mode 100644 index 70ee22cf6d..0000000000 --- a/test/language/statements/class/fields-after-same-line-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-method.template -/*--- -description: Static Computed property names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js deleted file mode 100644 index 81ddcbb97c..0000000000 --- a/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-method.template -/*--- -description: Static computed property symbol names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-after-same-line-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-method-static-literal-names.js deleted file mode 100644 index e332e3db76..0000000000 --- a/test/language/statements/class/fields-after-same-line-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-method.template -/*--- -description: Static literal property names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-method-static-private-names.js deleted file mode 100644 index 5b2048a262..0000000000 --- a/test/language/statements/class/fields-after-same-line-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-method.template -/*--- -description: literal private names (field definitions after a method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js index ddb34df44a..5554b63e9b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js deleted file mode 100644 index 3a138b2cec..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template -/*--- -description: Static Computed property names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static async *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js deleted file mode 100644 index 988264b0e6..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template -/*--- -description: Static computed property symbol names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static async *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js deleted file mode 100644 index 1a8c253ddc..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js +++ /dev/null @@ -1,77 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template -/*--- -description: Static literal property names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static async *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js deleted file mode 100644 index 6e7147238c..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template -/*--- -description: literal private names (field definitions after a static async generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static async *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -C.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js index f8a85cd330..34dfe534b0 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js deleted file mode 100644 index 852e2380f4..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js +++ /dev/null @@ -1,59 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template -/*--- -description: Static Computed property names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static async m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js deleted file mode 100644 index 0f8bad1a23..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template -/*--- -description: Static computed property symbol names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static async m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js deleted file mode 100644 index 60cfd6a14d..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js +++ /dev/null @@ -1,76 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template -/*--- -description: Static literal property names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static async m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js deleted file mode 100644 index 953e9a4569..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js +++ /dev/null @@ -1,69 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template -/*--- -description: literal private names (field definitions after a static async method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static async m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -C.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js index f39b0629a6..49e281bd7e 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js deleted file mode 100644 index 2378057dcc..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template -/*--- -description: Static Computed property names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js deleted file mode 100644 index b61d7eb57a..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template -/*--- -description: Static computed property symbol names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js deleted file mode 100644 index 0d05975b1f..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template -/*--- -description: Static literal property names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js deleted file mode 100644 index 3e1f77fae1..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template -/*--- -description: literal private names (field definitions after a static generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, generators, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-method-computed-names.js b/test/language/statements/class/fields-after-same-line-static-method-computed-names.js index bb655ff2e9..8ee37ce116 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -40,16 +40,6 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js deleted file mode 100644 index c08e3c3b0e..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-method.template -/*--- -description: Static Computed property names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js deleted file mode 100644 index 532958a415..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-method.template -/*--- -description: Static computed property symbol names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js deleted file mode 100644 index b2c7c6a7af..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-method.template -/*--- -description: Static literal property names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js deleted file mode 100644 index 419ec93c8e..0000000000 --- a/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-static-method.template -/*--- -description: literal private names (field definitions after a static method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); - -verifyProperty(C, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js b/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js deleted file mode 100644 index 5f931c9506..0000000000 --- a/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template -/*--- -description: Syntax error if `arguments` used in class field (computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = arguments; -} diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-comp-name-init-err-contains-super.js deleted file mode 100644 index 00f28d5fcc..0000000000 --- a/test/language/statements/class/fields-comp-name-init-err-contains-super.js +++ /dev/null @@ -1,28 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template -/*--- -description: Syntax error if `super()` used in class field (computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = super(); -} diff --git a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js index a38db9e665..5c9639bc9e 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js @@ -24,9 +24,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-computed-name-toprimitive.js b/test/language/statements/class/fields-computed-name-toprimitive.js index 67af44ede2..518f1f164d 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive.js +++ b/test/language/statements/class/fields-computed-name-toprimitive.js @@ -24,9 +24,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js deleted file mode 100644 index fc5515e52a..0000000000 --- a/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-decl-static-variable-name.template -/*--- -description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -var constructor = "foo"; -class C { - static [constructor]; -} - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js deleted file mode 100644 index 400efb97ad..0000000000 --- a/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-decl-static-variable-name.template -/*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -var prototype = "foo"; -class C { - static [prototype]; -} - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js b/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js index 43c01a9af2..505de6f4b9 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js index c839551e89..77579a2f60 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js index 6abf0cbbc2..2edbc79dbe 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js index 663cf91cc5..b056fb488e 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js @@ -23,9 +23,6 @@ info: | Runtime Semantics: ClassElementEvaluation - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - ClassElement: FieldDefinition; Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. diff --git a/test/language/statements/class/fields-init-value-incremental.js b/test/language/statements/class/fields-init-value-incremental.js index 0195d25151..24d5eb3b6f 100644 --- a/test/language/statements/class/fields-init-value-incremental.js +++ b/test/language/statements/class/fields-init-value-incremental.js @@ -28,57 +28,41 @@ info: | ... ---*/ -var x = 0; +var x = 1; class C { - static [x++] = x++; [x++] = x++; - static [x++] = x++; [x++] = x++; } var c1 = new C(); var c2 = new C(); -verifyProperty(C, "0", { +verifyProperty(c1, "1", { + value: 3, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "2", { value: 4, enumerable: true, configurable: true, writable: true, }); -verifyProperty(C, "2", { +verifyProperty(c2, "1", { value: 5, enumerable: true, configurable: true, writable: true, }); -verifyProperty(c1, "1", { +verifyProperty(c2, "2", { value: 6, enumerable: true, configurable: true, writable: true, }); - -verifyProperty(c1, "3", { - value: 7, - enumerable: true, - configurable: true, - writable: true, -}); - -verifyProperty(c2, "1", { - value: 8, - enumerable: true, - configurable: true, - writable: true, -}); - -verifyProperty(c2, "3", { - value: 9, - enumerable: true, - configurable: true, - writable: true, -}); diff --git a/test/language/statements/class/fields-literal-name-static-propname-constructor.js b/test/language/statements/class/fields-literal-name-static-propname-constructor.js deleted file mode 100644 index 2612862987..0000000000 --- a/test/language/statements/class/fields-literal-name-static-propname-constructor.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-decl-static-literal-name.template -/*--- -description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static constructor; -} diff --git a/test/language/statements/class/fields-literal-name-static-propname-prototype.js b/test/language/statements/class/fields-literal-name-static-propname-prototype.js deleted file mode 100644 index 877609beae..0000000000 --- a/test/language/statements/class/fields-literal-name-static-propname-prototype.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-decl-static-literal-name.template -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static prototype; -} diff --git a/test/language/statements/class/fields-multiple-definitions-computed-names.js b/test/language/statements/class/fields-multiple-definitions-computed-names.js index 6d7b1c4989..b6d3cfb14f 100644 --- a/test/language/statements/class/fields-multiple-definitions-computed-names.js +++ b/test/language/statements/class/fields-multiple-definitions-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; class C { foo = "foobar"; m() { return 42 } - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] m2() { return 39 } bar = "barbaz"; @@ -76,16 +76,6 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-multiple-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-names.js deleted file mode 100644 index 593e42cf51..0000000000 --- a/test/language/statements/class/fields-multiple-definitions-static-computed-names.js +++ /dev/null @@ -1,92 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-multiple-definitions.template -/*--- -description: Static Computed property names (multiple fields definitions) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - foo = "foobar"; - m() { return 42 } - static ["a"] = 42; ["a"] = 39 - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js deleted file mode 100644 index d797f2e071..0000000000 --- a/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,106 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-multiple-definitions.template -/*--- -description: Static computed property symbol names (multiple fields definitions) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - foo = "foobar"; - m() { return 42 } - static [x]; static [y] = 42 - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-multiple-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-definitions-static-literal-names.js deleted file mode 100644 index 04c83de2c2..0000000000 --- a/test/language/statements/class/fields-multiple-definitions-static-literal-names.js +++ /dev/null @@ -1,109 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-multiple-definitions.template -/*--- -description: Static literal property names (multiple fields definitions) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - foo = "foobar"; - m() { return 42 } - static a; b = 42; - static c = fn - m2() { return 39 } - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-names.js b/test/language/statements/class/fields-multiple-definitions-static-private-names.js deleted file mode 100644 index f30c49aad7..0000000000 --- a/test/language/statements/class/fields-multiple-definitions-static-private-names.js +++ /dev/null @@ -1,102 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-multiple-definitions.template -/*--- -description: literal private names (multiple fields definitions) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - foo = "foobar"; - m() { return 42 } - static #x; static #y - m2() { return 39 } - bar = "barbaz"; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); -assert.sameValue(c.m2, C.prototype.m2); - -verifyProperty(C.prototype, "m2", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js index 69b0916c96..1bdcb8e773 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] foo = "foobar" bar = "barbaz"; @@ -54,16 +54,6 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js deleted file mode 100644 index a3e0748c5e..0000000000 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template -/*--- -description: Static Computed property names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39 - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js deleted file mode 100644 index 0ebbb9b091..0000000000 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,84 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template -/*--- -description: Static computed property symbol names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42 - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js deleted file mode 100644 index 9040bb149f..0000000000 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js +++ /dev/null @@ -1,87 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template -/*--- -description: Static literal property names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn - foo = "foobar" - bar = "barbaz"; - -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js deleted file mode 100644 index 3857f74bb9..0000000000 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js +++ /dev/null @@ -1,80 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template -/*--- -description: literal private names (multiple stacked fields definitions through ASI) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y - foo = "foobar" - bar = "barbaz"; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); - -verifyProperty(c, "foo", { - value: "foobar", - enumerable: true, - configurable: true, - writable: true, -}); - -assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); - -verifyProperty(c, "bar", { - value: "barbaz", - enumerable: true, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js b/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js index 5d4f003d66..656dad2c1a 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js deleted file mode 100644 index 02514b3deb..0000000000 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39 - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js deleted file mode 100644 index dd8a575a56..0000000000 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42 - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js deleted file mode 100644 index 6ac9918faa..0000000000 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js deleted file mode 100644 index c8b3485650..0000000000 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template -/*--- -description: literal private names (field definitions followed by a method in a new line without a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y - m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-gen-computed-names.js b/test/language/statements/class/fields-new-sc-line-gen-computed-names.js index 4a4acdb9c8..ed18ea80b9 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js deleted file mode 100644 index 2fd70234b0..0000000000 --- a/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-generator.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 8b9ad5ae4a..0000000000 --- a/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-generator.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js deleted file mode 100644 index 07dd8dd5f3..0000000000 --- a/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-generator.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn; - *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js deleted file mode 100644 index 45f9d18409..0000000000 --- a/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-generator.template -/*--- -description: literal private names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y; - *m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-method-computed-names.js b/test/language/statements/class/fields-new-sc-line-method-computed-names.js index 7c2520cb9c..a3055504f0 100644 --- a/test/language/statements/class/fields-new-sc-line-method-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } } @@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js b/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js deleted file mode 100644 index ffedc6cfe8..0000000000 --- a/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js deleted file mode 100644 index 3e917bde62..0000000000 --- a/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,71 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js deleted file mode 100644 index ac54f0d91d..0000000000 --- a/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn; - m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-names.js b/test/language/statements/class/fields-new-sc-line-method-static-private-names.js deleted file mode 100644 index 46079d45cc..0000000000 --- a/test/language/statements/class/fields-new-sc-line-method-static-private-names.js +++ /dev/null @@ -1,67 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-new-sc-line-method.template -/*--- -description: literal private names (field definitions followed by a method in a new line with a semicolon) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y; - m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-regular-definitions-computed-names.js b/test/language/statements/class/fields-regular-definitions-computed-names.js index fcd8f2be2e..7fa89ad913 100644 --- a/test/language/statements/class/fields-regular-definitions-computed-names.js +++ b/test/language/statements/class/fields-regular-definitions-computed-names.js @@ -24,22 +24,12 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + [x] = 42; [10] = "meep"; ["not initialized"] } var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-regular-definitions-static-computed-names.js b/test/language/statements/class/fields-regular-definitions-static-computed-names.js deleted file mode 100644 index 87a80650e2..0000000000 --- a/test/language/statements/class/fields-regular-definitions-static-computed-names.js +++ /dev/null @@ -1,46 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-regular-definitions.template -/*--- -description: Static Computed property names (regular fields defintion) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39 - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js deleted file mode 100644 index c9ab458874..0000000000 --- a/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-regular-definitions.template -/*--- -description: Static computed property symbol names (regular fields defintion) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42 - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-regular-definitions-static-literal-names.js b/test/language/statements/class/fields-regular-definitions-static-literal-names.js deleted file mode 100644 index 74bea2f29c..0000000000 --- a/test/language/statements/class/fields-regular-definitions-static-literal-names.js +++ /dev/null @@ -1,63 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-regular-definitions.template -/*--- -description: Static literal property names (regular fields defintion) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-regular-definitions-static-private-names.js b/test/language/statements/class/fields-regular-definitions-static-private-names.js deleted file mode 100644 index fca552f0ba..0000000000 --- a/test/language/statements/class/fields-regular-definitions-static-private-names.js +++ /dev/null @@ -1,55 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-regular-definitions.template -/*--- -description: literal private names (regular fields defintion) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-names.js index 0d032a776c..7e8cf65202 100644 --- a/test/language/statements/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js b/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js deleted file mode 100644 index 6f18630d2f..0000000000 --- a/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js +++ /dev/null @@ -1,60 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template -/*--- -description: Static Computed property names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - async *m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js deleted file mode 100644 index 54061a7f87..0000000000 --- a/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,74 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template -/*--- -description: Static computed property symbol names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - async *m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js deleted file mode 100644 index 2040027f11..0000000000 --- a/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js +++ /dev/null @@ -1,77 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template -/*--- -description: Static literal property names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - async *m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-names.js b/test/language/statements/class/fields-same-line-async-gen-static-private-names.js deleted file mode 100644 index a29c3e6ed7..0000000000 --- a/test/language/statements/class/fields-same-line-async-gen-static-private-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template -/*--- -description: literal private names (field definitions after an async generator in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-iteration] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - async *m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -c.m().next().then(function(v) { - assert.sameValue(v.value, 42); - assert.sameValue(v.done, true); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-computed-names.js b/test/language/statements/class/fields-same-line-async-method-computed-names.js index 5f51ec0c59..ab68ccb314 100644 --- a/test/language/statements/class/fields-same-line-async-method-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; } @@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-same-line-async-method-static-computed-names.js b/test/language/statements/class/fields-same-line-async-method-static-computed-names.js deleted file mode 100644 index f4e8186062..0000000000 --- a/test/language/statements/class/fields-same-line-async-method-static-computed-names.js +++ /dev/null @@ -1,59 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-method.template -/*--- -description: Static Computed property names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - async m() { return 42; } static ["a"] = 42; ["a"] = 39; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js deleted file mode 100644 index 82aeb6e710..0000000000 --- a/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-method.template -/*--- -description: Static computed property symbol names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - async m() { return 42; } static [x]; static [y] = 42; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-literal-names.js b/test/language/statements/class/fields-same-line-async-method-static-literal-names.js deleted file mode 100644 index 2208c8cfca..0000000000 --- a/test/language/statements/class/fields-same-line-async-method-static-literal-names.js +++ /dev/null @@ -1,76 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-method.template -/*--- -description: Static literal property names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - async m() { return 42; } static a; b = 42; - static c = fn; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-names.js b/test/language/statements/class/fields-same-line-async-method-static-private-names.js deleted file mode 100644 index 4361e51266..0000000000 --- a/test/language/statements/class/fields-same-line-async-method-static-private-names.js +++ /dev/null @@ -1,69 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-after-same-line-async-method.template -/*--- -description: literal private names (field definitions after an async method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, async-functions] -flags: [generated, async] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - async m() { return 42; } static #x; static #y; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}, {restore: true}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - -c.m().then(function(v) { - assert.sameValue(v, 42); -}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-computed-names.js b/test/language/statements/class/fields-same-line-gen-computed-names.js index d46fc2aa29..bfd85d84ad 100644 --- a/test/language/statements/class/fields-same-line-gen-computed-names.js +++ b/test/language/statements/class/fields-same-line-gen-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } + [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-same-line-gen-static-computed-names.js b/test/language/statements/class/fields-same-line-gen-static-computed-names.js deleted file mode 100644 index 1e4b9d9841..0000000000 --- a/test/language/statements/class/fields-same-line-gen-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-same-line-generator.template -/*--- -description: Static Computed property names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js deleted file mode 100644 index 8c2d1b4e2c..0000000000 --- a/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-same-line-generator.template -/*--- -description: Static computed property symbol names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-same-line-gen-static-literal-names.js b/test/language/statements/class/fields-same-line-gen-static-literal-names.js deleted file mode 100644 index fc52157886..0000000000 --- a/test/language/statements/class/fields-same-line-gen-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-same-line-generator.template -/*--- -description: Static literal property names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn; *m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-same-line-gen-static-private-names.js b/test/language/statements/class/fields-same-line-gen-static-private-names.js deleted file mode 100644 index 9ae9e69763..0000000000 --- a/test/language/statements/class/fields-same-line-gen-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-same-line-generator.template -/*--- -description: literal private names (field definitions followed by a generator method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public, generators] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y; *m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m().next().value, 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-method-computed-names.js b/test/language/statements/class/fields-same-line-method-computed-names.js index 7157e46e18..b9b64e5424 100644 --- a/test/language/statements/class/fields-same-line-method-computed-names.js +++ b/test/language/statements/class/fields-same-line-method-computed-names.js @@ -24,7 +24,7 @@ var x = "b"; class C { - static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } + [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } } @@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-same-line-method-static-computed-names.js b/test/language/statements/class/fields-same-line-method-static-computed-names.js deleted file mode 100644 index df4668a4f0..0000000000 --- a/test/language/statements/class/fields-same-line-method-static-computed-names.js +++ /dev/null @@ -1,56 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-same-line-method.template -/*--- -description: Static Computed property names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - static ["a"] = 42; ["a"] = 39; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js deleted file mode 100644 index 0c06e52cd5..0000000000 --- a/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-same-line-method.template -/*--- -description: Static computed property symbol names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - static [x]; static [y] = 42; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-same-line-method-static-literal-names.js b/test/language/statements/class/fields-same-line-method-static-literal-names.js deleted file mode 100644 index 63f6a707aa..0000000000 --- a/test/language/statements/class/fields-same-line-method-static-literal-names.js +++ /dev/null @@ -1,73 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-same-line-method.template -/*--- -description: Static literal property names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - static a; b = 42; - static c = fn; m() { return 42; } - -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-same-line-method-static-private-names.js b/test/language/statements/class/fields-same-line-method-static-private-names.js deleted file mode 100644 index 5e8af08e08..0000000000 --- a/test/language/statements/class/fields-same-line-method-static-private-names.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-same-line-method.template -/*--- -description: literal private names (field definitions followed by a method in the same line) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - static #x; static #y; m() { return 42; } -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -assert.sameValue(c.m(), 42); -assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); - -verifyProperty(C.prototype, "m", { - enumerable: false, - configurable: true, - writable: true, -}); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js deleted file mode 100644 index 888651a8ca..0000000000 --- a/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template -/*--- -description: Syntax error if `arguments` used in class field (static computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = arguments; -} diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js deleted file mode 100644 index f2cbcf1b40..0000000000 --- a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js +++ /dev/null @@ -1,28 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template -/*--- -description: Syntax error if `super()` used in class field (static computed ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = super(); -} diff --git a/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js deleted file mode 100644 index 4dc05f631e..0000000000 --- a/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js +++ /dev/null @@ -1,105 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-name-toprimitive-symbol.case -// - src/class-fields/default/cls-decl.template -/*--- -description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) -esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, Symbol, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - Runtime Semantics: ClassDefinitionEvaluation - - ... - 27. For each ClassElement e in order from elements - a. If IsStatic of me is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. - b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. - c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). - ... - - Runtime Semantics: ClassElementEvaluation - - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - ClassElement: FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - ... - - Runtime Semantics: Evaluation - ComputedPropertyName: [ AssignmentExpression ] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - ----*/ -var s1 = Symbol(); -var s2 = Symbol(); -var s3 = Symbol(); -var err = function() { throw new Test262Error(); }; -var obj1 = { - [Symbol.toPrimitive]: function() { return s1; }, - toString: err, - valueOf: err -}; - -var obj2 = { - toString: function() { return s2; }, - valueOf: err -}; - -var obj3 = { - toString: undefined, - valueOf: function() { return s3; } -}; - - - -class C { - static [obj1] = 42; - static [obj2] = 43; - static [obj3] = 44; -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); - -verifyProperty(C, s1, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, s2, { - value: 43, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, s3, { - value: 44, - enumerable: true, - writable: true, - configurable: true -}); - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, s1), false); -assert.sameValue(Object.hasOwnProperty.call(c, s2), false); -assert.sameValue(Object.hasOwnProperty.call(c, s3), false); diff --git a/test/language/statements/class/fields-static-computed-name-toprimitive.js b/test/language/statements/class/fields-static-computed-name-toprimitive.js deleted file mode 100644 index 9a98f4cf39..0000000000 --- a/test/language/statements/class/fields-static-computed-name-toprimitive.js +++ /dev/null @@ -1,102 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-name-toprimitive.case -// - src/class-fields/default/cls-decl.template -/*--- -description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) -esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - Runtime Semantics: ClassDefinitionEvaluation - - ... - 27. For each ClassElement e in order from elements - a. If IsStatic of me is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. - b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. - c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). - ... - - Runtime Semantics: ClassElementEvaluation - - ClassElement: static FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - ClassElement: FieldDefinition; - Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - ... - - Runtime Semantics: Evaluation - ComputedPropertyName: [ AssignmentExpression ] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - ----*/ -var err = function() { throw new Test262Error(); }; -var obj1 = { - [Symbol.toPrimitive]: function() { return "d"; }, - toString: err, - valueOf: err -}; - -var obj2 = { - toString: function() { return "e"; }, - valueOf: err -}; - -var obj3 = { - toString: undefined, - valueOf: function() { return "f"; } -}; - - - -class C { - static [obj1] = 42; - static [obj2] = 43; - static [obj3] = 44; -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); - -verifyProperty(C, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, "e", { - value: 43, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(C, "f", { - value: 44, - enumerable: true, - writable: true, - configurable: true -}); - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(c, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "e"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "f"), false); diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js b/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js deleted file mode 100644 index 2ab39b2d26..0000000000 --- a/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template -/*--- -description: Syntax error if `arguments` used in class field (static literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static x = arguments; -} diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-super.js b/test/language/statements/class/fields-static-literal-init-err-contains-super.js deleted file mode 100644 index 5cc75cff59..0000000000 --- a/test/language/statements/class/fields-static-literal-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template -/*--- -description: Syntax error if `super()` used in class field (static literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static x = super(); -} diff --git a/test/language/statements/class/fields-static-private-init-err-contains-arguments.js b/test/language/statements/class/fields-static-private-init-err-contains-arguments.js deleted file mode 100644 index ce8be545b4..0000000000 --- a/test/language/statements/class/fields-static-private-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-decl-fields-static-private-name.template -/*--- -description: Syntax error if `arguments` used in class field (static PrivateName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public, class-fields-private] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static #x = arguments; -} diff --git a/test/language/statements/class/fields-static-private-init-err-contains-super.js b/test/language/statements/class/fields-static-private-init-err-contains-super.js deleted file mode 100644 index d2f70f451a..0000000000 --- a/test/language/statements/class/fields-static-private-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-decl-fields-static-private-name.template -/*--- -description: Syntax error if `super()` used in class field (static PrivateName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public, class-fields-private] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static #x = super(); -} diff --git a/test/language/statements/class/fields-static-redeclaration-symbol.js b/test/language/statements/class/fields-static-redeclaration-symbol.js deleted file mode 100644 index 0b0b7eefe7..0000000000 --- a/test/language/statements/class/fields-static-redeclaration-symbol.js +++ /dev/null @@ -1,50 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-redeclaration-symbol.case -// - src/class-fields/default/cls-decl.template -/*--- -description: Redeclaration of public static fields with the same name (field definitions in a class declaration) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js, compareArray.js] -info: | - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 30. Set the value of F's [[Fields]] internal slot to fieldRecords. - ... - 33. Let result be InitializeStaticFields(F). - - InitializeStaticFields(F) - - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - ----*/ -var x = []; -var y = Symbol(); - - -class C { - static [y] = (x.push("a"), "old_value"); - static [y] = (x.push("b"), "same_value"); - static [y] = (x.push("c"), "same_value"); -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); - -verifyProperty(C, y, { - value: "same_value", - enumerable: true, - writable: true, - configurable: true -}); - -assert(compareArray(x, ["a", "b", "c"])); - -var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/statements/class/fields-static-redeclaration.js b/test/language/statements/class/fields-static-redeclaration.js deleted file mode 100644 index 26d592b667..0000000000 --- a/test/language/statements/class/fields-static-redeclaration.js +++ /dev/null @@ -1,50 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-redeclaration.case -// - src/class-fields/default/cls-decl.template -/*--- -description: Redeclaration of public static fields with the same name (field definitions in a class declaration) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js, compareArray.js] -info: | - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 30. Set the value of F's [[Fields]] internal slot to fieldRecords. - ... - 33. Let result be InitializeStaticFields(F). - - InitializeStaticFields(F) - - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - ----*/ -var x = []; - - -class C { - static y = (x.push("a"), "old_value"); - static ["y"] = (x.push("b"), "another_value"); - static "y" = (x.push("c"), "same_value"); - static y = (x.push("d"), "same_value"); -} - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); - -verifyProperty(C, "y", { - value: "same_value", - enumerable: true, - writable: true, - configurable: true -}); - -assert(compareArray(x, ["a", "b", "c", "d"])); - -var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - -assert(compareArray(x, ["a", "b", "c", "d"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js deleted file mode 100644 index 2c3608db16..0000000000 --- a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-arguments.case -// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template -/*--- -description: Syntax error if `arguments` used in class field (static string literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static 'x' = arguments; -} diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js deleted file mode 100644 index 66b7e57e2c..0000000000 --- a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js +++ /dev/null @@ -1,27 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/init-err-contains-super.case -// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template -/*--- -description: Syntax error if `super()` used in class field (static string literal ClassElementName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static 'x' = super(); -} diff --git a/test/language/statements/class/fields-string-name-static-propname-constructor.js b/test/language/statements/class/fields-string-name-static-propname-constructor.js deleted file mode 100644 index 3ce29b2087..0000000000 --- a/test/language/statements/class/fields-string-name-static-propname-constructor.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error-static/cls-decl-static-string-name.template -/*--- -description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static 'constructor'; -} diff --git a/test/language/statements/class/fields-string-name-static-propname-prototype.js b/test/language/statements/class/fields-string-name-static-propname-prototype.js deleted file mode 100644 index 69ea7375e3..0000000000 --- a/test/language/statements/class/fields-string-name-static-propname-prototype.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error-static/cls-decl-static-string-name.template -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -negative: - phase: early - type: SyntaxError -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - static 'prototype'; -} diff --git a/test/language/statements/class/fields-wrapped-in-sc-computed-names.js b/test/language/statements/class/fields-wrapped-in-sc-computed-names.js index 5569e5e4fb..69b5bce833 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-computed-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-computed-names.js @@ -25,23 +25,13 @@ var x = "b"; class C { ;;;; - ;;;;;;static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];;;;;;; + ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;; ;;;; } var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js deleted file mode 100644 index e0b48ea721..0000000000 --- a/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js +++ /dev/null @@ -1,48 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-names.case -// - src/class-fields/productions/cls-decl-wrapped-in-sc.template -/*--- -description: Static Computed property names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ - - -class C { - ;;;; - ;;;;;;static ["a"] = 42; ["a"] = 39;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js deleted file mode 100644 index 6ad4e21619..0000000000 --- a/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js +++ /dev/null @@ -1,62 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/productions/cls-decl-wrapped-in-sc.template -/*--- -description: Static computed property symbol names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [Symbol, computed-property-names, class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -var x = Symbol(); -var y = Symbol(); - - - -class C { - ;;;; - ;;;;;;static [x]; static [y] = 42;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js deleted file mode 100644 index 4ceef4485c..0000000000 --- a/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-literal-names.case -// - src/class-fields/productions/cls-decl-wrapped-in-sc.template -/*--- -description: Static literal property names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [class, class-fields-public] -flags: [generated] -includes: [propertyHelper.js] -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName - ----*/ -const fn = function() {} - - - -class C { - ;;;; - ;;;;;;static a; b = 42; - static c = fn;;;;;;; - ;;;; - -} - -var c = new C(); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js deleted file mode 100644 index 2238a0c10c..0000000000 --- a/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js +++ /dev/null @@ -1,57 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/productions/cls-decl-wrapped-in-sc.template -/*--- -description: literal private names (fields definition wrapped in semicolons) -esid: prod-FieldDefinition -features: [class-fields-private, class, class-fields-public] -flags: [generated] -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName - ----*/ - - -class C { - ;;;; - ;;;;;;static #x; static #y;;;;;;; - ;;;; -static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -} - -var c = new C(); - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");