Skip to content

Implement Iterator Helpers #1378

Implement Iterator Helpers

Implement Iterator Helpers #1378

Triggered via pull request February 1, 2025 16:11
Status Failure
Total duration 4m 38s
Artifacts

pr.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

30 errors
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:31:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:47:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:39:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:54:3 at built-ins/Function/prototype/toString/built-in-function-object.js:53:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2018 the V8 project authors. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-function.prototype.tostring 05: description: > 06: toString of built-in Function object 07: info: | 08: ... 09: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 10: The representation must have the syntax of a NativeFunction. 11: ... 12: 13: NativeFunction: 14: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 15: NativeFunctionAccessor : 16: get 17: set 18: 19: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 20: features: [arrow-function, Reflect, Array.prototype.includes] 21: ---*/ 22: 23: const visited = []; 24: function visit(ns, path) { 25: if (visited.includes(ns)) { 26: return; 27: } 28: visited.push(ns); 29: 30: if (typeof ns === 'function') { 31: assertNativeFunction(ns, path); 32: } 33: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 34: return; 35: } 36: 37: const descriptors = Object.getOwnPropertyDescriptors(ns); 38: Reflect.ownKeys(descriptors) 39: .forEach((name) => { 40: const desc = descriptors[name]; 41: const p = typeof name === 'symbol' 42: ? `${path}[Symbol(${name.description})]` 43: : `${path}.${name}`; 44: if ('value' in desc) { 45: visit(desc.value, p); 46: } else { 47: visit(desc.get, p); 48: visit(desc.set, p); 49: } 50: }); 51: } 52: 53: WellKnownIntrinsicObjects.forEach((intrinsic) => { 54: visit(intrinsic.value, intrinsic.name); 55: }); 56: assert.notSameValue(visited.length, 0); 57:
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:32:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:48:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:40:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:55:3 at built-ins/Function/prototype/toString/built-in-function-object.js:54:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2018 the V8 project authors. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-function.prototype.tostring 06: description: > 07: toString of built-in Function object 08: info: | 09: ... 10: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 11: The representation must have the syntax of a NativeFunction. 12: ... 13: 14: NativeFunction: 15: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 16: NativeFunctionAccessor : 17: get 18: set 19: 20: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 21: features: [arrow-function, Reflect, Array.prototype.includes] 22: ---*/ 23: 24: const visited = []; 25: function visit(ns, path) { 26: if (visited.includes(ns)) { 27: return; 28: } 29: visited.push(ns); 30: 31: if (typeof ns === 'function') { 32: assertNativeFunction(ns, path); 33: } 34: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 35: return; 36: } 37: 38: const descriptors = Object.getOwnPropertyDescriptors(ns); 39: Reflect.ownKeys(descriptors) 40: .forEach((name) => { 41: const desc = descriptors[name]; 42: const p = typeof name === 'symbol' 43: ? `${path}[Symbol(${name.description})]` 44: : `${path}.${name}`; 45: if ('value' in desc) { 46: visit(desc.value, p); 47: } else { 48: visit(desc.get, p); 49: visit(desc.set, p); 50: } 51: }); 52: } 53: 54: WellKnownIntrinsicObjects.forEach((intrinsic) => { 55: visit(intrinsic.value, intrinsic.name); 56: }); 57: assert.notSameValue(visited.length, 0); 58:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:12:1 at built-ins/Iterator/from/callable.js:12:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2020 Rick Waldron. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Iterator.from is callable 08: features: [iterator-helpers] 09: ---*/ 10: function* g() {} 11: 12: Iterator.from(g()); 13: Iterator.from.call(null, g()); 14:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:38:26 at built-ins/Iterator/from/get-next-method-only-once.js:38:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Gets the next method from the underlying iterator only once 07: info: | 08: Iterator.from ( O ) 09: 10: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: let nextGets = 0; 16: let nextCalls = 0; 17: 18: class CountingIterator { 19: get next() { 20: ++nextGets; 21: let iter = (function* () { 22: for (let i = 1; i < 5; ++i) { 23: yield i; 24: } 25: })(); 26: return function () { 27: ++nextCalls; 28: return iter.next(); 29: }; 30: } 31: } 32: 33: let iterator = new CountingIterator(); 34: 35: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 36: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 37: 38: iterator = Iterator.from(iterator); 39: 40: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 41: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 42: 43: iterator.toArray(); 44: 45: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 46: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 47:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:11:1 at built-ins/Iterator/from/callable.js:11:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2020 Rick Waldron. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Iterator.from is callable 07: features: [iterator-helpers] 08: ---*/ 09: function* g() {} 10: 11: Iterator.from(g()); 12: Iterator.from.call(null, g()); 13:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:23:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Underlying iterator has throwing next getter 07: info: | 08: Iterator.from ( O ) 09: 10: 4. Let iterated be ? GetIteratorDirect(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: class ThrowingIterator { 16: get next() { 17: throw new Test262Error(); 18: } 19: } 20: 21: let iterator = new ThrowingIterator(); 22: 23: assert.throws(Test262Error, function () { 24: Iterator.from(iterator); 25: }); 26:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:39:26 at built-ins/Iterator/from/get-next-method-only-once.js:39:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the next method from the underlying iterator only once 08: info: | 09: Iterator.from ( O ) 10: 11: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: let nextGets = 0; 17: let nextCalls = 0; 18: 19: class CountingIterator { 20: get next() { 21: ++nextGets; 22: let iter = (function* () { 23: for (let i = 1; i < 5; ++i) { 24: yield i; 25: } 26: })(); 27: return function () { 28: ++nextCalls; 29: return iter.next(); 30: }; 31: } 32: } 33: 34: let iterator = new CountingIterator(); 35: 36: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 37: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 38: 39: iterator = Iterator.from(iterator); 40: 41: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 42: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 43: 44: iterator.toArray(); 45: 46: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 47: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 48:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:24:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Underlying iterator has throwing next getter 08: info: | 09: Iterator.from ( O ) 10: 11: 4. Let iterated be ? GetIteratorDirect(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: class ThrowingIterator { 17: get next() { 18: throw new Test262Error(); 19: } 20: } 21: 22: let iterator = new ThrowingIterator(); 23: 24: assert.throws(Test262Error, function () { 25: Iterator.from(iterator); 26: }); 27:
Iterator_from("built-ins/Iterator/from/get-return-method-when-call-return.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-return-method-when-call-return.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-return-method-when-call-return.js:24:31 at built-ins/Iterator/from/get-return-method-when-call-return.js:24:17 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2024 Sosuke Suzuki. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Gets the base iterator return method when the wrapper return method is called. 07: info: | 08: %WrapForValidIteratorPrototype%.return ( ) 09: ... 10: 5. Let returnMethod be ? GetMethod(iterator, "return"). 11: 12: features: [iterator-helpers] 13: includes: [temporalHelpers.js, compareArray.js] 14: ---*/ 15: 16: const calls = []; 17: 18: const iter = TemporalHelpers.propertyBagObserver(calls, { 19: return () { 20: return { value: 5, done: true }; 21: }, 22: }, "originalIter"); 23: 24: const wrapper = Iterator.from(iter); 25: assert.compareArray(calls, [ 26: "get originalIter[Symbol.iterator]", 27: "get originalIter.next", 28: ]); 29: 30: wrapper.return(); 31: assert.compareArray(calls, [ 32: "get originalIter[Symbol.iterator]", 33: "get originalIter.next", 34: "get originalIter.return" 35: ]); 36:
Iterator_from("built-ins/Iterator/from/get-return-method-when-call-return.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-return-method-when-call-return.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-return-method-when-call-return.js:25:31 at built-ins/Iterator/from/get-return-method-when-call-return.js:25:17 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /Users/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /Users/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2024 Sosuke Suzuki. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the base iterator return method when the wrapper return method is called. 08: info: | 09: %WrapForValidIteratorPrototype%.return ( ) 10: ... 11: 5. Let returnMethod be ? GetMethod(iterator, "return"). 12: 13: features: [iterator-helpers] 14: includes: [temporalHelpers.js, compareArray.js] 15: ---*/ 16: 17: const calls = []; 18: 19: const iter = TemporalHelpers.propertyBagObserver(calls, { 20: return () { 21: return { value: 5, done: true }; 22: }, 23: }, "originalIter"); 24: 25: const wrapper = Iterator.from(iter); 26: assert.compareArray(calls, [ 27: "get originalIter[Symbol.iterator]", 28: "get originalIter.next", 29: ]); 30: 31: wrapper.return(); 32: assert.compareArray(calls, [ 33: "get originalIter[Symbol.iterator]", 34: "get originalIter.next", 35: "get originalIter.return" 36: ]); 37:
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:31:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:47:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:39:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:54:3 at built-ins/Function/prototype/toString/built-in-function-object.js:53:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2018 the V8 project authors. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-function.prototype.tostring 05: description: > 06: toString of built-in Function object 07: info: | 08: ... 09: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 10: The representation must have the syntax of a NativeFunction. 11: ... 12: 13: NativeFunction: 14: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 15: NativeFunctionAccessor : 16: get 17: set 18: 19: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 20: features: [arrow-function, Reflect, Array.prototype.includes] 21: ---*/ 22: 23: const visited = []; 24: function visit(ns, path) { 25: if (visited.includes(ns)) { 26: return; 27: } 28: visited.push(ns); 29: 30: if (typeof ns === 'function') { 31: assertNativeFunction(ns, path); 32: } 33: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 34: return; 35: } 36: 37: const descriptors = Object.getOwnPropertyDescriptors(ns); 38: Reflect.ownKeys(descriptors) 39: .forEach((name) => { 40: const desc = descriptors[name]; 41: const p = typeof name === 'symbol' 42: ? `${path}[Symbol(${name.description})]` 43: : `${path}.${name}`; 44: if ('value' in desc) { 45: visit(desc.value, p); 46: } else { 47: visit(desc.get, p); 48: visit(desc.set, p); 49: } 50: }); 51: } 52: 53: WellKnownIntrinsicObjects.forEach((intrinsic) => { 54: visit(intrinsic.value, intrinsic.name); 55: }); 56: assert.notSameValue(visited.length, 0); 57:
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:32:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:48:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:40:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:55:3 at built-ins/Function/prototype/toString/built-in-function-object.js:54:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2018 the V8 project authors. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-function.prototype.tostring 06: description: > 07: toString of built-in Function object 08: info: | 09: ... 10: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 11: The representation must have the syntax of a NativeFunction. 12: ... 13: 14: NativeFunction: 15: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 16: NativeFunctionAccessor : 17: get 18: set 19: 20: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 21: features: [arrow-function, Reflect, Array.prototype.includes] 22: ---*/ 23: 24: const visited = []; 25: function visit(ns, path) { 26: if (visited.includes(ns)) { 27: return; 28: } 29: visited.push(ns); 30: 31: if (typeof ns === 'function') { 32: assertNativeFunction(ns, path); 33: } 34: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 35: return; 36: } 37: 38: const descriptors = Object.getOwnPropertyDescriptors(ns); 39: Reflect.ownKeys(descriptors) 40: .forEach((name) => { 41: const desc = descriptors[name]; 42: const p = typeof name === 'symbol' 43: ? `${path}[Symbol(${name.description})]` 44: : `${path}.${name}`; 45: if ('value' in desc) { 46: visit(desc.value, p); 47: } else { 48: visit(desc.get, p); 49: visit(desc.set, p); 50: } 51: }); 52: } 53: 54: WellKnownIntrinsicObjects.forEach((intrinsic) => { 55: visit(intrinsic.value, intrinsic.name); 56: }); 57: assert.notSameValue(visited.length, 0); 58:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:11:1 at built-ins/Iterator/from/callable.js:11:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2020 Rick Waldron. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Iterator.from is callable 07: features: [iterator-helpers] 08: ---*/ 09: function* g() {} 10: 11: Iterator.from(g()); 12: Iterator.from.call(null, g()); 13:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:12:1 at built-ins/Iterator/from/callable.js:12:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2020 Rick Waldron. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Iterator.from is callable 08: features: [iterator-helpers] 09: ---*/ 10: function* g() {} 11: 12: Iterator.from(g()); 13: Iterator.from.call(null, g()); 14:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:38:26 at built-ins/Iterator/from/get-next-method-only-once.js:38:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Gets the next method from the underlying iterator only once 07: info: | 08: Iterator.from ( O ) 09: 10: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: let nextGets = 0; 16: let nextCalls = 0; 17: 18: class CountingIterator { 19: get next() { 20: ++nextGets; 21: let iter = (function* () { 22: for (let i = 1; i < 5; ++i) { 23: yield i; 24: } 25: })(); 26: return function () { 27: ++nextCalls; 28: return iter.next(); 29: }; 30: } 31: } 32: 33: let iterator = new CountingIterator(); 34: 35: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 36: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 37: 38: iterator = Iterator.from(iterator); 39: 40: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 41: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 42: 43: iterator.toArray(); 44: 45: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 46: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 47:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:39:26 at built-ins/Iterator/from/get-next-method-only-once.js:39:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the next method from the underlying iterator only once 08: info: | 09: Iterator.from ( O ) 10: 11: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: let nextGets = 0; 17: let nextCalls = 0; 18: 19: class CountingIterator { 20: get next() { 21: ++nextGets; 22: let iter = (function* () { 23: for (let i = 1; i < 5; ++i) { 24: yield i; 25: } 26: })(); 27: return function () { 28: ++nextCalls; 29: return iter.next(); 30: }; 31: } 32: } 33: 34: let iterator = new CountingIterator(); 35: 36: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 37: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 38: 39: iterator = Iterator.from(iterator); 40: 41: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 42: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 43: 44: iterator.toArray(); 45: 46: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 47: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 48:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:23:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Underlying iterator has throwing next getter 07: info: | 08: Iterator.from ( O ) 09: 10: 4. Let iterated be ? GetIteratorDirect(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: class ThrowingIterator { 16: get next() { 17: throw new Test262Error(); 18: } 19: } 20: 21: let iterator = new ThrowingIterator(); 22: 23: assert.throws(Test262Error, function () { 24: Iterator.from(iterator); 25: }); 26:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:24:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Underlying iterator has throwing next getter 08: info: | 09: Iterator.from ( O ) 10: 11: 4. Let iterated be ? GetIteratorDirect(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: class ThrowingIterator { 17: get next() { 18: throw new Test262Error(); 19: } 20: } 21: 22: let iterator = new ThrowingIterator(); 23: 24: assert.throws(Test262Error, function () { 25: Iterator.from(iterator); 26: }); 27:
Iterator_from("built-ins/Iterator/from/get-return-method-when-call-return.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-return-method-when-call-return.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-return-method-when-call-return.js:25:31 at built-ins/Iterator/from/get-return-method-when-call-return.js:25:17 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2024 Sosuke Suzuki. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the base iterator return method when the wrapper return method is called. 08: info: | 09: %WrapForValidIteratorPrototype%.return ( ) 10: ... 11: 5. Let returnMethod be ? GetMethod(iterator, "return"). 12: 13: features: [iterator-helpers] 14: includes: [temporalHelpers.js, compareArray.js] 15: ---*/ 16: 17: const calls = []; 18: 19: const iter = TemporalHelpers.propertyBagObserver(calls, { 20: return () { 21: return { value: 5, done: true }; 22: }, 23: }, "originalIter"); 24: 25: const wrapper = Iterator.from(iter); 26: assert.compareArray(calls, [ 27: "get originalIter[Symbol.iterator]", 28: "get originalIter.next", 29: ]); 30: 31: wrapper.return(); 32: assert.compareArray(calls, [ 33: "get originalIter[Symbol.iterator]", 34: "get originalIter.next", 35: "get originalIter.return" 36: ]); 37:
Iterator_from("built-ins/Iterator/from/iterable-primitives.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/iterable-primitives.js Jint.Runtime.JavaScriptException: Actual [] and expected [0, 1, 2, 3, 4] should have the same contents. ---> Error: Actual [] and expected [0, 1, 2, 3, 4] should have the same contents. at assert (mustBeTrue, message) harness/assert.js:18:9 at assert.compareArray (actual, expected, message) harness/compareArray.js:48:5 at built-ins/Iterator/from/iterable-primitives.js:31:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in /home/runner/work/jint/jint/Jint/Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in /home/runner/work/jint/jint/Jint/Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in /home/runner/work/jint/jint/Jint.Tests.Test262/Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in /home/runner/work/jint/jint/Jint.Tests.Test262/Generated/Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Iterator.from does not respect the iterability of any primitive except Strings 07: info: | 08: Iterator.from ( O ) 09: 10: 1. If O is a String, set O to ! ToObject(O). 11: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 12: 13: includes: [compareArray.js] 14: features: [iterator-helpers] 15: flags: [] 16: ---*/ 17: 18: function* g() { 19: yield 0; 20: } 21: 22: Number.prototype[Symbol.iterator] = function* () { 23: let i = 0; 24: let target = this >>> 0; 25: while (i < target) { 26: yield i; 27: ++i; 28: } 29: }; 30: 31: assert.compareArray(Array.from(5), [0, 1, 2, 3, 4]); 32: 33: assert.throws(TypeError, function () { 34: Iterator.from(5); 35: }); 36: 37: assert.compareArray(Array.from(Iterator.from(new Number(5))), [0, 1, 2, 3, 4]); 38: 39: assert.compareArray(Array.from(Iterator.from('string')), ['s', 't', 'r', 'i', 'n', 'g']); 40: 41: const originalStringIterator = String.prototype[Symbol.iterator]; 42: let observedType; 43: Object.defineProperty(String.prototype, Symbol.iterator, { 44: get() { 45: 'use strict'; 46: observedType = typeof this; 47: return originalStringIterator; 48: } 49: }); 50: Iterator.from(''); 51: assert.sameValue(observedType, 'string'); 52: Iterator.from(new String('')); 53: assert.sameValue(observedType, 'object'); 54:
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:32:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:48:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:40:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:55:3 at built-ins/Function/prototype/toString/built-in-function-object.js:54:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2018 the V8 project authors. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-function.prototype.tostring 06: description: > 07: toString of built-in Function object 08: info: | 09: ... 10: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 11: The representation must have the syntax of a NativeFunction. 12: ... 13: 14: NativeFunction: 15: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 16: NativeFunctionAccessor : 17: get 18: set 19: 20: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 21: features: [arrow-function, Reflect, Array.prototype.includes] 22: ---*/ 23: 24: const visited = []; 25: function visit(ns, path) { 26: if (visited.includes(ns)) { 27: return; 28: } 29: visited.push(ns); 30: 31: if (typeof ns === 'function') { 32: assertNativeFunction(ns, path); 33: } 34: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 35: return; 36: } 37: 38: const descriptors = Object.getOwnPropertyDescriptors(ns); 39: Reflect.ownKeys(descriptors) 40: .forEach((name) => { 41: const desc = descriptors[name]; 42: const p = typeof name === 'symbol' 43: ? `${path}[Symbol(${name.description})]` 44: : `${path}.${name}`; 45: if ('value' in desc) { 46: visit(desc.value, p); 47: } else { 48: visit(desc.get, p); 49: visit(desc.set, p); 50: } 51: }); 52: } 53: 54: WellKnownIntrinsicObjects.forEach((intrinsic) => { 55: visit(intrinsic.value, intrinsic.name); 56: }); 57: assert.notSameValue(visited.length, 0); 58:
Function_prototype_toString("built-ins/Function/prototype/toString/built-in-function-object.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L11668
built-ins/Function/prototype/toString/built-in-function-object.js Jint.Runtime.JavaScriptException: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) ---> Error: Conforms to NativeFunction Syntax: "function Iterator.prototype.constructor() { [native code] }" (%IteratorPrototype%.constructor) at assertNativeFunction (fn, special) harness/nativeFunctionMatcher.js:218:11 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:31:5 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:47:9 at visit (ns, path) built-ins/Function/prototype/toString/built-in-function-object.js:39:3 at forEach built-ins/Function/prototype/toString/built-in-function-object.js:54:3 at built-ins/Function/prototype/toString/built-in-function-object.js:53:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2018 the V8 project authors. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-function.prototype.tostring 05: description: > 06: toString of built-in Function object 07: info: | 08: ... 09: If func is a built-in Function object, then return an implementation-dependent String source code representation of func. 10: The representation must have the syntax of a NativeFunction. 11: ... 12: 13: NativeFunction: 14: function NativeFunctionAccessor_opt IdentifierName_opt ( FormalParameters ) { [ native code ] } 15: NativeFunctionAccessor : 16: get 17: set 18: 19: includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] 20: features: [arrow-function, Reflect, Array.prototype.includes] 21: ---*/ 22: 23: const visited = []; 24: function visit(ns, path) { 25: if (visited.includes(ns)) { 26: return; 27: } 28: visited.push(ns); 29: 30: if (typeof ns === 'function') { 31: assertNativeFunction(ns, path); 32: } 33: if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) { 34: return; 35: } 36: 37: const descriptors = Object.getOwnPropertyDescriptors(ns); 38: Reflect.ownKeys(descriptors) 39: .forEach((name) => { 40: const desc = descriptors[name]; 41: const p = typeof name === 'symbol' 42: ? `${path}[Symbol(${name.description})]` 43: : `${path}.${name}`; 44: if ('value' in desc) { 45: visit(desc.value, p); 46: } else { 47: visit(desc.get, p); 48: visit(desc.set, p); 49: } 50: }); 51: } 52: 53: WellKnownIntrinsicObjects.forEach((intrinsic) => { 54: visit(intrinsic.value, intrinsic.name); 55: }); 56: assert.notSameValue(visited.length, 0); 57:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:12:1 at built-ins/Iterator/from/callable.js:12:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2020 Rick Waldron. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Iterator.from is callable 08: features: [iterator-helpers] 09: ---*/ 10: function* g() {} 11: 12: Iterator.from(g()); 13: Iterator.from.call(null, g()); 14:
Iterator_from("built-ins/Iterator/from/callable.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/callable.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/callable.js:11:1 at built-ins/Iterator/from/callable.js:11:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2020 Rick Waldron. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Iterator.from is callable 07: features: [iterator-helpers] 08: ---*/ 09: function* g() {} 10: 11: Iterator.from(g()); 12: Iterator.from.call(null, g()); 13:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:38:26 at built-ins/Iterator/from/get-next-method-only-once.js:38:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Gets the next method from the underlying iterator only once 07: info: | 08: Iterator.from ( O ) 09: 10: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: let nextGets = 0; 16: let nextCalls = 0; 17: 18: class CountingIterator { 19: get next() { 20: ++nextGets; 21: let iter = (function* () { 22: for (let i = 1; i < 5; ++i) { 23: yield i; 24: } 25: })(); 26: return function () { 27: ++nextCalls; 28: return iter.next(); 29: }; 30: } 31: } 32: 33: let iterator = new CountingIterator(); 34: 35: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 36: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 37: 38: iterator = Iterator.from(iterator); 39: 40: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 41: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 42: 43: iterator.toArray(); 44: 45: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 46: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 47:
Iterator_from("built-ins/Iterator/from/get-next-method-only-once.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-only-once.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-next-method-only-once.js:39:26 at built-ins/Iterator/from/get-next-method-only-once.js:39:12 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the next method from the underlying iterator only once 08: info: | 09: Iterator.from ( O ) 10: 11: 2. Let iteratorRecord be ? GetIteratorFlattenable(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: let nextGets = 0; 17: let nextCalls = 0; 18: 19: class CountingIterator { 20: get next() { 21: ++nextGets; 22: let iter = (function* () { 23: for (let i = 1; i < 5; ++i) { 24: yield i; 25: } 26: })(); 27: return function () { 28: ++nextCalls; 29: return iter.next(); 30: }; 31: } 32: } 33: 34: let iterator = new CountingIterator(); 35: 36: assert.sameValue(nextGets, 0, 'The value of `nextGets` is 0'); 37: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 38: 39: iterator = Iterator.from(iterator); 40: 41: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 42: assert.sameValue(nextCalls, 0, 'The value of `nextCalls` is 0'); 43: 44: iterator.toArray(); 45: 46: assert.sameValue(nextGets, 1, 'The value of `nextGets` is 1'); 47: assert.sameValue(nextCalls, 5, 'The value of `nextCalls` is 5'); 48:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:23:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Underlying iterator has throwing next getter 07: info: | 08: Iterator.from ( O ) 09: 10: 4. Let iterated be ? GetIteratorDirect(O). 11: 12: features: [iterator-helpers] 13: flags: [] 14: ---*/ 15: class ThrowingIterator { 16: get next() { 17: throw new Test262Error(); 18: } 19: } 20: 21: let iterator = new ThrowingIterator(); 22: 23: assert.throws(Test262Error, function () { 24: Iterator.from(iterator); 25: }); 26:
Iterator_from("built-ins/Iterator/from/get-next-method-throws.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-next-method-throws.js Jint.Runtime.JavaScriptException: Expected a Test262Error but got a TypeError ---> Error: Expected a Test262Error but got a TypeError at assert.throws (expectedErrorConstructor, func, message) harness/assert.js:95:13 at built-ins/Iterator/from/get-next-method-throws.js:24:1 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2023 Michael Ficarra. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Underlying iterator has throwing next getter 08: info: | 09: Iterator.from ( O ) 10: 11: 4. Let iterated be ? GetIteratorDirect(O). 12: 13: features: [iterator-helpers] 14: flags: [] 15: ---*/ 16: class ThrowingIterator { 17: get next() { 18: throw new Test262Error(); 19: } 20: } 21: 22: let iterator = new ThrowingIterator(); 23: 24: assert.throws(Test262Error, function () { 25: Iterator.from(iterator); 26: }); 27:
Iterator_from("built-ins/Iterator/from/get-return-method-when-call-return.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-return-method-when-call-return.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-return-method-when-call-return.js:24:31 at built-ins/Iterator/from/get-return-method-when-call-return.js:24:17 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: // Copyright (C) 2024 Sosuke Suzuki. All rights reserved. 02: // This code is governed by the BSD license found in the LICENSE file. 03: /*--- 04: esid: sec-iterator.from 05: description: > 06: Gets the base iterator return method when the wrapper return method is called. 07: info: | 08: %WrapForValidIteratorPrototype%.return ( ) 09: ... 10: 5. Let returnMethod be ? GetMethod(iterator, "return"). 11: 12: features: [iterator-helpers] 13: includes: [temporalHelpers.js, compareArray.js] 14: ---*/ 15: 16: const calls = []; 17: 18: const iter = TemporalHelpers.propertyBagObserver(calls, { 19: return () { 20: return { value: 5, done: true }; 21: }, 22: }, "originalIter"); 23: 24: const wrapper = Iterator.from(iter); 25: assert.compareArray(calls, [ 26: "get originalIter[Symbol.iterator]", 27: "get originalIter.next", 28: ]); 29: 30: wrapper.return(); 31: assert.compareArray(calls, [ 32: "get originalIter[Symbol.iterator]", 33: "get originalIter.next", 34: "get originalIter.return" 35: ]); 36:
Iterator_from("built-ins/Iterator/from/get-return-method-when-call-return.js": Jint.Tests.Test262/Generated/Tests262Harness.Tests.built-ins.generated.cs#L12090
built-ins/Iterator/from/get-return-method-when-call-return.js Jint.Runtime.JavaScriptException ---> Error at from built-ins/Iterator/from/get-return-method-when-call-return.js:25:31 at built-ins/Iterator/from/get-return-method-when-call-return.js:25:17 --- End of inner exception stack trace --- at Jint.Engine.ScriptEvaluation(ScriptRecord scriptRecord, ParserOptions parserOptions) in D:\a\jint\jint\Jint\Engine.cs:line 459 at Jint.Engine.ExecuteWithConstraints[T](Boolean strict, Func`1 callback) in D:\a\jint\jint\Jint\Engine.cs:line 819 at Jint.Tests.Test262.Test262Test.ExecuteTest(Engine engine, Test262File file) in D:\a\jint\jint\Jint.Tests.Test262\Test262Test.cs:line 102 at Jint.Tests.Test262.Test262Test.RunTestCode(String test, Boolean strict) in D:\a\jint\jint\Jint.Tests.Test262\Generated\Tests262Harness.Test262Test.generated.cs:line 77 01: "use strict"; 02: // Copyright (C) 2024 Sosuke Suzuki. All rights reserved. 03: // This code is governed by the BSD license found in the LICENSE file. 04: /*--- 05: esid: sec-iterator.from 06: description: > 07: Gets the base iterator return method when the wrapper return method is called. 08: info: | 09: %WrapForValidIteratorPrototype%.return ( ) 10: ... 11: 5. Let returnMethod be ? GetMethod(iterator, "return"). 12: 13: features: [iterator-helpers] 14: includes: [temporalHelpers.js, compareArray.js] 15: ---*/ 16: 17: const calls = []; 18: 19: const iter = TemporalHelpers.propertyBagObserver(calls, { 20: return () { 21: return { value: 5, done: true }; 22: }, 23: }, "originalIter"); 24: 25: const wrapper = Iterator.from(iter); 26: assert.compareArray(calls, [ 27: "get originalIter[Symbol.iterator]", 28: "get originalIter.next", 29: ]); 30: 31: wrapper.return(); 32: assert.compareArray(calls, [ 33: "get originalIter[Symbol.iterator]", 34: "get originalIter.next", 35: "get originalIter.return" 36: ]); 37: