Skip to content

Commit 09d6b01

Browse files
committed
Fix: problems on Node 4
1 parent 259f67f commit 09d6b01

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ rules:
77
class-methods-use-this: off
88
complexity: off
99
mysticatea/arrow-parens: off
10+
mysticatea/prefer-for-of: off
1011
prettier/prettier:
1112
- error
1213
- tabWidth: 4

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"mocha": "^5.0.1",
2323
"npm-run-all": "^4.1.2",
2424
"prettier": "^1.9.2",
25+
"rimraf": "^2.6.2",
2526
"rollup": "^0.56.1",
2627
"rollup-plugin-node-resolve": "^3.0.3",
2728
"rollup-plugin-sourcemaps": "^0.4.2",

src/validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,11 @@ export class RegExpValidator {
908908
const c = String.fromCodePoint(cp)
909909
this.raise(`Unexpected character '${c}'`)
910910
}
911-
for (const name of this._backreferenceNames) {
911+
this._backreferenceNames.forEach(name => {
912912
if (!this._groupNames.has(name)) {
913913
this.raise("Invalid named capture referenced")
914914
}
915-
}
915+
})
916916
this.onPatternLeave(start, this.index)
917917
}
918918

test/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import assert from "assert"
2-
import { parseRegExpLiteral, ParserOptions } from "../src/index"
2+
import { parseRegExpLiteral, RegExpParser } from "../src/index"
33
import { cloneWithoutCircular } from "../tools/clone-without-circular"
44
import { Fixtures } from "./fixtures/parser/literal"
55

6-
function generateAST(source: string, options: ParserOptions): object {
6+
function generateAST(source: string, options: RegExpParser.Options): object {
77
return JSON.parse(
88
Buffer.from(
99
JSON.stringify(

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"esModuleInterop": true,
1414
"forceConsistentCasingInFileNames": true,
1515
"lib": [
16-
"es2017"
16+
"es2015"
1717
],
1818
"module": "commonjs",
1919
"moduleResolution": "node",
@@ -31,7 +31,7 @@
3131
"sourceMap": true,
3232
"sourceRoot": "src",
3333
"strictNullChecks": true,
34-
"target": "es2015"
34+
"target": "es5"
3535
},
3636
"include": [
3737
"src/**/*.ts"

tsconfig.prod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"sourceMap": true,
3232
"sourceRoot": "src",
3333
"strictNullChecks": true,
34-
"target": "es2015"
34+
"target": "es5"
3535
},
3636
"include": [
3737
"src/**/*.ts"

0 commit comments

Comments
 (0)