Skip to content

Commit

Permalink
FIx: removed redundant test, re-added relevant test, updated Errors o…
Browse files Browse the repository at this point in the history
…bject

• Removed "without-dynamic-import" test as
• Removed unused code from the Errors object
• Re-added relevant importMeta test
  • Loading branch information
kik-o authored and nicolo-ribaudo committed Apr 24, 2020
1 parent 549ca12 commit 0cf8307
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 177 deletions.
1 change: 0 additions & 1 deletion packages/babel-parser/src/parser/location.js
Expand Up @@ -68,7 +68,6 @@ export const Errors = Object.freeze({
ImportCallArgumentTrailingComma:
"Trailing comma is disallowed inside import(...) arguments",
ImportCallArity: "import() requires exactly one argument",
ImportCallArityLtOne: "Dynamic imports require a parameter: import('a.js')",
ImportCallNotNewExpression: "Cannot use new with import(...)",
ImportCallSpreadArgument: "... is not allowed in import()",
ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
Expand Down
@@ -0,0 +1 @@
console.log(import.meta);
@@ -0,0 +1,4 @@
{
"sourceType": "unambiguous",
"plugins": ["importMeta"]
}
@@ -0,0 +1,52 @@
{
"type": "File",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"program": {
"type": "Program",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"expression": {
"type": "CallExpression",
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}},
"callee": {
"type": "MemberExpression",
"start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}},
"object": {
"type": "Identifier",
"start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"console"},
"name": "console"
},
"property": {
"type": "Identifier",
"start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"log"},
"name": "log"
},
"computed": false
},
"arguments": [
{
"type": "MetaProperty",
"start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}},
"meta": {
"type": "Identifier",
"start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"import"},
"name": "import"
},
"property": {
"type": "Identifier",
"start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"meta"},
"name": "meta"
}
}
]
}
}
],
"directives": []
}
}

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babel-template/src/parse.js
Expand Up @@ -100,7 +100,7 @@ function placeholderVisitorHandler(
!state.isLegacyRef.value &&
(state.placeholderPattern != null || state.placeholderWhitelist != null)
) {
// This check is also in options.js. We need it there to handle the default
// This check is also in options.json. We need it there to handle the default
// .syntacticPlaceholders behavior.
throw new Error(
"'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" +
Expand Down

0 comments on commit 0cf8307

Please sign in to comment.