Skip to content

generator function polyfill bug when call generator iterator throw methodΒ #49831

@konicyQWQ

Description

@konicyQWQ

Bug Report

πŸ”Ž Search Terms

generator iterator throw

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried.

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

function* gen() {
    yield 1;
}

var g = gen();
var exception = new Error("unhandled exception");
try {
    g.throw(exception);
} catch (err) {
    console.log(err);
}

πŸ™ Actual behavior

πŸ™‚ Expected behavior

Error: unhandled exception

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions