Skip to content

Always emit asteriskToken and yield if parsed #2703

@rbuckton

Description

@rbuckton

Even though we don't yet support generator functions and methods, we do parse them. However, we do not emit the asterisk token or yield expression on output, which means that if I'm using --target ES6 my input does not align with my output for something we actually parse:

// a.ts
class C {
  *[Symbol.iterator]() {
    let a = yield 1;
  }
}

// a.js
class C {
  [Symbol.iterator]() {
    let a = ;
  }
}

We should just emit these tokens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptES6Relates to the ES6 SpecFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions