From 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:41:41 +0200 Subject: Merging upstream version 1.70.0+dfsg2. Signed-off-by: Daniel Baumann --- vendor/js-sys/tests/wasm/Generator.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 vendor/js-sys/tests/wasm/Generator.js (limited to 'vendor/js-sys/tests/wasm/Generator.js') 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(); +}; -- cgit v1.2.3