From ebda95296c8081aa76f43be60c1f6dc29a3b2bac Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Fri, 14 Oct 2016 23:50:07 +0300 Subject: [PATCH] Fix up #172 (#177) * Update two esprima tests to the new "expected TOKEN" messages * Update dynamic-import to use "expected (" error message --- src/parser/expression.js | 2 +- test/fixtures/esprima/invalid-syntax/migrated_0112/options.json | 2 +- test/fixtures/esprima/invalid-syntax/migrated_0114/options.json | 2 +- .../experimental/dynamic-import/direct-calls-only/options.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser/expression.js b/src/parser/expression.js index eacb276665..55fa1619f4 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -396,7 +396,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { node = this.startNode(); this.next(); if (!this.match(tt.parenL)) { - this.unexpected(); + this.unexpected(null, tt.parenL); } return this.finishNode(node, "Import"); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json index 19754505ae..3044657f4d 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected ; (1:2)" -} +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json index 19754505ae..3044657f4d 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected ; (1:2)" -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json b/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json index 7592dd7f0e..400eeea626 100644 --- a/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json +++ b/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (2:15)" + "throws": "Unexpected token, expected ( (2:15)" }