Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ The files in lib/ are generated from other packages:

- lib/bigint: [acorn-bigint](https://github.com/acornjs/acorn-bigint]), MIT
- lib/class-private-elements: [acorn-class-private-elements](https://github.com/acornjs/acorn-class-private-elements), MIT
- lib/dynamic-import: [acorn-dynamic-import](https://github.com/kesne/acorn-dynamic-import), MIT
- lib/export-ns-from: [acorn-export-ns-from](https://github.com/acornjs/acorn-export-ns-from), MIT
- lib/import-meta: [acorn-import-meta](https://github.com/acornjs/acorn-import-meta), MIT
- lib/numeric-separator: [acorn-numeric-separator](https://github.com/acornjs/acorn-numeric-separator]), MIT
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var CJSParser = acorn.Parser
.extend(require('./lib/class-fields'))
.extend(require('./lib/static-class-features'))
.extend(require('./lib/numeric-separator'))
.extend(require('./lib/dynamic-import').default)
var ESModulesParser = CJSParser
.extend(require('./lib/export-ns-from'))
.extend(require('./lib/import-meta'))
Expand Down
86 changes: 0 additions & 86 deletions lib/dynamic-import/index.js

This file was deleted.

3 changes: 3 additions & 0 deletions lib/import-meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ module.exports = function(Parser) {
if (node.property.name !== "meta") {
this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta")
}
if (this.containsEsc) {
this.raiseRecoverable(node.property.start, "\"meta\" in import.meta must not contain escape sequences")
}
return this.finishNode(node, "MetaProperty")
};

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
"devDependencies": {
"acorn-bigint": "^0.4.0",
"acorn-class-fields": "^0.3.1",
"acorn-dynamic-import": "^4.0.0",
"acorn-export-ns-from": "^0.1.0",
"acorn-import-meta": "^0.3.0",
"acorn-import-meta": "^1.0.0",
"acorn-numeric-separator": "^0.3.0",
"acorn-private-class-elements": "^0.1.1",
"acorn-static-class-features": "^0.2.0",
Expand Down
5 changes: 4 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ test('supports import.meta with sourceType: module', function (t) {
t.doesNotThrow(function () {
acorn.parse('console.log(import.meta.url)', { sourceType: 'module' })
})
t.throws(function () {
acorn.parse('console.log(import.m\\u0065ta.ul)', { sourceType: 'module' })
}, /must not contain escape sequences/)
t.end()
})

Expand Down Expand Up @@ -143,7 +146,7 @@ test('walk supports plugin syntax', function (t) {
)
t.plan(2)
walk.simple(ast, {
Import: function () {
ImportExpression: function () {
t.pass('import()')
},
MetaProperty: function () {
Expand Down
1 change: 0 additions & 1 deletion walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var xtend = require('xtend')
var walk = require('acorn-walk')

var base = xtend(walk.base)
base.Import = function () {}

function simple (node, visitors, baseVisitor, state, override) {
return walk.simple(node, visitors, baseVisitor || base, state, override)
Expand Down