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.
When
parser-flow.jsis run throughuglify-estheparsefunction is transformed to this (formatting added):When this is run on Node@4 the error
SyntaxError: Identifier 't' has already been declaredis thrown becauseconst tis redeclaringtfrom the function argument.