oxc/crates/oxc_isolated_declarations/tests/fixtures/generator.ts
overlookmotel dc924892cc test: add trailing line breaks to conformance fixtures (#5541)
Continuation of #5537. Ensure all conformance fixture files have a trailing line break.
2024-09-06 12:55:17 +00:00

25 lines
353 B
TypeScript

// Correct
function *generatorGood(): Generator<number> {}
class GeneratorClassGood {
*method(): Generator<number> {
yield 50;
return 42;
}
}
// Need to explicit return type for async functions
// Incorrect
function *generatorBad() {
yield 50;
return 42;
}
class GeneratorClassBad {
*method() {
yield 50;
return 42;
}
}