diff options
Diffstat (limited to 'vendor/js-sys/tests/wasm/Generator.js')
-rw-r--r-- | vendor/js-sys/tests/wasm/Generator.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/js-sys/tests/wasm/Generator.js b/vendor/js-sys/tests/wasm/Generator.js new file mode 100644 index 000000000..2cb59cca3 --- /dev/null +++ b/vendor/js-sys/tests/wasm/Generator.js @@ -0,0 +1,23 @@ +exports.one_two_generator = function() { + function* generator() { + yield 1; + yield 2; + } + return generator(); +}; + +exports.dummy_generator = function() { + function* generator() { + const reply = yield '2 * 2'; + return reply === 4; + } + return generator(); +}; + +exports.broken_generator = function() { + function* brokenGenerator() { + throw new Error('Something went wrong'); + yield 1; + } + return brokenGenerator(); +}; |