From e1dad98ece112945251cad47032ac6011a8fc4dd Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 10 Oct 2024 14:52:34 +0900 Subject: [PATCH] fixes #14: define required [[UnderlyingIterators]] internal slot (#15) Co-authored-by: Kevin Gibbons --- package.json | 2 +- proposal-joint-iteration-biblio.json | 1 + spec.emu | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 proposal-joint-iteration-biblio.json diff --git a/package.json b/package.json index ff2c3b3..b7d10c9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "lib/index.js", "scripts": { "build": "tsc", - "spec": "ecmarkup --mark-effects --load-biblio @tc39/ecma262-biblio --load-biblio ./proposal-iterator-helpers-biblio.json --write-biblio biblio.json --lint-spec --strict spec.emu --assets-dir dist dist/index.html", + "spec": "ecmarkup --mark-effects --load-biblio @tc39/ecma262-biblio --load-biblio ./proposal-iterator-helpers-biblio.json --load-biblio ./proposal-joint-iteration-biblio.json --write-biblio biblio.json --lint-spec --strict spec.emu --assets-dir dist dist/index.html", "test": "node --test test/index.mjs" }, "repository": { diff --git a/proposal-joint-iteration-biblio.json b/proposal-joint-iteration-biblio.json new file mode 100644 index 0000000..33ae416 --- /dev/null +++ b/proposal-joint-iteration-biblio.json @@ -0,0 +1 @@ +{"location":"https://tc39.es/proposal-joint-iteration/","entries":[{"type":"clause","id":"sec-iterator.zip","aoid":null,"title":"Iterator.zip ( iterables [ , options ] )","titleHTML":"Iterator.zip ( iterables [ , options ] )","number":"1"},{"type":"clause","id":"sec-iterator.zipkeyed","aoid":null,"title":"Iterator.zipKeyed ( iterables [ , options ] )","titleHTML":"Iterator.zipKeyed ( iterables [ , options ] )","number":"2"},{"type":"op","aoid":"IteratorZip","refId":"sec-IteratorZip","kind":"abstract operation","signature":{"parameters":[{"name":"_iters_","type":{"kind":"list","elements":{"kind":"opaque","type":"Iterator Records"}}},{"name":"_mode_","type":{"kind":"union","types":[{"kind":"opaque","type":"*\"shortest\"*"},{"kind":"opaque","type":"*\"longest\"*"},{"kind":"opaque","type":"*\"strict\"*"}]}},{"name":"_padding_","type":{"kind":"list","elements":{"kind":"opaque","type":"ECMAScript language values"}}},{"name":"_finishResults_","type":{"kind":"opaque","type":"an Abstract Closure that takes a List of ECMAScript values and returns an ECMAScript value"}}],"optionalParameters":[],"return":{"kind":"opaque","type":"a Generator"}},"effects":[]},{"type":"clause","id":"sec-IteratorZip","aoid":"IteratorZip","title":"IteratorZip ( iters, mode, padding, finishResults )","titleHTML":"IteratorZip ( iters, mode, padding, finishResults )","number":"3"},{"type":"op","aoid":"IteratorCloseAll","refId":"sec-closeall","kind":"abstract operation","signature":{"parameters":[{"name":"_iters_","type":{"kind":"list","elements":{"kind":"opaque","type":"Iterator Records"}}},{"name":"_completion_","type":{"kind":"completion","typeOfValueIfNormal":null,"completionType":"mixed"}}],"optionalParameters":[],"return":{"kind":"completion","typeOfValueIfNormal":null,"completionType":"mixed"}},"effects":["user-code"]},{"type":"clause","id":"sec-closeall","aoid":"IteratorCloseAll","title":"IteratorCloseAll ( iters, completion )","titleHTML":"IteratorCloseAll ( iters, completion )","number":"4"},{"type":"op","aoid":"IfAbruptCloseIterators","refId":"sec-ifabruptcloseiterators","signature":null,"effects":["user-code"]},{"type":"clause","id":"sec-ifabruptcloseiterators","aoid":"IfAbruptCloseIterators","title":"IfAbruptCloseIterators ( value, iteratorRecords )","titleHTML":"IfAbruptCloseIterators ( value, iteratorRecords )","number":"5"},{"type":"clause","id":"sec-%iteratorhelperprototype%.return","aoid":null,"title":"%IteratorHelperPrototype%.return ( )","titleHTML":"%IteratorHelperPrototype%.return ( )","number":"6"},{"type":"op","aoid":"GetOptionsObject","refId":"sec-getoptionsobject","kind":"abstract operation","signature":{"parameters":[{"name":"_options_","type":{"kind":"opaque","type":"an ECMAScript language value"}}],"optionalParameters":[],"return":{"kind":"completion","completionType":"mixed","typeOfValueIfNormal":{"kind":"opaque","type":"an Object"}}},"effects":[]},{"type":"clause","id":"sec-getoptionsobject","aoid":"GetOptionsObject","title":"GetOptionsObject ( options )","titleHTML":"GetOptionsObject ( options )","number":"7.1"},{"type":"clause","id":"stolen-infra","aoid":null,"title":"Infra","titleHTML":"Infra","number":"7"}]} \ No newline at end of file diff --git a/spec.emu b/spec.emu index e751e02..e095b46 100644 --- a/spec.emu +++ b/spec.emu @@ -33,6 +33,8 @@ copyright: false 1. If _completion_ is an abrupt completion, then 1. Return ? IteratorClose(_iteratorRecord_, _completion_). 1. Return ReturnCompletion(*undefined*). - 1. Return CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « »). + 1. Let _gen_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _gen_.[[UnderlyingIterators]] to a new empty List. + 1. Return _gen_.