Skip to content

bad error: cannot use "await" as identifier inside an async function #342

@aralroca

Description

@aralroca

This code:

class Foo {
  #bar = async () => {
    if (
      target._isTargetExposed() &&
      (await target._initializedDeferred.valueOrThrow()) ===
        Target_js_1.InitializationStatus.SUCCESS
    ) {
      this.emit('targetcreated', target);
    }
  };
}

when parsed, it gives this error when it does not have any await that is an identifier...

[133:39-133:44]: cannot use "await" as identifier inside an async function

meriyah v6.0.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions