Skip to content

SyntaxError for parser-flow on Node@4 #1986

@cvbuelow

Description

@cvbuelow

When parser-flow.js is run through uglify-es the parse function is transformed to this (formatting added):

function parse(t) {
  const r = flow_parser.parse(t, {
    esproposal_class_instance_fields: !0,
    esproposal_class_static_fields: !0,
    esproposal_export_star_as: !0 });
  if (r.errors.length > 0) {
    const t = r.errors[0].loc;
    throw createError(r.errors[0].message, {
      start: { line: t.start.line, column: t.start.column + 1 },
      end: { line: t.end.line, column: t.end.column + 1 } })
  }
  return includeShebang(t, r), r
}

When this is run on Node@4 the error SyntaxError: Identifier 't' has already been declared is thrown because const t is redeclaring t from the function argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions