Skip to content

Commit a1dfef9

Browse files
committed
build - fix for private-class-elements
1 parent 6092881 commit a1dfef9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ compile('acorn-class-fields', './lib/class-fields/index.js', privateClassElement
3030
compile('acorn-static-class-features', './lib/static-class-features/index.js', privateClassElements)
3131
compile('acorn-private-class-elements', './lib/private-class-elements/index.js', function (str) {
3232
return str.replace('class extends Parser', 'class Parser_ extends Parser')
33+
.replace('new Parser', 'new Parser_')
3334
// it also works with v7
3435
.replace('if (acorn.version.indexOf("6.") != 0 || acorn.version.indexOf("6.0.") == 0) {', 'if (false) {')
3536
})

lib/private-class-elements/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = function(Parser) {
3535
Parser_.prototype.constructor = Parser_;
3636

3737
Parser_.prototype._branch = function _branch () {
38-
this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input)
38+
this.__branch = this.__branch || new Parser_({ecmaVersion: this.options.ecmaVersion}, this.input)
3939
this.__branch.end = this.end
4040
this.__branch.pos = this.pos
4141
this.__branch.type = this.type

0 commit comments

Comments
 (0)