mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Implement yield* using a yield loop
This commit is contained in:
16
inputs/passing/iteration/yieldStar.ts
Normal file
16
inputs/passing/iteration/yieldStar.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// test_output! [1,2,3,1,2,"H","i"]
|
||||
|
||||
export default function main() {
|
||||
return [...gen()];
|
||||
}
|
||||
|
||||
function* gen() {
|
||||
yield* [1, 2, 3];
|
||||
yield* gen12();
|
||||
yield* "Hi";
|
||||
}
|
||||
|
||||
function* gen12() {
|
||||
yield 1;
|
||||
yield 2;
|
||||
}
|
||||
Reference in New Issue
Block a user