diff --git a/test/language/statements/class/gen-method-yield-identifier-spread-strict.js b/test/language/statements/class/gen-method-yield-identifier-spread-strict.js index 594be88f44..3e136b5622 100644 --- a/test/language/statements/class/gen-method-yield-identifier-spread-strict.js +++ b/test/language/statements/class/gen-method-yield-identifier-spread-strict.js @@ -1,17 +1,17 @@ // This file was procedurally generated from the following sources: // - src/generators/yield-identifier-spread-strict.case -// - src/generators/default/class-decl-private-method.template +// - src/generators/default/class-decl-method.template /*--- -description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Generator private method as a ClassDeclaration element) -esid: prod-GeneratorPrivateMethod -features: [object-spread, generators, class-methods-private] +description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Generator method as a ClassDeclaration element) +esid: prod-GeneratorMethod +features: [object-spread, generators] flags: [generated, onlyStrict] negative: phase: parse type: SyntaxError info: | ClassElement : - PrivateMethodDefinition + MethodDefinition MethodDefinition : GeneratorMethod @@ -33,33 +33,20 @@ throw "Test262: This statement should not be evaluated."; var callCount = 0; -class C { - *#gen() { - callCount += 1; - return { - ...(function() { - var yield; - throw new Test262Error(); - }()), - } - } - get gen() { return this.#gen; } -} +class C { *gen() { + callCount += 1; + return { + ...(function() { + var yield; + throw new Test262Error(); + }()), + } +}} -const c = new C(); +var gen = C.prototype.gen; -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); - -var iter = c.gen(); +var iter = gen(); assert.sameValue(callCount, 1); - -// Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-method-yield-identifier-strict.js b/test/language/statements/class/gen-method-yield-identifier-strict.js index 95ab5b4149..ff6e459b95 100644 --- a/test/language/statements/class/gen-method-yield-identifier-strict.js +++ b/test/language/statements/class/gen-method-yield-identifier-strict.js @@ -1,17 +1,17 @@ // This file was procedurally generated from the following sources: // - src/generators/yield-identifier-strict.case -// - src/generators/default/class-decl-private-method.template +// - src/generators/default/class-decl-method.template /*--- -description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator private method as a ClassDeclaration element) -esid: prod-GeneratorPrivateMethod -features: [generators, class-methods-private] +description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator method as a ClassDeclaration element) +esid: prod-GeneratorMethod +features: [generators] flags: [generated, onlyStrict] negative: phase: parse type: SyntaxError info: | ClassElement : - PrivateMethodDefinition + MethodDefinition MethodDefinition : GeneratorMethod @@ -26,31 +26,18 @@ throw "Test262: This statement should not be evaluated."; var callCount = 0; -class C { - *#gen() { - callCount += 1; - (function() { - var yield; - throw new Test262Error(); - }()) - } - get gen() { return this.#gen; } -} +class C { *gen() { + callCount += 1; + (function() { + var yield; + throw new Test262Error(); + }()) +}} -const c = new C(); +var gen = C.prototype.gen; -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); - -var iter = c.gen(); +var iter = gen(); assert.sameValue(callCount, 1); - -// Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-method-yield-spread-arr-multiple.js b/test/language/statements/class/gen-method-yield-spread-arr-multiple.js index 1725a9b35c..0c33747403 100644 --- a/test/language/statements/class/gen-method-yield-spread-arr-multiple.js +++ b/test/language/statements/class/gen-method-yield-spread-arr-multiple.js @@ -1,15 +1,15 @@ // This file was procedurally generated from the following sources: // - src/generators/yield-spread-arr-multiple.case -// - src/generators/default/class-decl-private-method.template +// - src/generators/default/class-decl-method.template /*--- -description: Use yield value in a array spread position (Generator private method as a ClassDeclaration element) -esid: prod-GeneratorPrivateMethod -features: [generators, class-methods-private] +description: Use yield value in a array spread position (Generator method as a ClassDeclaration element) +esid: prod-GeneratorMethod +features: [generators] flags: [generated] includes: [compareArray.js] info: | ClassElement : - PrivateMethodDefinition + MethodDefinition MethodDefinition : GeneratorMethod @@ -31,22 +31,14 @@ var item; var callCount = 0; -class C { - *#gen() { - callCount += 1; - yield [...yield yield]; - } - get gen() { return this.#gen; } -} +class C { *gen() { + callCount += 1; + yield [...yield yield]; +}} -const c = new C(); +var gen = C.prototype.gen; -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); - -var iter = c.gen(); +var iter = gen(); iter.next(false); item = iter.next(['a', 'b', 'c']); @@ -56,8 +48,3 @@ assert(compareArray(item.value, arr)); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); - -// Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-method-yield-spread-arr-single.js b/test/language/statements/class/gen-method-yield-spread-arr-single.js index c1801eb476..07dd8dd707 100644 --- a/test/language/statements/class/gen-method-yield-spread-arr-single.js +++ b/test/language/statements/class/gen-method-yield-spread-arr-single.js @@ -1,14 +1,14 @@ // This file was procedurally generated from the following sources: // - src/generators/yield-spread-arr-single.case -// - src/generators/default/class-decl-private-method.template +// - src/generators/default/class-decl-method.template /*--- -description: Use yield value in a array spread position (Generator private method as a ClassDeclaration element) -esid: prod-GeneratorPrivateMethod -features: [generators, class-methods-private] +description: Use yield value in a array spread position (Generator method as a ClassDeclaration element) +esid: prod-GeneratorMethod +features: [generators] flags: [generated] info: | ClassElement : - PrivateMethodDefinition + MethodDefinition MethodDefinition : GeneratorMethod @@ -28,22 +28,14 @@ var arr = ['a', 'b', 'c']; var callCount = 0; -class C { - *#gen() { - callCount += 1; - yield [...yield]; - } - get gen() { return this.#gen; } -} +class C { *gen() { + callCount += 1; + yield [...yield]; +}} -const c = new C(); +var gen = C.prototype.gen; -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); - -var iter = c.gen(); +var iter = gen(); iter.next(false); var item = iter.next(arr); @@ -58,8 +50,3 @@ assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); - -// Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-method-yield-spread-obj.js b/test/language/statements/class/gen-method-yield-spread-obj.js index 93e1824ceb..39700e699f 100644 --- a/test/language/statements/class/gen-method-yield-spread-obj.js +++ b/test/language/statements/class/gen-method-yield-spread-obj.js @@ -1,15 +1,15 @@ // This file was procedurally generated from the following sources: // - src/generators/yield-spread-obj.case -// - src/generators/default/class-decl-private-method.template +// - src/generators/default/class-decl-method.template /*--- -description: Use yield value in a object spread position (Generator private method as a ClassDeclaration element) -esid: prod-GeneratorPrivateMethod -features: [object-spread, generators, class-methods-private] +description: Use yield value in a object spread position (Generator method as a ClassDeclaration element) +esid: prod-GeneratorMethod +features: [object-spread, generators] flags: [generated] includes: [compareArray.js] info: | ClassElement : - PrivateMethodDefinition + MethodDefinition MethodDefinition : GeneratorMethod @@ -30,26 +30,18 @@ info: | var callCount = 0; -class C { - *#gen() { - callCount += 1; - yield { - ...yield, - y: 1, - ...yield yield, - }; - } - get gen() { return this.#gen; } -} +class C { *gen() { + callCount += 1; + yield { + ...yield, + y: 1, + ...yield yield, + }; +}} -const c = new C(); +var gen = C.prototype.gen; -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); - -var iter = c.gen(); +var iter = gen(); iter.next(); iter.next({ x: 42 }); @@ -62,8 +54,3 @@ assert.sameValue(Object.keys(item.value).length, 2); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); - -// Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-private-method-yield-identifier-spread-strict.js b/test/language/statements/class/gen-private-method-yield-identifier-spread-strict.js new file mode 100644 index 0000000000..594be88f44 --- /dev/null +++ b/test/language/statements/class/gen-private-method-yield-identifier-spread-strict.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/generators/yield-identifier-spread-strict.case +// - src/generators/default/class-decl-private-method.template +/*--- +description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Generator private method as a ClassDeclaration element) +esid: prod-GeneratorPrivateMethod +features: [object-spread, generators, class-methods-private] +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + GeneratorMethod + + 14.4 Generator Function Definitions + + GeneratorMethod : + * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + + Spread Properties + + PropertyDefinition[Yield]: + (...) + ...AssignmentExpression[In, ?Yield] + +---*/ +throw "Test262: This statement should not be evaluated."; + +var callCount = 0; + +class C { + *#gen() { + callCount += 1; + return { + ...(function() { + var yield; + throw new Test262Error(); + }()), + } + } + get gen() { return this.#gen; } +} + +const c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); + +var iter = c.gen(); + + + +assert.sameValue(callCount, 1); + +// Test the private fields do not appear as properties after set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-private-method-yield-identifier-strict.js b/test/language/statements/class/gen-private-method-yield-identifier-strict.js new file mode 100644 index 0000000000..95ab5b4149 --- /dev/null +++ b/test/language/statements/class/gen-private-method-yield-identifier-strict.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/generators/yield-identifier-strict.case +// - src/generators/default/class-decl-private-method.template +/*--- +description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator private method as a ClassDeclaration element) +esid: prod-GeneratorPrivateMethod +features: [generators, class-methods-private] +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + GeneratorMethod + + 14.4 Generator Function Definitions + + GeneratorMethod : + * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + +---*/ +throw "Test262: This statement should not be evaluated."; + +var callCount = 0; + +class C { + *#gen() { + callCount += 1; + (function() { + var yield; + throw new Test262Error(); + }()) + } + get gen() { return this.#gen; } +} + +const c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); + +var iter = c.gen(); + + + +assert.sameValue(callCount, 1); + +// Test the private fields do not appear as properties after set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-private-method-yield-spread-arr-multiple.js b/test/language/statements/class/gen-private-method-yield-spread-arr-multiple.js new file mode 100644 index 0000000000..1725a9b35c --- /dev/null +++ b/test/language/statements/class/gen-private-method-yield-spread-arr-multiple.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/generators/yield-spread-arr-multiple.case +// - src/generators/default/class-decl-private-method.template +/*--- +description: Use yield value in a array spread position (Generator private method as a ClassDeclaration element) +esid: prod-GeneratorPrivateMethod +features: [generators, class-methods-private] +flags: [generated] +includes: [compareArray.js] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + GeneratorMethod + + 14.4 Generator Function Definitions + + GeneratorMethod : + * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + + Array Initializer + + SpreadElement[Yield, Await]: + ...AssignmentExpression[+In, ?Yield, ?Await] + +---*/ +var arr = ['a', 'b', 'c']; +var item; + +var callCount = 0; + +class C { + *#gen() { + callCount += 1; + yield [...yield yield]; + } + get gen() { return this.#gen; } +} + +const c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); + +var iter = c.gen(); + +iter.next(false); +item = iter.next(['a', 'b', 'c']); +item = iter.next(item.value); + +assert(compareArray(item.value, arr)); +assert.sameValue(item.done, false); + +assert.sameValue(callCount, 1); + +// Test the private fields do not appear as properties after set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-private-method-yield-spread-arr-single.js b/test/language/statements/class/gen-private-method-yield-spread-arr-single.js new file mode 100644 index 0000000000..c1801eb476 --- /dev/null +++ b/test/language/statements/class/gen-private-method-yield-spread-arr-single.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/generators/yield-spread-arr-single.case +// - src/generators/default/class-decl-private-method.template +/*--- +description: Use yield value in a array spread position (Generator private method as a ClassDeclaration element) +esid: prod-GeneratorPrivateMethod +features: [generators, class-methods-private] +flags: [generated] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + GeneratorMethod + + 14.4 Generator Function Definitions + + GeneratorMethod : + * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + + Array Initializer + + SpreadElement[Yield, Await]: + ...AssignmentExpression[+In, ?Yield, ?Await] +---*/ +var arr = ['a', 'b', 'c']; + +var callCount = 0; + +class C { + *#gen() { + callCount += 1; + yield [...yield]; + } + get gen() { return this.#gen; } +} + +const c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); + +var iter = c.gen(); + +iter.next(false); +var item = iter.next(arr); +var value = item.value; + +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); +assert.sameValue(item.done, false); + +assert.sameValue(callCount, 1); + +// Test the private fields do not appear as properties after set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); diff --git a/test/language/statements/class/gen-private-method-yield-spread-obj.js b/test/language/statements/class/gen-private-method-yield-spread-obj.js new file mode 100644 index 0000000000..93e1824ceb --- /dev/null +++ b/test/language/statements/class/gen-private-method-yield-spread-obj.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/generators/yield-spread-obj.case +// - src/generators/default/class-decl-private-method.template +/*--- +description: Use yield value in a object spread position (Generator private method as a ClassDeclaration element) +esid: prod-GeneratorPrivateMethod +features: [object-spread, generators, class-methods-private] +flags: [generated] +includes: [compareArray.js] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + GeneratorMethod + + 14.4 Generator Function Definitions + + GeneratorMethod : + * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + + Spread Properties + + PropertyDefinition[Yield]: + (...) + ...AssignmentExpression[In, ?Yield] + +---*/ + +var callCount = 0; + +class C { + *#gen() { + callCount += 1; + yield { + ...yield, + y: 1, + ...yield yield, + }; + } + get gen() { return this.#gen; } +} + +const c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); + +var iter = c.gen(); + +iter.next(); +iter.next({ x: 42 }); +iter.next({ x: 'lol' }); +var item = iter.next({ y: 39 }); + +assert.sameValue(item.value.x, 42); +assert.sameValue(item.value.y, 39); +assert.sameValue(Object.keys(item.value).length, 2); +assert.sameValue(item.done, false); + +assert.sameValue(callCount, 1); + +// Test the private fields do not appear as properties after set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');