1 of 6

Subsume JSON

Extend ECMA-262 syntax into a superset of JSON

2 of 6

  • JSON strings can contain unescaped U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR
  • ECMAScript strings cannot

JSON ⊄ ECMAScript

3 of 6

JSON ⊂ ECMAScript

  • JSON is defined by ECMA-404 and permanently fixed by RFC 7159
  • Only solution: change ECMAScript
    • Extend DoubleStringCharacter and SingleStringCharacter productions to allow unescaped U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR symbols
    • Backwards compatible (SyntaxError → no SyntaxError)

4 of 6

Stage 1?

5 of 6

Bigger question

  • Can we get rid of U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR as LineTerminator symbols entirely?
    • Adding use counter to V8 to gather data

6 of 6

<script>// Debug info:// User-Agent: <% JSON.stringify(ua) %>�</script>