acorn
Advanced tools
Comparing version 2.6.0 to 2.6.2
@@ -6,3 +6,3 @@ { | ||
"main": "dist/acorn.js", | ||
"version": "2.6.0", | ||
"version": "2.6.2", | ||
"engines": { | ||
@@ -9,0 +9,0 @@ "node": ">=0.4.0" |
@@ -39,3 +39,3 @@ // Acorn is a tiny, fast JavaScript parser written in JavaScript. | ||
export const version = "2.6.0" | ||
export const version = "2.6.2" | ||
@@ -42,0 +42,0 @@ // The main exported interface (under `self.acorn` when in the |
@@ -15,7 +15,7 @@ import {reservedWords, keywords} from "./identifier" | ||
constructor(options, input, startPos) { | ||
this.options = getOptions(options) | ||
this.sourceFile = this.options.sourceFile | ||
this.keywords = keywordRegexp(keywords[this.options.ecmaVersion >= 6 ? 6 : 5]) | ||
let reserved = this.options.allowReserved ? "" : | ||
reservedWords[this.options.ecmaVersion] + (options.sourceType == "module" ? " await" : "") | ||
this.options = options = getOptions(options) | ||
this.sourceFile = options.sourceFile | ||
this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]) | ||
let reserved = options.allowReserved ? "" : | ||
reservedWords[options.ecmaVersion] + (options.sourceType == "module" ? " await" : "") | ||
this.reservedWords = keywordRegexp(reserved) | ||
@@ -33,3 +33,3 @@ let reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict | ||
// Load plugins | ||
this.loadPlugins(this.options.plugins) | ||
this.loadPlugins(options.plugins) | ||
@@ -70,3 +70,3 @@ // Set up token state | ||
// Figure out if it's a module code. | ||
this.strict = this.inModule = this.options.sourceType === "module" | ||
this.strict = this.inModule = options.sourceType === "module" | ||
@@ -82,3 +82,3 @@ // Used to signify the start of a potential arrow function | ||
// If enabled, skip leading hashbang line. | ||
if (this.pos === 0 && this.options.allowHashBang && this.input.slice(0, 2) === '#!') | ||
if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!') | ||
this.skipLineComment(2) | ||
@@ -85,0 +85,0 @@ } |
Sorry, the diff of this file is too big to display
369412