Skip to content

Commit

Permalink
improve error messages (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov authored and fabiosantoscode committed Nov 23, 2019
1 parent 6589965 commit d393ca6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/scope.js
Expand Up @@ -318,7 +318,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst);
})) {
js_error(
node.name + " redeclared",
`"${node.name}" is redeclared`,
node.start.file,
node.start.line,
node.start.col,
Expand All @@ -345,7 +345,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
}
if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) {
js_error(
node.TYPE + " statement may only appear at top level",
`"${node.TYPE}" statement may only appear at the top level`,
node.start.file,
node.start.line,
node.start.col,
Expand Down
2 changes: 1 addition & 1 deletion test/mocha/minify.js
Expand Up @@ -356,7 +356,7 @@ describe("minify", function() {
result = Terser.minify(code);
var err = result.error;
assert.ok(err instanceof Error);
assert.strictEqual(err.stack.split(/\n/)[0], "SyntaxError: a redeclared");
assert.strictEqual(err.stack.split(/\n/)[0], `SyntaxError: "a" is redeclared`);
});
});
});
Expand Down

0 comments on commit d393ca6

Please sign in to comment.