Skip to content

Commit

Permalink
Merge pull request #12 from browserify/v2
Browse files Browse the repository at this point in the history
Do breaking updates
  • Loading branch information
goto-bus-stop committed Feb 24, 2020
2 parents 4d22dff + f7c050b commit 52fbe14
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 92 deletions.
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

0 comments on commit 52fbe14

Please sign in to comment.