From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- ...ammar-special-prototype-async-gen-meth-valid.js | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js (limited to 'js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js') diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js new file mode 100644 index 0000000000..2c7e0c8f6d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-async-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Async Generator Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + [...] + 10. Let desc be PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 11. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + async * prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); -- cgit v1.2.3