From a7ccd3042bb7f489b861a96f9397fdfd90fef3a3 Mon Sep 17 00:00:00 2001 From: Leo Balter <leonardo.balter@gmail.com> Date: Mon, 21 Aug 2017 16:59:36 -0400 Subject: [PATCH] Generate tests --- ...elds-after-same-line-gen-computed-names.js | 83 ++++++++++++ ...ter-same-line-gen-computed-symbol-names.js | 68 ++++++++++ ...ields-after-same-line-gen-literal-names.js | 71 +++++++++++ ...ter-same-line-gen-static-computed-names.js | 54 ++++++++ ...e-line-gen-static-computed-symbol-names.js | 68 ++++++++++ ...fter-same-line-gen-static-literal-names.js | 71 +++++++++++ ...fter-same-line-gen-string-literal-names.js | 48 +++++++ ...s-after-same-line-method-computed-names.js | 83 ++++++++++++ ...-same-line-method-computed-symbol-names.js | 68 ++++++++++ ...ds-after-same-line-method-literal-names.js | 71 +++++++++++ ...-same-line-method-static-computed-names.js | 54 ++++++++ ...ine-method-static-computed-symbol-names.js | 68 ++++++++++ ...r-same-line-method-static-literal-names.js | 71 +++++++++++ ...r-same-line-method-string-literal-names.js | 48 +++++++ ...me-line-static-async-gen-computed-names.js | 86 +++++++++++++ ...-static-async-gen-computed-symbol-names.js | 71 +++++++++++ ...ame-line-static-async-gen-literal-names.js | 74 +++++++++++ ...-static-async-gen-static-computed-names.js | 57 +++++++++ ...-async-gen-static-computed-symbol-names.js | 71 +++++++++++ ...e-static-async-gen-static-literal-names.js | 74 +++++++++++ ...e-static-async-gen-string-literal-names.js | 51 ++++++++ ...line-static-async-method-computed-names.js | 86 +++++++++++++ ...atic-async-method-computed-symbol-names.js | 71 +++++++++++ ...-line-static-async-method-literal-names.js | 74 +++++++++++ ...atic-async-method-static-computed-names.js | 57 +++++++++ ...ync-method-static-computed-symbol-names.js | 71 +++++++++++ ...tatic-async-method-static-literal-names.js | 74 +++++++++++ ...tatic-async-method-string-literal-names.js | 51 ++++++++ ...ter-same-line-static-gen-computed-names.js | 83 ++++++++++++ ...e-line-static-gen-computed-symbol-names.js | 68 ++++++++++ ...fter-same-line-static-gen-literal-names.js | 71 +++++++++++ ...e-line-static-gen-static-computed-names.js | 54 ++++++++ ...static-gen-static-computed-symbol-names.js | 68 ++++++++++ ...me-line-static-gen-static-literal-names.js | 71 +++++++++++ ...me-line-static-gen-string-literal-names.js | 48 +++++++ ...-same-line-static-method-computed-names.js | 83 ++++++++++++ ...ine-static-method-computed-symbol-names.js | 68 ++++++++++ ...r-same-line-static-method-literal-names.js | 71 +++++++++++ ...ine-static-method-static-computed-names.js | 54 ++++++++ ...tic-method-static-computed-symbol-names.js | 68 ++++++++++ ...line-static-method-static-literal-names.js | 71 +++++++++++ ...line-static-method-string-literal-names.js | 48 +++++++ ...lds-multiple-definitions-computed-names.js | 119 ++++++++++++++++++ ...tiple-definitions-computed-symbol-names.js | 104 +++++++++++++++ ...elds-multiple-definitions-literal-names.js | 107 ++++++++++++++++ ...tiple-definitions-static-computed-names.js | 90 +++++++++++++ ...efinitions-static-computed-symbol-names.js | 104 +++++++++++++++ ...ltiple-definitions-static-literal-names.js | 107 ++++++++++++++++ ...ltiple-definitions-string-literal-names.js | 84 +++++++++++++ ...iple-stacked-definitions-computed-names.js | 101 +++++++++++++++ ...acked-definitions-computed-symbol-names.js | 86 +++++++++++++ ...tiple-stacked-definitions-literal-names.js | 89 +++++++++++++ ...acked-definitions-static-computed-names.js | 72 +++++++++++ ...efinitions-static-computed-symbol-names.js | 86 +++++++++++++ ...tacked-definitions-static-literal-names.js | 89 +++++++++++++ ...tacked-definitions-string-literal-names.js | 66 ++++++++++ ...ds-new-no-sc-line-method-computed-names.js | 84 +++++++++++++ ...no-sc-line-method-computed-symbol-names.js | 69 ++++++++++ ...lds-new-no-sc-line-method-literal-names.js | 72 +++++++++++ ...no-sc-line-method-static-computed-names.js | 55 ++++++++ ...ine-method-static-computed-symbol-names.js | 69 ++++++++++ ...-no-sc-line-method-static-literal-names.js | 72 +++++++++++ ...-no-sc-line-method-string-literal-names.js | 49 ++++++++ .../fields-new-sc-line-gen-computed-names.js | 84 +++++++++++++ ...s-new-sc-line-gen-computed-symbol-names.js | 69 ++++++++++ .../fields-new-sc-line-gen-literal-names.js | 72 +++++++++++ ...s-new-sc-line-gen-static-computed-names.js | 55 ++++++++ ...c-line-gen-static-computed-symbol-names.js | 69 ++++++++++ ...ds-new-sc-line-gen-static-literal-names.js | 72 +++++++++++ ...ds-new-sc-line-gen-string-literal-names.js | 49 ++++++++ ...ields-new-sc-line-method-computed-names.js | 84 +++++++++++++ ...ew-sc-line-method-computed-symbol-names.js | 69 ++++++++++ ...fields-new-sc-line-method-literal-names.js | 72 +++++++++++ ...ew-sc-line-method-static-computed-names.js | 55 ++++++++ ...ine-method-static-computed-symbol-names.js | 69 ++++++++++ ...new-sc-line-method-static-literal-names.js | 72 +++++++++++ ...new-sc-line-method-string-literal-names.js | 49 ++++++++ ...elds-regular-definitions-computed-names.js | 73 +++++++++++ ...gular-definitions-computed-symbol-names.js | 58 +++++++++ ...ields-regular-definitions-literal-names.js | 61 +++++++++ ...gular-definitions-static-computed-names.js | 44 +++++++ ...efinitions-static-computed-symbol-names.js | 58 +++++++++ ...egular-definitions-static-literal-names.js | 61 +++++++++ ...egular-definitions-string-literal-names.js | 38 ++++++ ...elds-same-line-async-gen-computed-names.js | 86 +++++++++++++ ...me-line-async-gen-computed-symbol-names.js | 71 +++++++++++ ...ields-same-line-async-gen-literal-names.js | 74 +++++++++++ ...me-line-async-gen-static-computed-names.js | 57 +++++++++ ...-async-gen-static-computed-symbol-names.js | 71 +++++++++++ ...ame-line-async-gen-static-literal-names.js | 74 +++++++++++ ...ame-line-async-gen-string-literal-names.js | 51 ++++++++ ...s-same-line-async-method-computed-names.js | 86 +++++++++++++ ...line-async-method-computed-symbol-names.js | 71 +++++++++++ ...ds-same-line-async-method-literal-names.js | 74 +++++++++++ ...line-async-method-static-computed-names.js | 57 +++++++++ ...ync-method-static-computed-symbol-names.js | 71 +++++++++++ ...-line-async-method-static-literal-names.js | 74 +++++++++++ ...-line-async-method-string-literal-names.js | 51 ++++++++ .../fields-same-line-gen-computed-names.js | 83 ++++++++++++ ...lds-same-line-gen-computed-symbol-names.js | 68 ++++++++++ .../fields-same-line-gen-literal-names.js | 71 +++++++++++ ...lds-same-line-gen-static-computed-names.js | 54 ++++++++ ...e-line-gen-static-computed-symbol-names.js | 68 ++++++++++ ...elds-same-line-gen-static-literal-names.js | 71 +++++++++++ ...elds-same-line-gen-string-literal-names.js | 48 +++++++ .../fields-same-line-method-computed-names.js | 83 ++++++++++++ ...-same-line-method-computed-symbol-names.js | 68 ++++++++++ .../fields-same-line-method-literal-names.js | 71 +++++++++++ ...-same-line-method-static-computed-names.js | 54 ++++++++ ...ine-method-static-computed-symbol-names.js | 68 ++++++++++ ...s-same-line-method-static-literal-names.js | 71 +++++++++++ ...s-same-line-method-string-literal-names.js | 48 +++++++ .../fields-wrapped-in-sc-computed-names.js | 75 +++++++++++ ...lds-wrapped-in-sc-computed-symbol-names.js | 60 +++++++++ .../fields-wrapped-in-sc-literal-names.js | 63 ++++++++++ ...lds-wrapped-in-sc-static-computed-names.js | 46 +++++++ ...pped-in-sc-static-computed-symbol-names.js | 60 +++++++++ ...elds-wrapped-in-sc-static-literal-names.js | 63 ++++++++++ ...elds-wrapped-in-sc-string-literal-names.js | 40 ++++++ ...elds-after-same-line-gen-computed-names.js | 83 ++++++++++++ ...ter-same-line-gen-computed-symbol-names.js | 68 ++++++++++ ...ields-after-same-line-gen-literal-names.js | 71 +++++++++++ ...ter-same-line-gen-static-computed-names.js | 54 ++++++++ ...e-line-gen-static-computed-symbol-names.js | 68 ++++++++++ ...fter-same-line-gen-static-literal-names.js | 71 +++++++++++ ...fter-same-line-gen-string-literal-names.js | 48 +++++++ ...s-after-same-line-method-computed-names.js | 83 ++++++++++++ ...-same-line-method-computed-symbol-names.js | 68 ++++++++++ ...ds-after-same-line-method-literal-names.js | 71 +++++++++++ ...-same-line-method-static-computed-names.js | 54 ++++++++ ...ine-method-static-computed-symbol-names.js | 68 ++++++++++ ...r-same-line-method-static-literal-names.js | 71 +++++++++++ ...r-same-line-method-string-literal-names.js | 48 +++++++ ...me-line-static-async-gen-computed-names.js | 86 +++++++++++++ ...-static-async-gen-computed-symbol-names.js | 71 +++++++++++ ...ame-line-static-async-gen-literal-names.js | 74 +++++++++++ ...-static-async-gen-static-computed-names.js | 57 +++++++++ ...-async-gen-static-computed-symbol-names.js | 71 +++++++++++ ...e-static-async-gen-static-literal-names.js | 74 +++++++++++ ...e-static-async-gen-string-literal-names.js | 51 ++++++++ ...line-static-async-method-computed-names.js | 86 +++++++++++++ ...atic-async-method-computed-symbol-names.js | 71 +++++++++++ ...-line-static-async-method-literal-names.js | 74 +++++++++++ ...atic-async-method-static-computed-names.js | 57 +++++++++ ...ync-method-static-computed-symbol-names.js | 71 +++++++++++ ...tatic-async-method-static-literal-names.js | 74 +++++++++++ ...tatic-async-method-string-literal-names.js | 51 ++++++++ ...ter-same-line-static-gen-computed-names.js | 83 ++++++++++++ ...e-line-static-gen-computed-symbol-names.js | 68 ++++++++++ ...fter-same-line-static-gen-literal-names.js | 71 +++++++++++ ...e-line-static-gen-static-computed-names.js | 54 ++++++++ ...static-gen-static-computed-symbol-names.js | 68 ++++++++++ ...me-line-static-gen-static-literal-names.js | 71 +++++++++++ ...me-line-static-gen-string-literal-names.js | 48 +++++++ ...-same-line-static-method-computed-names.js | 83 ++++++++++++ ...ine-static-method-computed-symbol-names.js | 68 ++++++++++ ...r-same-line-static-method-literal-names.js | 71 +++++++++++ ...ine-static-method-static-computed-names.js | 54 ++++++++ ...tic-method-static-computed-symbol-names.js | 68 ++++++++++ ...line-static-method-static-literal-names.js | 71 +++++++++++ ...line-static-method-string-literal-names.js | 48 +++++++ ...lds-multiple-definitions-computed-names.js | 119 ++++++++++++++++++ ...tiple-definitions-computed-symbol-names.js | 104 +++++++++++++++ ...elds-multiple-definitions-literal-names.js | 107 ++++++++++++++++ ...tiple-definitions-static-computed-names.js | 90 +++++++++++++ ...efinitions-static-computed-symbol-names.js | 104 +++++++++++++++ ...ltiple-definitions-static-literal-names.js | 107 ++++++++++++++++ ...ltiple-definitions-string-literal-names.js | 84 +++++++++++++ ...iple-stacked-definitions-computed-names.js | 101 +++++++++++++++ ...acked-definitions-computed-symbol-names.js | 86 +++++++++++++ ...tiple-stacked-definitions-literal-names.js | 89 +++++++++++++ ...acked-definitions-static-computed-names.js | 72 +++++++++++ ...efinitions-static-computed-symbol-names.js | 86 +++++++++++++ ...tacked-definitions-static-literal-names.js | 89 +++++++++++++ ...tacked-definitions-string-literal-names.js | 66 ++++++++++ ...ds-new-no-sc-line-method-computed-names.js | 84 +++++++++++++ ...no-sc-line-method-computed-symbol-names.js | 69 ++++++++++ ...lds-new-no-sc-line-method-literal-names.js | 72 +++++++++++ ...no-sc-line-method-static-computed-names.js | 55 ++++++++ ...ine-method-static-computed-symbol-names.js | 69 ++++++++++ ...-no-sc-line-method-static-literal-names.js | 72 +++++++++++ ...-no-sc-line-method-string-literal-names.js | 49 ++++++++ .../fields-new-sc-line-gen-computed-names.js | 84 +++++++++++++ ...s-new-sc-line-gen-computed-symbol-names.js | 69 ++++++++++ .../fields-new-sc-line-gen-literal-names.js | 72 +++++++++++ ...s-new-sc-line-gen-static-computed-names.js | 55 ++++++++ ...c-line-gen-static-computed-symbol-names.js | 69 ++++++++++ ...ds-new-sc-line-gen-static-literal-names.js | 72 +++++++++++ ...ds-new-sc-line-gen-string-literal-names.js | 49 ++++++++ ...ields-new-sc-line-method-computed-names.js | 84 +++++++++++++ ...ew-sc-line-method-computed-symbol-names.js | 69 ++++++++++ ...fields-new-sc-line-method-literal-names.js | 72 +++++++++++ ...ew-sc-line-method-static-computed-names.js | 55 ++++++++ ...ine-method-static-computed-symbol-names.js | 69 ++++++++++ ...new-sc-line-method-static-literal-names.js | 72 +++++++++++ ...new-sc-line-method-string-literal-names.js | 49 ++++++++ ...elds-regular-definitions-computed-names.js | 73 +++++++++++ ...gular-definitions-computed-symbol-names.js | 58 +++++++++ ...ields-regular-definitions-literal-names.js | 61 +++++++++ ...gular-definitions-static-computed-names.js | 44 +++++++ ...efinitions-static-computed-symbol-names.js | 58 +++++++++ ...egular-definitions-static-literal-names.js | 61 +++++++++ ...egular-definitions-string-literal-names.js | 38 ++++++ ...elds-same-line-async-gen-computed-names.js | 86 +++++++++++++ ...me-line-async-gen-computed-symbol-names.js | 71 +++++++++++ ...ields-same-line-async-gen-literal-names.js | 74 +++++++++++ ...me-line-async-gen-static-computed-names.js | 57 +++++++++ ...-async-gen-static-computed-symbol-names.js | 71 +++++++++++ ...ame-line-async-gen-static-literal-names.js | 74 +++++++++++ ...ame-line-async-gen-string-literal-names.js | 51 ++++++++ ...s-same-line-async-method-computed-names.js | 86 +++++++++++++ ...line-async-method-computed-symbol-names.js | 71 +++++++++++ ...ds-same-line-async-method-literal-names.js | 74 +++++++++++ ...line-async-method-static-computed-names.js | 57 +++++++++ ...ync-method-static-computed-symbol-names.js | 71 +++++++++++ ...-line-async-method-static-literal-names.js | 74 +++++++++++ ...-line-async-method-string-literal-names.js | 51 ++++++++ .../fields-same-line-gen-computed-names.js | 83 ++++++++++++ ...lds-same-line-gen-computed-symbol-names.js | 68 ++++++++++ .../fields-same-line-gen-literal-names.js | 71 +++++++++++ ...lds-same-line-gen-static-computed-names.js | 54 ++++++++ ...e-line-gen-static-computed-symbol-names.js | 68 ++++++++++ ...elds-same-line-gen-static-literal-names.js | 71 +++++++++++ ...elds-same-line-gen-string-literal-names.js | 48 +++++++ .../fields-same-line-method-computed-names.js | 83 ++++++++++++ ...-same-line-method-computed-symbol-names.js | 68 ++++++++++ .../fields-same-line-method-literal-names.js | 71 +++++++++++ ...-same-line-method-static-computed-names.js | 54 ++++++++ ...ine-method-static-computed-symbol-names.js | 68 ++++++++++ ...s-same-line-method-static-literal-names.js | 71 +++++++++++ ...s-same-line-method-string-literal-names.js | 48 +++++++ .../fields-wrapped-in-sc-computed-names.js | 75 +++++++++++ ...lds-wrapped-in-sc-computed-symbol-names.js | 60 +++++++++ .../fields-wrapped-in-sc-literal-names.js | 63 ++++++++++ ...lds-wrapped-in-sc-static-computed-names.js | 46 +++++++ ...pped-in-sc-static-computed-symbol-names.js | 60 +++++++++ ...elds-wrapped-in-sc-static-literal-names.js | 63 ++++++++++ ...elds-wrapped-in-sc-string-literal-names.js | 40 ++++++ 238 files changed, 16456 insertions(+) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-computed-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-computed-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-string-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-computed-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-computed-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-literal-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-static-computed-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-static-literal-names.js create mode 100644 test/language/expressions/class/fields-regular-definitions-string-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-gen-string-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-computed-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-literal-names.js create mode 100644 test/language/expressions/class/fields-same-line-method-string-literal-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-computed-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-literal-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-computed-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-computed-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-definitions-string-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-computed-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-literal-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-computed-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-computed-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-computed-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-literal-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-static-computed-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-static-literal-names.js create mode 100644 test/language/statements/class/fields-regular-definitions-string-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-async-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-gen-string-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-method-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-method-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-method-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-method-static-computed-names.js create mode 100644 test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-same-line-method-static-literal-names.js create mode 100644 test/language/statements/class/fields-same-line-method-string-literal-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-computed-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-literal-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-string-literal-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 new file mode 100644 index 0000000000..491a1ce0b5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Computed property names (field definitions after a generator in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..0c499e62f0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Computed property symbol names (field definitions after a generator in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.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-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-literal-names.js new file mode 100644 index 0000000000..aa218f25cd --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Literal property names (field definitions after a generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + *m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.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-computed-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js new file mode 100644 index 0000000000..8d0b9c1f07 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Static Computed property names (field definitions after a generator in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..155dc4e405 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Static computed property symbol names (field definitions after a generator in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.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 new file mode 100644 index 0000000000..d2ec567a15 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: Static literal property names (field definitions after a generator in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js new file mode 100644 index 0000000000..9f5829ef85 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-gen.template +/*--- +description: String literal names (field definitions after a generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..66f1d7123d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Computed property names (field definitions after a method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..0a4e57f10b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Computed property symbol names (field definitions after a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-literal-names.js new file mode 100644 index 0000000000..009163696f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Literal property names (field definitions after a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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-computed-names.js b/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js new file mode 100644 index 0000000000..4865b6fe79 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Static Computed property names (field definitions after a method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..8839e0ce1e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Static computed property symbol names (field definitions after a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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 new file mode 100644 index 0000000000..42b9016dd1 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: Static literal property names (field definitions after a method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js new file mode 100644 index 0000000000..c14fcca44a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-method.template +/*--- +description: String literal names (field definitions after a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..679fb40c39 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Computed property names (field definitions after a static async generator in the same line) +features: [computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +C.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js new file mode 100644 index 0000000000..e7af43a6c7 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Computed property symbol names (field definitions after a static async generator in the same line) +features: [Symbol, computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static async *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +C.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js new file mode 100644 index 0000000000..16404bf454 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Literal property names (field definitions after a static async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + static async *m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.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 +}); + + +C.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); 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 new file mode 100644 index 0000000000..8f3b539261 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..3181605459 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static async *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +C.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $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 new file mode 100644 index 0000000000..de54ebf122 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js new file mode 100644 index 0000000000..02dabe035f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +/*--- +description: String literal names (field definitions after a static async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); + +C.m().next().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-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js new file mode 100644 index 0000000000..8f44260cff --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +/*--- +description: Computed property names (field definitions after a static async method in the same line) +features: [computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + 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-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js new file mode 100644 index 0000000000..1375c6ab9c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +/*--- +description: Computed property symbol names (field definitions after a static async method in the same line) +features: [Symbol, computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static async m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +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-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js new file mode 100644 index 0000000000..7dc6938cef --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +/*--- +description: Literal property names (field definitions after a static async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + static async m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.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 +}); + + +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-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js new file mode 100644 index 0000000000..0237b05a47 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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, +}); + +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 new file mode 100644 index 0000000000..836856c7e9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static async m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +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 new file mode 100644 index 0000000000..7c87e5a94d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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, +}); + +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-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js new file mode 100644 index 0000000000..ca6964e737 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +/*--- +description: String literal names (field definitions after a static async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.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: 42, + 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-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js new file mode 100644 index 0000000000..1debe00c79 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Computed property names (field definitions after a static generator in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js new file mode 100644 index 0000000000..5154f6eaaa --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Computed property symbol names (field definitions after a static generator in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.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-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js new file mode 100644 index 0000000000..ff4fc34093 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Literal property names (field definitions after a static generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + static *m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.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-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js new file mode 100644 index 0000000000..2244f51adf --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Static Computed property names (field definitions after a static generator in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..aed7ddbe08 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Static computed property symbol names (field definitions after a static generator in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.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 new file mode 100644 index 0000000000..7af011fd69 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: Static literal property names (field definitions after a static generator in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js new file mode 100644 index 0000000000..c5bf79226d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +/*--- +description: String literal names (field definitions after a static generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..d081cad3de --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Computed property names (field definitions after a static method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js new file mode 100644 index 0000000000..246b66937a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Computed property symbol names (field definitions after a static method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.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-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js new file mode 100644 index 0000000000..377f87bd40 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Literal property names (field definitions after a static method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + static m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.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-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js new file mode 100644 index 0000000000..ab26d3ec91 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Static Computed property names (field definitions after a static method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..a90ed6a0d9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Static computed property symbol names (field definitions after a static method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + static m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.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 new file mode 100644 index 0000000000..ba6f33f52f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: Static literal property names (field definitions after a static method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js new file mode 100644 index 0000000000..63258c1da6 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-static-method.template +/*--- +description: String literal names (field definitions after a static method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-definitions-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-computed-names.js new file mode 100644 index 0000000000..6f7b60ac1d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-computed-names.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Computed property names (multiple fields definitions) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + foo = "foobar"; + m() { return 42 } + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + 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: false, + 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: 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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..db85c6797f --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Computed property symbol names (multiple fields definitions) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + foo = "foobar"; + m() { return 42 } + [x]; [y] = 42 + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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-multiple-definitions-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-literal-names.js new file mode 100644 index 0000000000..0cafb26555 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-literal-names.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Literal property names (multiple fields definitions) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + foo = "foobar"; + m() { return 42 } + a; b = 42; + c = fn + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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-multiple-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js new file mode 100644 index 0000000000..fd2b7dab5f --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Static Computed property names (multiple fields definitions) +features: [computed-property-names, class-fields] +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: false, + 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: 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-multiple-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js new file mode 100644 index 0000000000..4f4e35252b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Static computed property symbol names (multiple fields definitions) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + foo = "foobar"; + m() { return 42 } + [x]; [y] = 42 + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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-multiple-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js new file mode 100644 index 0000000000..2cdcf79833 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: Static literal property names (multiple fields definitions) +features: [class-fields] +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: false, + 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: 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-multiple-definitions-string-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js new file mode 100644 index 0000000000..3f903444cb --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-multiple-definitions.template +/*--- +description: String literal names (multiple fields definitions) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + 'a'; "b"; 'c' = 39; + "d" = 42 + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..6ab20d6d42 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Computed property names (multiple stacked fields definitions through ASI) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + foo = "foobar" + 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); + +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: false, + 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: 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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..5af36a0ba0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Computed property symbol names (multiple stacked fields definitions through ASI) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 + foo = "foobar" + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js new file mode 100644 index 0000000000..477c8b1a66 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Literal property names (multiple stacked fields definitions through ASI) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn + foo = "foobar" + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js new file mode 100644 index 0000000000..d20ec86df5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Static Computed property names (multiple stacked fields definitions through ASI) +features: [computed-property-names, class-fields] +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.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js new file mode 100644 index 0000000000..499133499d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Static computed property symbol names (multiple stacked fields definitions through ASI) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 + foo = "foobar" + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js new file mode 100644 index 0000000000..f98eac3252 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: Static literal property names (multiple stacked fields definitions through ASI) +features: [class-fields] +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.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-string-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js new file mode 100644 index 0000000000..019ed44b80 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +/*--- +description: String literal names (multiple stacked fields definitions through ASI) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42 + foo = "foobar" + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..5b0cd0d30e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in a new line without a semicolon) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..696ff2ee7a --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line without a semicolon) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js new file mode 100644 index 0000000000..2ab87c8352 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in a new line without a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js new file mode 100644 index 0000000000..567ab498cd --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..48c591186d --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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 new file mode 100644 index 0000000000..2d36d9e12a --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js new file mode 100644 index 0000000000..e2edc73dee --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +/*--- +description: String literal names (field definitions followed by a method in a new line without a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42 + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..e75fbbe109 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-new-sc-line-generator.template +/*--- +description: Computed property names (field definitions followed by a method in a new line with a semicolon) +features: [computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..6c0aabf44d --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-new-sc-line-generator.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js new file mode 100644 index 0000000000..4a5db1fd98 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-new-sc-line-generator.template +/*--- +description: Literal property names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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-computed-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js new file mode 100644 index 0000000000..5f63c71e5d --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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.g().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 new file mode 100644 index 0000000000..1ea62fd0b3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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 new file mode 100644 index 0000000000..47c8b76ba1 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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.g().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-string-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js new file mode 100644 index 0000000000..f3bc08f790 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-new-sc-line-generator.template +/*--- +description: String literal names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..8ce4baee4c --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-new-sc-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in a new line with a semicolon) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..365b13fa32 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-new-sc-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-literal-names.js new file mode 100644 index 0000000000..b1f5a672fb --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-new-sc-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js new file mode 100644 index 0000000000..4a0808517a --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..30192a74b7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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 new file mode 100644 index 0000000000..8ca0cf3dc3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js new file mode 100644 index 0000000000..93d601b363 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-new-sc-line-method.template +/*--- +description: String literal names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-regular-definitions-computed-names.js b/test/language/expressions/class/fields-regular-definitions-computed-names.js new file mode 100644 index 0000000000..82d7b4d4c2 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-computed-names.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Computed property names (regular fields defintion) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..7a2c8472ec --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Computed property symbol names (regular fields defintion) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 +} + +var c = new C(); + +assert.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-literal-names.js b/test/language/expressions/class/fields-regular-definitions-literal-names.js new file mode 100644 index 0000000000..b602dd3089 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-literal-names.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Literal property names (regular fields defintion) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn +} + +var c = new C(); + +assert.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-computed-names.js b/test/language/expressions/class/fields-regular-definitions-static-computed-names.js new file mode 100644 index 0000000000..bdc8894793 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-static-computed-names.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Static Computed property names (regular fields defintion) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..8b6827fb50 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Static computed property symbol names (regular fields defintion) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42 +} + +var c = new C(); + +assert.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 new file mode 100644 index 0000000000..f3e61ced50 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-static-literal-names.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: Static literal property names (regular fields defintion) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-regular-definitions-string-literal-names.js new file mode 100644 index 0000000000..d893745481 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-string-literal-names.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-regular-definitions.template +/*--- +description: String literal names (regular fields defintion) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42 +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..b4d5d959d9 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Computed property names (field definitions after an async generator in the same line) +features: [computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js new file mode 100644 index 0000000000..ba9f077539 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Computed property symbol names (field definitions after an async generator in the same line) +features: [Symbol, computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + async *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js new file mode 100644 index 0000000000..9ca9bb0ee6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Literal property names (field definitions after an async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + async *m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.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 +}); + + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); 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 new file mode 100644 index 0000000000..1564125bcd --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Static Computed property names (field definitions after an async generator in the same line) +features: [computed-property-names, class-fields, 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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..12e68a5022 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Static computed property symbol names (field definitions after an async generator in the same line) +features: [Symbol, computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + async *m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $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 new file mode 100644 index 0000000000..e1232602c3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: Static literal property names (field definitions after an async generator in the same line) +features: [class-fields, 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js new file mode 100644 index 0000000000..1080c94d07 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +/*--- +description: String literal names (field definitions after an async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $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 new file mode 100644 index 0000000000..7f985aa810 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Computed property names (field definitions after an async method in the same line) +features: [computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + 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-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js new file mode 100644 index 0000000000..42033f8318 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Computed property symbol names (field definitions after an async method in the same line) +features: [Symbol, computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + async m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +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-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-literal-names.js new file mode 100644 index 0000000000..4303772cbe --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Literal property names (field definitions after an async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + async m() { return 42; } a; b = 42; + c = fn; +} + +var c = new C(); + +assert.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 +}); + + +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-names.js b/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js new file mode 100644 index 0000000000..578ee5b307 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Static Computed property names (field definitions after an async method in the same line) +features: [computed-property-names, class-fields, 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, +}); + +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 new file mode 100644 index 0000000000..12abddd461 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Static computed property symbol names (field definitions after an async method in the same line) +features: [Symbol, computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + async m() { return 42; } [x]; [y] = 42; +} + +var c = new C(); + +assert.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); + +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 new file mode 100644 index 0000000000..f3dee10c20 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: Static literal property names (field definitions after an async method in the same line) +features: [class-fields, 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, +}); + +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-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js new file mode 100644 index 0000000000..c8825576b3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-after-same-line-async-method.template +/*--- +description: String literal names (field definitions after an async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 42; +} + +var c = new C(); + +assert.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: 42, + 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-gen-computed-names.js b/test/language/expressions/class/fields-same-line-gen-computed-names.js new file mode 100644 index 0000000000..98a34d18bf --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Computed property names (field definitions followed by a generator method in the same line) +features: [computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..61d3557fd7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Computed property symbol names (field definitions followed by a generator method in the same line) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-literal-names.js b/test/language/expressions/class/fields-same-line-gen-literal-names.js new file mode 100644 index 0000000000..248d4b9f63 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Literal property names (field definitions followed by a generator method in the same line) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/expressions/class/fields-same-line-gen-static-computed-names.js new file mode 100644 index 0000000000..71a36cc15a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Static Computed property names (field definitions followed by a generator method in the same line) +features: [computed-property-names, class-fields, 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 new file mode 100644 index 0000000000..11c793da01 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Static computed property symbol names (field definitions followed by a generator method in the same line) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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 new file mode 100644 index 0000000000..3bb9290762 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: Static literal property names (field definitions followed by a generator method in the same line) +features: [class-fields, 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-string-literal-names.js b/test/language/expressions/class/fields-same-line-gen-string-literal-names.js new file mode 100644 index 0000000000..0818c6fb89 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-same-line-generator.template +/*--- +description: String literal names (field definitions followed by a generator method in the same line) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..ec3aba7db5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..11d2a550f2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-literal-names.js b/test/language/expressions/class/fields-same-line-method-literal-names.js new file mode 100644 index 0000000000..9fbb56871e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + a; b = 42; + c = fn; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/expressions/class/fields-same-line-method-static-computed-names.js new file mode 100644 index 0000000000..af28adedf5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Static Computed property names (field definitions followed by a method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..3bc08250f9 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Static computed property symbol names (field definitions followed by a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + [x]; [y] = 42; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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 new file mode 100644 index 0000000000..cf2491ff03 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: Static literal property names (field definitions followed by a method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-same-line-method-string-literal-names.js new file mode 100644 index 0000000000..fd9437256a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-same-line-method.template +/*--- +description: String literal names (field definitions followed by a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + 'a'; "b"; 'c' = 39; + "d" = 42; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..54103874ba --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Computed property names (fields definition wrapped in semicolons) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +var C = class { + ;;;; + ;;;;;;static ["a"] = 39; [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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js b/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js new file mode 100644 index 0000000000..27c1ea48be --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Computed property symbol names (fields definition wrapped in semicolons) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + ;;;; + ;;;;;;[x]; [y] = 42;;;;;;; + ;;;; +} + +var c = new C(); + +assert.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-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js new file mode 100644 index 0000000000..15f4274771 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Literal property names (fields definition wrapped in semicolons) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +var C = class { + ;;;; + ;;;;;;a; b = 42; + c = fn;;;;;;; + ;;;; +} + +var c = new C(); + +assert.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-computed-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js new file mode 100644 index 0000000000..5c872a66a5 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Static Computed property names (fields definition wrapped in semicolons) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..b13c40f717 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Static computed property symbol names (fields definition wrapped in semicolons) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +var C = class { + ;;;; + ;;;;;;[x]; [y] = 42;;;;;;; + ;;;; +} + +var c = new C(); + +assert.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 new file mode 100644 index 0000000000..abb9d37ae9 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: Static literal property names (fields definition wrapped in semicolons) +features: [class-fields] +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-string-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js new file mode 100644 index 0000000000..e5249289a4 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-expr-wrapped-in-sc.template +/*--- +description: String literal names (fields definition wrapped in semicolons) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + ;;;; + ;;;;;;'a'; "b"; 'c' = 39; + "d" = 42;;;;;;; + ;;;; +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..03a21dbcc7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Computed property names (field definitions after a generator in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..e8cfaacbd3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Computed property symbol names (field definitions after a generator in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-literal-names.js new file mode 100644 index 0000000000..e087a50dd9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Literal property names (field definitions after a generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + *m() { return 42; } a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js new file mode 100644 index 0000000000..99d3f1d449 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Static Computed property names (field definitions after a generator in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..75771c7e4e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Static computed property symbol names (field definitions after a generator in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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 new file mode 100644 index 0000000000..e177af0599 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: Static literal property names (field definitions after a generator in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js new file mode 100644 index 0000000000..825c473e11 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-gen.template +/*--- +description: String literal names (field definitions after a generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..4ff63df663 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Computed property names (field definitions after a method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..16f3a6a706 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Computed property symbol names (field definitions after a method in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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-literal-names.js b/test/language/statements/class/fields-after-same-line-method-literal-names.js new file mode 100644 index 0000000000..72df50dbd8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Literal property names (field definitions after a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + m() { return 42; } a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-after-same-line-method-static-computed-names.js new file mode 100644 index 0000000000..e264f1823f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Static Computed property names (field definitions after a method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..6e6203ee75 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Static computed property symbol names (field definitions after a method in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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 new file mode 100644 index 0000000000..eccff1ad1f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: Static literal property names (field definitions after a method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-after-same-line-method-string-literal-names.js new file mode 100644 index 0000000000..9573c0764a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-method.template +/*--- +description: String literal names (field definitions after a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..bf786bbe02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Computed property names (field definitions after a static async generator in the same line) +features: [computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +C.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js new file mode 100644 index 0000000000..c6d00fc16f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Computed property symbol names (field definitions after a static async generator in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js new file mode 100644 index 0000000000..8f7963036d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Literal property names (field definitions after a static async generator in the same line) +features: [class-fields, 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; } a; b = 42; + 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); 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 new file mode 100644 index 0000000000..1c0d59cb2b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..01e7bdaa23 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..cda79389b7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js new file mode 100644 index 0000000000..c0ce0a9a13 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +/*--- +description: String literal names (field definitions after a static async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +C.m().next().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-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js new file mode 100644 index 0000000000..cdabce1c3d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +/*--- +description: Computed property names (field definitions after a static async method in the same line) +features: [computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + 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-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js new file mode 100644 index 0000000000..a5f850c520 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +/*--- +description: Computed property symbol names (field definitions after a static async method in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js new file mode 100644 index 0000000000..65292771c1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +/*--- +description: Literal property names (field definitions after a static async method in the same line) +features: [class-fields, 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; } a; b = 42; + 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, +}); + +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-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js new file mode 100644 index 0000000000..bfbbba4f43 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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, +}); + +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 new file mode 100644 index 0000000000..1d06240c54 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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 new file mode 100644 index 0000000000..6cad2880d8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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, +}); + +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-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js new file mode 100644 index 0000000000..9f7c8b1f6b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +/*--- +description: String literal names (field definitions after a static async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + 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-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js new file mode 100644 index 0000000000..8b57c85e41 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Computed property names (field definitions after a static generator in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js new file mode 100644 index 0000000000..a412f992d9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Computed property symbol names (field definitions after a static generator in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js new file mode 100644 index 0000000000..2c21f47baa --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Literal property names (field definitions after a static generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + static *m() { return 42; } a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js new file mode 100644 index 0000000000..47ddb34eab --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Static Computed property names (field definitions after a static generator in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..635c9a0767 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Static computed property symbol names (field definitions after a static generator in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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 new file mode 100644 index 0000000000..677321c281 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: Static literal property names (field definitions after a static generator in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js new file mode 100644 index 0000000000..f80e495c77 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +/*--- +description: String literal names (field definitions after a static generator in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..ad303b78ed --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Computed property names (field definitions after a static method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js new file mode 100644 index 0000000000..ccf3fb18ea --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Computed property symbol names (field definitions after a static method in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-literal-names.js new file mode 100644 index 0000000000..9436b0ab13 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Literal property names (field definitions after a static method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + static m() { return 42; } a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js new file mode 100644 index 0000000000..9f62592b35 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Static Computed property names (field definitions after a static method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..077a7ff89b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Static computed property symbol names (field definitions after a static method in the same line) +features: [Symbol, computed-property-names, class-fields] +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; } [x]; [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 new file mode 100644 index 0000000000..ea40041ffc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: Static literal property names (field definitions after a static method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js new file mode 100644 index 0000000000..1778f50d03 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-static-method.template +/*--- +description: String literal names (field definitions after a static method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-definitions-computed-names.js b/test/language/statements/class/fields-multiple-definitions-computed-names.js new file mode 100644 index 0000000000..7e5a8a52f3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-computed-names.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Computed property names (multiple fields definitions) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + foo = "foobar"; + m() { return 42 } + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + 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: false, + 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: 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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js b/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..448aa839c0 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Computed property symbol names (multiple fields definitions) +features: [Symbol, computed-property-names, class-fields] +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 } + [x]; [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: false, + 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: 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-multiple-definitions-literal-names.js b/test/language/statements/class/fields-multiple-definitions-literal-names.js new file mode 100644 index 0000000000..c636d50781 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-literal-names.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Literal property names (multiple fields definitions) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + foo = "foobar"; + m() { return 42 } + a; b = 42; + c = fn + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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-multiple-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-names.js new file mode 100644 index 0000000000..a325b8f34f --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-computed-names.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Static Computed property names (multiple fields definitions) +features: [computed-property-names, class-fields] +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: false, + 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: 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-multiple-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js new file mode 100644 index 0000000000..a9e390a24f --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Static computed property symbol names (multiple fields definitions) +features: [Symbol, computed-property-names, class-fields] +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 } + [x]; [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: false, + 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: 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-multiple-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-definitions-static-literal-names.js new file mode 100644 index 0000000000..ad72e5d79e --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-literal-names.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: Static literal property names (multiple fields definitions) +features: [class-fields] +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: false, + 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: 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-multiple-definitions-string-literal-names.js b/test/language/statements/class/fields-multiple-definitions-string-literal-names.js new file mode 100644 index 0000000000..b49dae8990 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-string-literal-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-multiple-definitions.template +/*--- +description: String literal names (multiple fields definitions) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + 'a'; "b"; 'c' = 39; + "d" = 42 + m2() { return 39 } + bar = "barbaz"; +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.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: false, + 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: 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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..276b70ef05 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Computed property names (multiple stacked fields definitions through ASI) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + foo = "foobar" + 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); + +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: false, + 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: 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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..932aaf6b6c --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Computed property symbol names (multiple stacked fields definitions through ASI) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42 + foo = "foobar" + 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); + +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: false, + 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: 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-multiple-stacked-definitions-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js new file mode 100644 index 0000000000..d4a699ba10 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Literal property names (multiple stacked fields definitions through ASI) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn + foo = "foobar" + 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); + +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: false, + 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: 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-multiple-stacked-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js new file mode 100644 index 0000000000..3cab98aad1 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Static Computed property names (multiple stacked fields definitions through ASI) +features: [computed-property-names, class-fields] +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.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js new file mode 100644 index 0000000000..b6fe6ec3fc --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Static computed property symbol names (multiple stacked fields definitions through ASI) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42 + foo = "foobar" + 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); + +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: false, + 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: 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-multiple-stacked-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js new file mode 100644 index 0000000000..a64ed4cf12 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: Static literal property names (multiple stacked fields definitions through ASI) +features: [class-fields] +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.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +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: false, + 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: 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-multiple-stacked-definitions-string-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js new file mode 100644 index 0000000000..e312f2ab92 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +/*--- +description: String literal names (multiple stacked fields definitions through ASI) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42 + foo = "foobar" + 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); + +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: false, + 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: 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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..879c594faf --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in a new line without a semicolon) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js b/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..006a80a5f3 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line without a semicolon) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js new file mode 100644 index 0000000000..ab88001d64 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in a new line without a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js new file mode 100644 index 0000000000..14ba9e812b --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..925379c474 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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 new file mode 100644 index 0000000000..f587d2b001 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js new file mode 100644 index 0000000000..9312e0d0a8 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +/*--- +description: String literal names (field definitions followed by a method in a new line without a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42 + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..991abbab82 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-new-sc-line-generator.template +/*--- +description: Computed property names (field definitions followed by a method in a new line with a semicolon) +features: [computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..d2de94d67a --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-new-sc-line-generator.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-literal-names.js new file mode 100644 index 0000000000..b4722a67bc --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-new-sc-line-generator.template +/*--- +description: Literal property names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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-computed-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js new file mode 100644 index 0000000000..b37919784b --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields, 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.g().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 new file mode 100644 index 0000000000..4f135922fd --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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 new file mode 100644 index 0000000000..17c11a6ced --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields, 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.g().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-string-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js new file mode 100644 index 0000000000..85ea958d0c --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-new-sc-line-generator.template +/*--- +description: String literal names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..ccc1a75c8a --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-computed-names.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-new-sc-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in a new line with a semicolon) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..501a9c455f --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-new-sc-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-literal-names.js new file mode 100644 index 0000000000..24ce2a6b41 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-new-sc-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js new file mode 100644 index 0000000000..8c8d1f7c28 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/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) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..9ad8182f2e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/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) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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 new file mode 100644 index 0000000000..db60f6da21 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/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) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js new file mode 100644 index 0000000000..28988a4ac3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-new-sc-line-method.template +/*--- +description: String literal names (field definitions followed by a method in a new line with a semicolon) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42; + m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-regular-definitions-computed-names.js b/test/language/statements/class/fields-regular-definitions-computed-names.js new file mode 100644 index 0000000000..da34a7e647 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-computed-names.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Computed property names (regular fields defintion) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js b/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js new file mode 100644 index 0000000000..1d05dd7142 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Computed property symbol names (regular fields defintion) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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-literal-names.js b/test/language/statements/class/fields-regular-definitions-literal-names.js new file mode 100644 index 0000000000..b35f3cc138 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-literal-names.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Literal property names (regular fields defintion) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-regular-definitions-static-computed-names.js new file mode 100644 index 0000000000..b61ca08f90 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-static-computed-names.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Static Computed property names (regular fields defintion) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..e982efc9ab --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Static computed property symbol names (regular fields defintion) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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 new file mode 100644 index 0000000000..4ebbcedef8 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-static-literal-names.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: Static literal property names (regular fields defintion) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-regular-definitions-string-literal-names.js new file mode 100644 index 0000000000..3de28394e4 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-string-literal-names.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-regular-definitions.template +/*--- +description: String literal names (regular fields defintion) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42 +} + +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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..d5a9a08945 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Computed property names (field definitions after an async generator in the same line) +features: [computed-property-names, class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js new file mode 100644 index 0000000000..12ed08d066 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Computed property symbol names (field definitions after an async generator in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-literal-names.js new file mode 100644 index 0000000000..b42348da54 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Literal property names (field definitions after an async generator in the same line) +features: [class-fields, 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; } a; b = 42; + 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); 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 new file mode 100644 index 0000000000..725743a1c9 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Static Computed property names (field definitions after an async generator in the same line) +features: [computed-property-names, class-fields, 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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..ddf3c70667 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Static computed property symbol names (field definitions after an async generator in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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, 42); +}, $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 new file mode 100644 index 0000000000..6958ec40e7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: Static literal property names (field definitions after an async generator in the same line) +features: [class-fields, 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, +}); + +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, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js new file mode 100644 index 0000000000..9b8b18af14 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +/*--- +description: String literal names (field definitions after an async generator in the same line) +features: [class-fields, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async *m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +c.m().next().then(function(v) { + assert.sameValue(v, 42); +}, $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 new file mode 100644 index 0000000000..b662f133ff --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-computed-names.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Computed property names (field definitions after an async method in the same line) +features: [computed-property-names, class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; +} + +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, +}); + +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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + 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-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js new file mode 100644 index 0000000000..56be7bd43b --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Computed property symbol names (field definitions after an async method in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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-literal-names.js b/test/language/statements/class/fields-same-line-async-method-literal-names.js new file mode 100644 index 0000000000..0b6f6da91d --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Literal property names (field definitions after an async method in the same line) +features: [class-fields, 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; } a; b = 42; + 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, +}); + +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-computed-names.js b/test/language/statements/class/fields-same-line-async-method-static-computed-names.js new file mode 100644 index 0000000000..355ab2ccd5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-computed-names.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Static Computed property names (field definitions after an async method in the same line) +features: [computed-property-names, class-fields, 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, +}); + +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 new file mode 100644 index 0000000000..9e81020f92 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Static computed property symbol names (field definitions after an async method in the same line) +features: [Symbol, computed-property-names, class-fields, 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; } [x]; [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, +}); + +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 new file mode 100644 index 0000000000..8fa7c18721 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-literal-names.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: Static literal property names (field definitions after an async method in the same line) +features: [class-fields, 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, +}); + +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-string-literal-names.js b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js new file mode 100644 index 0000000000..149008d373 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-after-same-line-async-method.template +/*--- +description: String literal names (field definitions after an async method in the same line) +features: [class-fields, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async m() { return 42; } 'a'; "b"; 'c' = 39; + "d" = 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, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: 42, + 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-gen-computed-names.js b/test/language/statements/class/fields-same-line-gen-computed-names.js new file mode 100644 index 0000000000..bea9a04f4d --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Computed property names (field definitions followed by a generator method in the same line) +features: [computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js new file mode 100644 index 0000000000..a7976b9916 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Computed property symbol names (field definitions followed by a generator method in the same line) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-literal-names.js b/test/language/statements/class/fields-same-line-gen-literal-names.js new file mode 100644 index 0000000000..d84b1c3ce9 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Literal property names (field definitions followed by a generator method in the same line) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/statements/class/fields-same-line-gen-static-computed-names.js new file mode 100644 index 0000000000..158a1aa43f --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Static Computed property names (field definitions followed by a generator method in the same line) +features: [computed-property-names, class-fields, 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 new file mode 100644 index 0000000000..52699d5ecc --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Static computed property symbol names (field definitions followed by a generator method in the same line) +features: [Symbol, computed-property-names, class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [y] = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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 new file mode 100644 index 0000000000..7afdf30af8 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: Static literal property names (field definitions followed by a generator method in the same line) +features: [class-fields, 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-string-literal-names.js b/test/language/statements/class/fields-same-line-gen-string-literal-names.js new file mode 100644 index 0000000000..2b204ab5ff --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-same-line-generator.template +/*--- +description: String literal names (field definitions followed by a generator method in the same line) +features: [class-fields, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42; *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..ad7135a649 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-computed-names.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Computed property names (field definitions followed by a method in the same line) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 39, + 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, "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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-method-computed-symbol-names.js b/test/language/statements/class/fields-same-line-method-computed-symbol-names.js new file mode 100644 index 0000000000..2e3aac2b2a --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Computed property symbol names (field definitions followed by a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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-literal-names.js b/test/language/statements/class/fields-same-line-method-literal-names.js new file mode 100644 index 0000000000..377d6f8dcc --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Literal property names (field definitions followed by a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + a; b = 42; + c = fn; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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-computed-names.js b/test/language/statements/class/fields-same-line-method-static-computed-names.js new file mode 100644 index 0000000000..0b8076d624 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-computed-names.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Static Computed property names (field definitions followed by a method in the same line) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..d7175fb6a9 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Static computed property symbol names (field definitions followed by a method in the same line) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + [x]; [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 new file mode 100644 index 0000000000..8a413a4908 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-literal-names.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: Static literal property names (field definitions followed by a method in the same line) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-same-line-method-string-literal-names.js new file mode 100644 index 0000000000..4a4f6d37f3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-string-literal-names.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-same-line-method.template +/*--- +description: String literal names (field definitions followed by a method in the same line) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + 'a'; "b"; 'c' = 39; + "d" = 42; m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.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: 42, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..14f2400c6a --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-computed-names.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Computed property names (fields definition wrapped in semicolons) +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = "b"; + + + +class C { + ;;;; + ;;;;;;static ["a"] = 39; [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); + +verifyProperty(c, "b", { + 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, "10"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + +verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + +verifyProperty(c, "not initialized", { + value: "meep", + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js b/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js new file mode 100644 index 0000000000..ef9466ace8 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-symbol-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Computed property symbol names (fields definition wrapped in semicolons) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + ;;;; + ;;;;;;[x]; [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-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-literal-names.js new file mode 100644 index 0000000000..4212441ce8 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-literal-names.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Literal property names (fields definition wrapped in semicolons) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +const fn = function() {} + + + +class C { + ;;;; + ;;;;;;a; b = 42; + 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-computed-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js new file mode 100644 index 0000000000..3a569f8c33 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Static Computed property names (fields definition wrapped in semicolons) +features: [computed-property-names, class-fields] +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 new file mode 100644 index 0000000000..1d7a9681da --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-symbol-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Static computed property symbol names (fields definition wrapped in semicolons) +features: [Symbol, computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ +var x = Symbol(); +var y = Symbol(); + + + +class C { + ;;;; + ;;;;;;[x]; [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 new file mode 100644 index 0000000000..3709f8f89f --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-literal-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: Static literal property names (fields definition wrapped in semicolons) +features: [class-fields] +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-string-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js new file mode 100644 index 0000000000..03155320b0 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/string-literal-names.case +// - src/class-fields/default/cls-decl-wrapped-in-sc.template +/*--- +description: String literal names (fields definition wrapped in semicolons) +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + ;;;; + ;;;;;;'a'; "b"; 'c' = 39; + "d" = 42;;;;;;; + ;;;; +} + +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: 42, + enumerable: true, + writable: true, + configurable: true +}); -- GitLab