Files
Tianlan ZhouandGitHub 907f4f8794 fix: Bump regenerator and add tests (#15841)
* fix: Bump `regenerator` and add tests

* Regenerate output.js

* Regenerate output.js
2023-08-05 14:10:20 +08:00

21 lines
505 B
JavaScript

function* f(x) {
yield* x;
};
expect(() => f(undefined).next()).toThrow(TypeError);
expect(() => f(null).next()).toThrow(TypeError);
expect(() => f(false).next()).toThrow(TypeError);
expect(() => f(true).next()).toThrow(TypeError);
expect(() => f(0).next()).toThrow(TypeError);
expect(() => f(1).next()).toThrow(TypeError);
expect(() => f({}).next()).toThrow(TypeError);
// #15172
expect(() => {
var [x] = {
[Symbol.iterator]: function* () {
yield* 0;
},
};
}).toThrow(TypeError);