diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js')
-rw-r--r-- | js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js new file mode 100644 index 0000000000..ac18e1f825 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Generator Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + [...] + 10. Let desc be the PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 11. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + * prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); |