Socket
Socket
Sign inDemoInstall

acorn

Package Overview
Dependencies
0
Maintainers
2
Versions
132
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.5 to 4.0.6

8

CHANGELOG.md

@@ -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 @@

2

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc