Skip to content

Commit 52fbe14

Browse files
Merge pull request #12 from browserify/v2
Do breaking updates
2 parents 4d22dff + f7c050b commit 52fbe14

File tree

7 files changed

+8
-92
lines changed

7 files changed

+8
-92
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ The files in lib/ are generated from other packages:
5858

5959
- lib/bigint: [acorn-bigint](https://github.com/acornjs/acorn-bigint]), MIT
6060
- lib/class-private-elements: [acorn-class-private-elements](https://github.com/acornjs/acorn-class-private-elements), MIT
61-
- lib/dynamic-import: [acorn-dynamic-import](https://github.com/kesne/acorn-dynamic-import), MIT
6261
- lib/export-ns-from: [acorn-export-ns-from](https://github.com/acornjs/acorn-export-ns-from), MIT
6362
- lib/import-meta: [acorn-import-meta](https://github.com/acornjs/acorn-import-meta), MIT
6463
- lib/numeric-separator: [acorn-numeric-separator](https://github.com/acornjs/acorn-numeric-separator]), MIT

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var CJSParser = acorn.Parser
66
.extend(require('./lib/class-fields'))
77
.extend(require('./lib/static-class-features'))
88
.extend(require('./lib/numeric-separator'))
9-
.extend(require('./lib/dynamic-import').default)
109
var ESModulesParser = CJSParser
1110
.extend(require('./lib/export-ns-from'))
1211
.extend(require('./lib/import-meta'))

lib/dynamic-import/index.js

Lines changed: 0 additions & 86 deletions
This file was deleted.

lib/import-meta/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ module.exports = function(Parser) {
3737
if (node.property.name !== "meta") {
3838
this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta")
3939
}
40+
if (this.containsEsc) {
41+
this.raiseRecoverable(node.property.start, "\"meta\" in import.meta must not contain escape sequences")
42+
}
4043
return this.finishNode(node, "MetaProperty")
4144
};
4245

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
"devDependencies": {
1515
"acorn-bigint": "^0.4.0",
1616
"acorn-class-fields": "^0.3.1",
17-
"acorn-dynamic-import": "^4.0.0",
1817
"acorn-export-ns-from": "^0.1.0",
19-
"acorn-import-meta": "^0.3.0",
18+
"acorn-import-meta": "^1.0.0",
2019
"acorn-numeric-separator": "^0.3.0",
2120
"acorn-private-class-elements": "^0.1.1",
2221
"acorn-static-class-features": "^0.2.0",

test/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ test('supports import.meta with sourceType: module', function (t) {
8484
t.doesNotThrow(function () {
8585
acorn.parse('console.log(import.meta.url)', { sourceType: 'module' })
8686
})
87+
t.throws(function () {
88+
acorn.parse('console.log(import.m\\u0065ta.ul)', { sourceType: 'module' })
89+
}, /must not contain escape sequences/)
8790
t.end()
8891
})
8992

@@ -143,7 +146,7 @@ test('walk supports plugin syntax', function (t) {
143146
)
144147
t.plan(2)
145148
walk.simple(ast, {
146-
Import: function () {
149+
ImportExpression: function () {
147150
t.pass('import()')
148151
},
149152
MetaProperty: function () {

walk.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var xtend = require('xtend')
22
var walk = require('acorn-walk')
33

44
var base = xtend(walk.base)
5-
base.Import = function () {}
65

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

0 commit comments

Comments
 (0)