Skip to content

Commit

Permalink
Implement in-library regexp validation
Browse files Browse the repository at this point in the history
Add support for ES2018 regexp features.
  • Loading branch information
mysticatea authored and marijnh committed Feb 22, 2018
1 parent ba939ea commit 0d20f67
Show file tree
Hide file tree
Showing 9 changed files with 3,035 additions and 66 deletions.
5 changes: 1 addition & 4 deletions bin/run_test262.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ const unsupportedFeatures = [
"class-fields-private",
"class-fields-public",
"numeric-separator-literal",
"optional-catch-binding",
"regexp-lookbehind",
"regexp-named-groups",
"regexp-unicode-property-escapes"
"optional-catch-binding"
];

run(
Expand Down
4 changes: 4 additions & 0 deletions src/loose/state.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {tokenizer, SourceLocation, tokTypes as tt, Node, lineBreak, isNewLine} from "../index"

function noop() {}

// Registered plugins
export const pluginsLoose = {}

Expand All @@ -9,6 +11,8 @@ export class LooseParser {
this.options = this.toks.options
this.input = this.toks.input
this.tok = this.last = {type: tt.eof, start: 0, end: 0}
this.tok.validateRegExpFlags = noop
this.tok.validateRegExpPattern = noop
if (this.options.locations) {
let here = this.toks.curPosition()
this.tok.loc = new SourceLocation(this.toks, here, here)
Expand Down
Loading

0 comments on commit 0d20f67

Please sign in to comment.