acorn
Advanced tools
Comparing version 4.0.5 to 4.0.6
@@ -0,1 +1,9 @@ | ||
## 4.0.6 (2017-02-02) | ||
### Bug fixes | ||
Fix exponential behavior (manifesting itself as a complete hang for | ||
even relatively small source files) introduced by the new 'use strict' | ||
check. | ||
## 4.0.5 (2017-02-02) | ||
@@ -2,0 +10,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"jsnext:main": "dist/acorn.es.js", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"engines": { | ||
@@ -10,0 +10,0 @@ "node": ">=0.4.0" |
@@ -107,3 +107,3 @@ // A recursive descent parser operates by defining functions for all | ||
if (this.type.isAssign) { | ||
this.checkPatternErrors(refDestructuringErrors, true) | ||
this.checkPatternErrors(refDestructuringErrors) | ||
if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors) | ||
@@ -253,3 +253,3 @@ let node = this.startNodeAt(startPos, startLoc) | ||
if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { | ||
this.checkPatternErrors(refDestructuringErrors, true) | ||
this.checkPatternErrors(refDestructuringErrors) | ||
this.checkYieldAwaitInDefaultParams() | ||
@@ -408,3 +408,3 @@ this.yieldPos = oldYieldPos | ||
if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { | ||
this.checkPatternErrors(refDestructuringErrors, true) | ||
this.checkPatternErrors(refDestructuringErrors) | ||
this.checkYieldAwaitInDefaultParams() | ||
@@ -411,0 +411,0 @@ if (innerParenStart) this.unexpected(innerParenStart) |
@@ -39,3 +39,3 @@ // Acorn is a tiny, fast JavaScript parser written in JavaScript. | ||
export const version = "4.0.5" | ||
export const version = "4.0.6" | ||
@@ -42,0 +42,0 @@ // The main exported interface (under `self.acorn` when in the |
@@ -9,5 +9,12 @@ import {types as tt} from "./tokentype" | ||
const useStrictRE = new RegExp(`^(${skipWhiteSpace.source}('([^\']|\\.)*'|"([^\"]|\\.)*"|;))*${skipWhiteSpace.source}('use strict'|"use strict")`) | ||
const literal = /^(?:'((?:[^\']|\.)*)'|"((?:[^\"]|\.)*)"|;)/ | ||
pp.strictDirective = function(start) { | ||
return useStrictRE.test(this.input.slice(start)) | ||
for (;;) { | ||
skipWhiteSpace.lastIndex = start | ||
start += skipWhiteSpace.exec(this.input)[0].length | ||
let match = literal.exec(this.input.slice(start)) | ||
if (!match) return false | ||
if ((match[1] || match[2]) == "use strict") return true | ||
start += match[0].length | ||
} | ||
} | ||
@@ -14,0 +21,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
13620
574889
38