Skip to content

Update the article to include ES2019 update for U+2028 and U+2029 #148

@DecimalTurn

Description

@DecimalTurn

Currently the article states:

For instance, RFC 8259 mentions that a design goal of JSON was to be "a subset of JavaScript", but it's actually not. Specifically, JSON allows the Unicode line terminators U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped. But JavaScript specifies that strings cannot contains line terminators (ECMA-262 - 7.8.4 String Literals), and line terminators include... U+2028 and U+2029 (7.3 Line Terminators). The single fact that these two characters are allowed without escape in JSON strings while they are not in JavaScript implies that JSON is not a subset of JavaScript, despite the JSON design goals.

However, there was a proposal to fix this issue in ES2019 that was adopted.

Indeed, the ES2019 section on Line Terminators no longer restricts all line terminators, but only and . Here's the highlighted diff:
Image

See also: Subsume JSON a.k.a. JSON ⊂ ECMAScript · V8


At the moment, the article only mentions PRs intended for fixing typos, but would a PR adding an update below the aformentioned paragraph be desirable/accepted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions