Skip to content

Commit

Permalink
Get rid of reserved-word-finding loop
Browse files Browse the repository at this point in the history
Closes #981
  • Loading branch information
marijnh committed Oct 2, 2020
1 parent 3af534d commit 88a0ca8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions acorn/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export class Parser {
this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5])
let reserved = ""
if (options.allowReserved !== true) {
for (let v = options.ecmaVersion;; v--)
if (reserved = reservedWords[v]) break
reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]
if (options.sourceType === "module") reserved += " await"
}
this.reservedWords = wordsRegexp(reserved)
Expand Down

0 comments on commit 88a0ca8

Please sign in to comment.