Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: acornjs/acorn
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8.8.1
Choose a base ref
...
head repository: acornjs/acorn
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8.8.2
Choose a head ref

Commits on Nov 11, 2022

  1. Update README.md

    MrBrN197 authored and marijnh committed Nov 11, 2022
    Copy the full SHA
    9acd0f1 View commit details

Commits on Nov 27, 2022

  1. Fix parsing of astral-idenfier characters after let and newline in su…

    …bstatement context
    
    FIX: Fix incorrect parse error on `if (0) let\n[astral identifier char]`.
    
    Closes #1161
    marijnh committed Nov 27, 2022
    Copy the full SHA
    02032ab View commit details

Commits on Dec 6, 2022

  1. Fix error when passing no options

    FIX: Fix an exception when passing no option object to `parse` or `new Parser`.
    elixiao authored Dec 6, 2022
    Copy the full SHA
    a114694 View commit details

Commits on Dec 15, 2022

  1. Bump test262 to latest commit

    dnalborczyk authored and marijnh committed Dec 15, 2022
    Copy the full SHA
    241f64a View commit details
  2. Copy the full SHA
    c74ab8c View commit details
  3. Bump deps

    dnalborczyk authored and marijnh committed Dec 15, 2022
    Copy the full SHA
    f69e646 View commit details
  4. Fix rollup config file extension

    dnalborczyk authored and marijnh committed Dec 15, 2022
    Copy the full SHA
    c521520 View commit details
  5. Bump @unicode/unicode-14.0.0

    dnalborczyk authored and marijnh committed Dec 15, 2022
    Copy the full SHA
    22e9d04 View commit details
  6. Copy the full SHA
    d8a139f View commit details
  7. Add support for unicode v15

    dnalborczyk authored and marijnh committed Dec 15, 2022
    Copy the full SHA
    e71db20 View commit details
  8. Copy the full SHA
    e36f8af View commit details
  9. Copy the full SHA
    dda64d0 View commit details

Commits on Dec 21, 2022

  1. Add unicode properties for ES2023

    dnalborczyk authored and marijnh committed Dec 21, 2022
    Copy the full SHA
    1ff6716 View commit details
  2. Remove tests from whitelist

    dnalborczyk authored and marijnh committed Dec 21, 2022
    Copy the full SHA
    ae85582 View commit details
  3. Fix default for allowHashBang option

    FIX: Fix a bug that caused `allowHashBang` to be set to false when not provided,
    even with `ecmaVersion >= 14`.
    
    Issue #1172
    marijnh committed Dec 21, 2022
    Copy the full SHA
    e708a22 View commit details
  4. Copy the full SHA
    11340a4 View commit details
  5. Copy the full SHA
    0ae1bfc View commit details
  6. 1
    Copy the full SHA
    4cf56d2 View commit details

Commits on Dec 23, 2022

  1. Remove unused argument

    dnalborczyk authored and marijnh committed Dec 23, 2022
    Copy the full SHA
    a32994a View commit details

Commits on Dec 28, 2022

  1. Remove unused parameter

    dnalborczyk authored and marijnh committed Dec 28, 2022
    Copy the full SHA
    5a376d4 View commit details

Commits on Dec 29, 2022

  1. Remove unreachable code

    dnalborczyk authored and marijnh committed Dec 29, 2022
    Copy the full SHA
    07b52f6 View commit details

Commits on Jan 12, 2023

  1. Add missing argument

    dnalborczyk authored and marijnh committed Jan 12, 2023
    Copy the full SHA
    724f1e0 View commit details

Commits on Jan 13, 2023

  1. Return consistent boolean value

    dnalborczyk authored and marijnh committed Jan 13, 2023
    Copy the full SHA
    75faae6 View commit details

Commits on Jan 23, 2023

  1. Mark version 8.8.2

    marijnh committed Jan 23, 2023
    Copy the full SHA
    2282d4b View commit details
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ Bradley Heinz
Brandon Mills
Brett Zamir
Brian Donovan
Brian Orora
bvanjoi
Charles Hughes
Charmander
@@ -31,6 +32,7 @@ daychongyang
dnalborczyk
Domenico Matteo
ehmicky
elixiao
ericrannaud
Eugene Obrezkov
Fabien LOISON
File renamed without changes.
2 changes: 1 addition & 1 deletion acorn-walk/README.md
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ const acorn = require("acorn")
const walk = require("acorn-walk")

walk.ancestor(acorn.parse("foo('hi')"), {
Literal(_, ancestors) {
Literal(_node, _state, ancestors) {
console.log("This literal's ancestors are:", ancestors.map(n => n.type))
}
})
File renamed without changes.
10 changes: 10 additions & 0 deletions acorn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.8.2 (2023-01-23)

### Bug fixes

Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.

Fix an exception when passing no option object to `parse` or `new Parser`.

Fix incorrect parse error on `if (0) let\n[astral identifier char]`.

## 8.8.1 (2022-10-24)

### Bug fixes
2 changes: 1 addition & 1 deletion acorn/dist/acorn.d.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ declare namespace acorn {
[Symbol.iterator](): Iterator<Token>
}

type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 'latest'

interface Options {
ecmaVersion: ecmaVersion
2 changes: 1 addition & 1 deletion acorn/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
],
"./package.json": "./package.json"
},
"version": "8.8.1",
"version": "8.8.2",
"engines": {
"node": ">=0.4.0"
},
File renamed without changes.
4 changes: 2 additions & 2 deletions acorn/src/expression.js
Original file line number Diff line number Diff line change
@@ -774,7 +774,7 @@ pp.parseProperty = function(isPattern, refDestructuringErrors) {
if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
isAsync = true
isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)
this.parsePropertyName(prop, refDestructuringErrors)
this.parsePropertyName(prop)
} else {
isAsync = false
}
@@ -1011,7 +1011,7 @@ pp.checkUnreserved = function({start, end, name}) {
// when parsing properties), it will also convert keywords into
// identifiers.

pp.parseIdent = function(liberal, isBinding) {
pp.parseIdent = function(liberal) {
let node = this.startNode()
if (this.type === tt.name) {
node.name = this.value
2 changes: 1 addition & 1 deletion acorn/src/generated/astralIdentifierCodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion acorn/src/generated/astralIdentifierStartCodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion acorn/src/generated/nonASCIIidentifierChars.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions acorn/src/identifier.js
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ function isInAstralSet(code, set) {
pos += set[i + 1]
if (pos >= code) return true
}
return false
}

// Test whether a given character code starts an identifier.
2 changes: 1 addition & 1 deletion acorn/src/index.js
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ import {isIdentifierChar, isIdentifierStart} from "./identifier.js"
import {Token} from "./tokenize.js"
import {isNewLine, lineBreak, lineBreakG, nonASCIIwhitespace} from "./whitespace.js"

export const version = "8.8.1"
export const version = "8.8.2"
export {
Parser,
defaultOptions,
2 changes: 1 addition & 1 deletion acorn/src/options.js
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ export function getOptions(opts) {
if (options.allowReserved == null)
options.allowReserved = options.ecmaVersion < 5

if (opts.allowHashBang == null)
if (!opts || opts.allowHashBang == null)
options.allowHashBang = options.ecmaVersion >= 14

if (isArray(options.onToken)) {
2 changes: 1 addition & 1 deletion acorn/src/regexp.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ export class RegExpValidationState {
constructor(parser) {
this.parser = parser
this.validFlags = `gim${parser.options.ecmaVersion >= 6 ? "uy" : ""}${parser.options.ecmaVersion >= 9 ? "s" : ""}${parser.options.ecmaVersion >= 13 ? "d" : ""}`
this.unicodeProperties = UNICODE_PROPERTY_VALUES[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]
this.unicodeProperties = UNICODE_PROPERTY_VALUES[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]
this.source = ""
this.flags = ""
this.start = 0
6 changes: 3 additions & 3 deletions acorn/src/statement.js
Original file line number Diff line number Diff line change
@@ -42,10 +42,10 @@ pp.isLet = function(context) {
// Statement) is allowed here. If context is not empty then only a Statement
// is allowed. However, `let [` is an explicit negative lookahead for
// ExpressionStatement, so special-case it first.
if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) return true // '[', '/', astral
if (nextCh === 91 || nextCh === 92) return true // '[', '/'
if (context) return false

if (nextCh === 123) return true // '{'
if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) return true // '{', astral
if (isIdentifierStart(nextCh, true)) {
let pos = next + 1
while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) ++pos
@@ -773,7 +773,7 @@ pp.parseClassId = function(node, isStatement) {
}

pp.parseClassSuper = function(node) {
node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts(false) : null
node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts(null, false) : null
}

pp.enterClassBody = function() {
2 changes: 0 additions & 2 deletions acorn/src/tokenize.js
Original file line number Diff line number Diff line change
@@ -718,8 +718,6 @@ pp.readEscapedChar = function(inTemplate) {
codePos,
"Invalid escape sequence in template string"
)

return null
}
default:
if (ch >= 48 && ch <= 55) {
16 changes: 11 additions & 5 deletions acorn/src/unicode-property-data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {wordsRegexp} from "./util.js"

// This file contains Unicode properties extracted from the ECMAScript
// specification. The lists are extracted like so:
// This file contains Unicode properties extracted from the ECMAScript specification.
// The lists are extracted like so:
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)

// #table-binary-unicode-properties
@@ -10,12 +10,15 @@ const ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"
const ecma11BinaryProperties = ecma10BinaryProperties
const ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"
const ecma13BinaryProperties = ecma12BinaryProperties
const ecma14BinaryProperties = ecma13BinaryProperties

const unicodeBinaryProperties = {
9: ecma9BinaryProperties,
10: ecma10BinaryProperties,
11: ecma11BinaryProperties,
12: ecma12BinaryProperties,
13: ecma13BinaryProperties
13: ecma13BinaryProperties,
14: ecma14BinaryProperties
}

// #table-unicode-general-category-values
@@ -27,12 +30,15 @@ const ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong H
const ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"
const ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"
const ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"
const ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"

const unicodeScriptValues = {
9: ecma9ScriptValues,
10: ecma10ScriptValues,
11: ecma11ScriptValues,
12: ecma12ScriptValues,
13: ecma13ScriptValues
13: ecma13ScriptValues,
14: ecma14ScriptValues
}

const data = {}
@@ -51,7 +57,7 @@ function buildUnicodeData(ecmaVersion) {
d.nonBinary.scx = d.nonBinary.Script_Extensions
}

for (const ecmaVersion of [9, 10, 11, 12, 13]) {
for (const ecmaVersion of [9, 10, 11, 12, 13, 14]) {
buildUnicodeData(ecmaVersion)
}

2 changes: 1 addition & 1 deletion bin/run_test262.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ function loadList(filename) {
}

run(
(content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 13, allowHashBang: true, allowAwaitOutsideFunction: sourceType === "module"}),
(content, {sourceType}) => parse(content, {sourceType, ecmaVersion: "latest"}),
{
testsDirectory: path.dirname(require.resolve("test262/package.json")),
skip: test => test.attrs.features &&
1 change: 1 addition & 0 deletions bin/test262.unsupported-features
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
decorators
import-assertions
regexp-duplicate-named-groups
regexp-v-flag
Loading