Skip to content

generator function es5 polyfill unexpected behavior in ForInStatement and deleteStatementΒ #49808

Description

@konicyQWQ

Bug Report

πŸ”Ž Search Terms

generator function polyfill

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried.

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

function* gen() {
    var count = 0;
    var obj = { foo: 1, bar: 2 };
    for (var key in obj) {
        console.log(obj.hasOwnProperty(key))
        yield [key, obj[key]];
        delete obj.bar;
        count += 1;
    }
    return count;
}

let itr = gen();
itr.next();
itr.next();

πŸ™ Actual behavior

true
false

πŸ™‚ Expected behavior

true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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