acorn-loose
Advanced tools
Comparing version 6.1.0 to 7.0.0
@@ -0,4 +1,10 @@ | ||
## 7.0.0 (2019-08-12) | ||
### Breaking changes | ||
Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression). | ||
## 6.1.0 (2019-07-04) | ||
## New features | ||
### New features | ||
@@ -5,0 +11,0 @@ Support bigint syntax. |
@@ -298,5 +298,3 @@ (function (global, factory) { | ||
this.last = this.tok; | ||
if (this.options.ecmaVersion >= 6) { | ||
node.sourceType = this.options.sourceType; | ||
} | ||
node.sourceType = this.options.sourceType; | ||
return this.finishNode(node, "Program") | ||
@@ -1052,4 +1050,4 @@ }; | ||
case acorn.tokTypes._import: | ||
if (this.options.ecmaVersion > 10) { | ||
return this.parseDynamicImport() | ||
if (this.options.ecmaVersion >= 11) { | ||
return this.parseExprImport() | ||
} else { | ||
@@ -1064,8 +1062,19 @@ return this.dummyIdent() | ||
lp$2.parseDynamicImport = function() { | ||
lp$2.parseExprImport = function() { | ||
var node = this.startNode(); | ||
this.next(); | ||
return this.finishNode(node, "Import") | ||
this.next(); // skip `import` | ||
switch (this.tok.type) { | ||
case acorn.tokTypes.parenL: | ||
return this.parseDynamicImport(node) | ||
default: | ||
node.name = "import"; | ||
return this.finishNode(node, "Identifier") | ||
} | ||
}; | ||
lp$2.parseDynamicImport = function(node) { | ||
node.source = this.parseExprList(acorn.tokTypes.parenR)[0] || this.dummyString(); | ||
return this.finishNode(node, "ImportExpression") | ||
}; | ||
lp$2.parseNew = function() { | ||
@@ -1072,0 +1081,0 @@ var node = this.startNode(), startIndent = this.curIndent, line = this.curLineStart; |
@@ -7,6 +7,6 @@ { | ||
"module": "dist/acorn-loose.mjs", | ||
"version": "6.1.0", | ||
"version": "7.0.0", | ||
"engines": {"node": ">=0.4.0"}, | ||
"dependencies": { | ||
"acorn": "^6.2.0" | ||
"acorn": "^7.0.0" | ||
}, | ||
@@ -13,0 +13,0 @@ "maintainers": [ |
Sorry, the diff of this file is not supported yet
302394
2493
+ Addedacorn@7.4.1(transitive)
- Removedacorn@6.4.2(transitive)
Updatedacorn@^7.0.0