├── .gitignore ├── .travis-github-deploy-key.enc ├── .travis.yml ├── LICENSE ├── README.md ├── docs └── index.html ├── missing-productions.json ├── package-lock.json ├── package.json └── spec.emu /.gitignore: -------------------------------------------------------------------------------- 1 | #################################################################################################### 2 | # https://github.com/github/gitignore/blob/9a1d4adec95789f45efd3242099628a2369b2fc8/Node.gitignore 3 | #################################################################################################### 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | 24 | # nyc test coverage 25 | .nyc_output 26 | 27 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 28 | .grunt 29 | 30 | # Bower dependency directory (https://bower.io/) 31 | bower_components 32 | 33 | # node-waf configuration 34 | .lock-wscript 35 | 36 | # Compiled binary addons (http://nodejs.org/api/addons.html) 37 | build/Release 38 | 39 | # Dependency directories 40 | node_modules/ 41 | jspm_packages/ 42 | 43 | # Typescript v1 declaration files 44 | typings/ 45 | 46 | # Optional npm cache directory 47 | .npm 48 | 49 | # Optional eslint cache 50 | .eslintcache 51 | 52 | # Optional REPL history 53 | .node_repl_history 54 | 55 | # Output of 'npm pack' 56 | *.tgz 57 | 58 | # Yarn Integrity file 59 | .yarn-integrity 60 | 61 | # dotenv environment variables file 62 | .env 63 | 64 | 65 | #################################################################################################### 66 | # https://github.com/github/gitignore/blob/9a1d4adec95789f45efd3242099628a2369b2fc8/Global/Vim.gitignore 67 | #################################################################################################### 68 | 69 | # Swap 70 | [._]*.s[a-v][a-z] 71 | [._]*.sw[a-p] 72 | [._]s[a-v][a-z] 73 | [._]sw[a-p] 74 | 75 | # Session 76 | Session.vim 77 | 78 | # Temporary 79 | .netrwhist 80 | *~ 81 | # Auto-generated tag files 82 | tags 83 | -------------------------------------------------------------------------------- /.travis-github-deploy-key.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tc39/proposal-json-superset/c51ed3b41f23fe8a3812a196cc0617a859e58787/.travis-github-deploy-key.enc -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - node 5 | script: 6 | - npm run build && 7 | { [ "@$TRAVIS_BRANCH" = "@master" ] || exit 0; } && 8 | $(npm bin)/set-up-ssh 9 | --key "$encrypted_0f6502bbf2d6_key" 10 | --iv "$encrypted_0f6502bbf2d6_iv" 11 | --path-encrypted-key ".travis-github-deploy-key.enc" && 12 | git checkout "$TRAVIS_BRANCH" && 13 | git add docs && 14 | { 15 | git diff --staged --stat && 16 | git commit --no-verify -m "Generated content @ $TRAVIS_COMMIT [skip ci]" || 17 | exit 0; 18 | } && 19 | git push "git@github.com:${TRAVIS_REPO_SLUG}.git" HEAD 20 | 21 | git: 22 | depth: 1 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Richard Gibson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Subsume JSON (a.k.a. JSON ⊂ ECMAScript) 2 | 3 | A proposal to extend ECMA-262 syntax into a superset of JSON. 4 | 5 | ## Status 6 | This proposal is at stage 4 of [the TC39 Process](https://tc39.github.io/process-document/) and is scheduled to be included in ES2019. 7 | 8 | ## Champions 9 | * Mark Miller 10 | * Mathias Bynens 11 | 12 | ## Motivation 13 | ECMAScript claims JSON as a subset in [`JSON.parse`](https://tc39.github.io/ecma262/#sec-json.parse), but (as has been well-documented) that is not true because JSON strings can contain unescaped U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR characters while ECMAScript strings cannot. 14 | 15 | These exceptions add unnecessary complexity to the specification and increase the cognitive burden on both implementers and users, allowing for the introduction of subtle bugs. 16 | Also, as a lesser but concrete corrolary problem, certain source concatenation and construction tasks currently require additional steps to process valid JSON into valid ECMAScript before embedding it. 17 | 18 | ## Proposed Solution 19 | JSON syntax is defined by [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm) and permanently fixed by [RFC 7159](https://tools.ietf.org/html/rfc7159), but the DoubleStringCharacter and SingleStringCharacter productions of ECMA-262 can be extended to allow unescaped U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR characters. 20 | 21 | ## Examples 22 | ```js 23 | const LS = "
"; 24 | const PS = eval("'\u2029'"); 25 | ``` 26 | 27 | ## Discussion 28 | ### Backwards Compatibility 29 | This change is backwards-compatible. 30 | User-visible effects will be limited to the elimination of SyntaxError completions when parsing strings that include unescaped LINE SEPARATOR or PARAGRAPH SEPARATOR characters, which in practice are extremely uncommon (we also hope to [collect data](https://bugs.chromium.org/p/v8/issues/detail?id=6827) for the related question of how often those characters are used as line terminators _outside_ of strings). 31 | 32 | ### Regular Expression Literals 33 | Unescaped LINE SEPARATOR and PARAGRAPH SEPARATOR characters are not currently allowed in regular expression literals either, but that restriction has been left in place because regular expression literals are not part of JSON. 34 | 35 | ### Template Literals 36 | Unescaped LINE SEPARATOR and PARAGRAPH SEPARATOR characters are already allowed in template literals. 37 | 38 | ### Validity 39 | Encompassing JSON syntax does not imply the _semantic_ validity of all JSON text. 40 | For example, `({ "__proto__": 1, "__proto__": 2 })` triggers an early SyntaxError under Annex B, and will continue to do so. 41 | However, it will become possible to generate a parse tree from `({ "LineTerminators": "\n\r

" })`. 42 | 43 | ### Objections 44 | Allen Wirfs-Brock [argues](https://esdiscuss.org/topic/json-text-is-not-a-subset-of-primaryexpression#content-3) that ECMAScript and JSON are distinct and don't need an easily-described relationship, and is concerned that acceptance of this proposal would be used as leverage by others attempting to "fix JSON". 45 | 46 | The latter is addressed by this proposal explicitly acknowledging JSON syntax as a fixed point. 47 | As for the former, it is clear from the definition of `JSON.parse` that ECMAScript benefits from the similarity (e.g., step 4 includes "parsing and evaluating scriptText as if it was the source text of an ECMAScript Script"). 48 | This proposal argues that eliminating the need for an alternate DoubleStringCharacter production and the associated cognitive burden in reasoning about the two languages is sufficiently beneficial to justify such a change. 49 | 50 | ## Conformance tests 51 | 52 | Test262 tests are here: 53 | 54 | ## TC39 meeting notes 55 | 56 | - [September 2017](https://tc39.github.io/tc39-notes/2017-09_sept-27.html#12ie-make-ecmascript-a-syntactic-superset-of-json-for-stage-1) 57 | - [November 2017](https://tc39.github.io/tc39-notes/2017-11_nov-28.html#9iic-make-ecmascript-a-syntactic-superset-of-json-for-stage-2) 58 | - [January 2018](https://tc39.github.io/tc39-notes/2018-01_jan-23.html#13iib-make-ecmascript-a-syntactic-superset-of-json-for-stage-3) 59 | - [May 2018](https://tc39.github.io/tc39-notes/2018-05_may-22.html#11ie-ecmascript-as-a-superset-of-json) 60 | 61 | ## Implementations 62 | 63 | - [V8](https://bugs.chromium.org/p/v8/issues/detail?id=7418), shipping in Chrome 66 64 | - JavaScriptCore, shipping in [Safari Technology Preview 49+](https://developer.apple.com/safari/technology-preview/release-notes/#release-49) 65 | - [Babel](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings) 66 | 67 | ## Specification 68 | The specification is available in [ecmarkup](spec.emu) or [rendered HTML](https://tc39.github.io/proposal-json-superset/). 69 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Subsume JSON

Proposal proposal-json-superset

Stage 4 Draft / May 22, 2018

Subsume JSON

1794 | 1795 | 1796 | 1797 | 1798 | 1799 |

1String Literals

1800 | Note 1
1801 |

A string literal is zero or more Unicode code points enclosed in single or double quotes. Unicode code points may also be represented by an escape sequence. All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), U+2028 (LINE SEPARATOR), U+2029 (PARAGRAPH SEPARATOR), and U+000A (LINE FEED). Any code points may appear in the form of an escape sequence. String literals evaluate to ECMAScript String values. When generating these String values Unicode code points are UTF-16 encoded as defined in 10.1.1. Code points belonging to the Basic Multilingual Plane are encoded as a single code unit element of the string. All other code points are encoded as two code unit elements of the string.

1802 |
1803 |

Syntax

1804 | 1805 | StringLiteral::"DoubleStringCharactersopt" 1806 | 'SingleStringCharactersopt' 1807 | 1808 | 1809 | DoubleStringCharacters::DoubleStringCharacterDoubleStringCharactersopt 1810 | 1811 | 1812 | SingleStringCharacters::SingleStringCharacterSingleStringCharactersopt 1813 | 1814 | 1815 | DoubleStringCharacter::SourceCharacterbut not one of " or \ or LineTerminator 1816 | <LS> 1817 | <PS> 1818 | \EscapeSequence 1819 | LineContinuation 1820 | 1821 | 1822 | SingleStringCharacter::SourceCharacterbut not one of ' or \ or LineTerminator 1823 | <LS> 1824 | <PS> 1825 | \EscapeSequence 1826 | LineContinuation 1827 | 1828 | 1829 | LineContinuation::\LineTerminatorSequence 1830 | 1831 | 1832 | EscapeSequence::CharacterEscapeSequence 1833 | 0[lookahead ∉ DecimalDigit] 1834 | HexEscapeSequence 1835 | UnicodeEscapeSequence 1836 | 1837 |

A conforming implementation, when processing strict mode code, must not extend the syntax of EscapeSequence to include LegacyOctalEscapeSequence as described in B.1.2.

1838 | 1839 | CharacterEscapeSequence::SingleEscapeCharacter 1840 | NonEscapeCharacter 1841 | 1842 | 1843 | SingleEscapeCharacter::one of'"\bfnrtv 1844 | 1845 | 1846 | NonEscapeCharacter::SourceCharacterbut not one of EscapeCharacter or LineTerminator 1847 | 1848 | 1849 | EscapeCharacter::SingleEscapeCharacter 1850 | DecimalDigit 1851 | x 1852 | u 1853 | 1854 | 1855 | HexEscapeSequence::xHexDigitHexDigit 1856 | 1857 | 1858 | UnicodeEscapeSequence::uHex4Digits 1859 | u{HexDigits} 1860 | 1861 | 1862 | Hex4Digits::HexDigitHexDigitHexDigitHexDigit 1863 | 1864 |

The definition of the nonterminal HexDigit is given in 11.8.3. SourceCharacter is defined in 10.1.

1865 | Note 2
1866 |

A line terminator code point<LF> and <CR> cannot appear in a string literal, except as part of a LineContinuation to produce the empty code points sequence. The proper way to cause a line terminator code point to be part ofinclude either in the String value of a string literal is to use an escape sequence such as \n or \u000A.

1867 |
1868 | 1869 | 1870 | 1871 |

1.1Static Semantics: Early Errors

1872 | 1873 | UnicodeEscapeSequence::u{HexDigits} 1874 | 1875 |
    1876 |
  • 1877 | It is a Syntax Error if the MV of HexDigits > 0x10FFFF. 1878 | 1879 |
  • 1880 |
1881 |
1882 | 1883 | 1884 | 1885 |

1.2Static Semantics: StringValue

1886 | 1887 | 1888 | StringLiteral::"DoubleStringCharactersopt" 1889 | 'SingleStringCharactersopt' 1890 | 1891 |
  1. Return the String value whose elements are the SV of this StringLiteral. 1892 |
1893 |
1894 | 1895 | 1896 | 1897 |

1.3Static Semantics: SV

1898 |

A string literal stands for a value of the String type. The String value (SV) of the literal is described in terms of code unit values contributed by the various parts of the string literal. As part of this process, some Unicode code points within the string literal are interpreted as having a mathematical value (MV), as described below or in 11.8.3.

1899 | 2043 |
Table 1: String Single Character Escape Sequences
2044 | 2045 | 2046 | 2047 | 2051 | 2055 | 2059 | 2063 | 2064 | 2065 | 2069 | 2073 | 2077 | 2081 | 2082 | 2083 | 2087 | 2091 | 2095 | 2099 | 2100 | 2101 | 2105 | 2109 | 2113 | 2117 | 2118 | 2119 | 2123 | 2127 | 2131 | 2135 | 2136 | 2137 | 2141 | 2145 | 2149 | 2153 | 2154 | 2155 | 2159 | 2163 | 2167 | 2171 | 2172 | 2173 | 2177 | 2181 | 2185 | 2189 | 2190 | 2191 | 2195 | 2199 | 2203 | 2207 | 2208 | 2209 | 2213 | 2217 | 2221 | 2225 | 2226 | 2227 |
2048 | Escape Sequence 2049 | 2050 | 2052 | Code Unit Value 2053 | 2054 | 2056 | Unicode Character Name 2057 | 2058 | 2060 | Symbol 2061 | 2062 |
2066 | \b 2067 | 2068 | 2070 | 0x0008 2071 | 2072 | 2074 | BACKSPACE 2075 | 2076 | 2078 | <BS> 2079 | 2080 |
2084 | \t 2085 | 2086 | 2088 | 0x0009 2089 | 2090 | 2092 | CHARACTER TABULATION 2093 | 2094 | 2096 | <HT> 2097 | 2098 |
2102 | \n 2103 | 2104 | 2106 | 0x000A 2107 | 2108 | 2110 | LINE FEED (LF) 2111 | 2112 | 2114 | <LF> 2115 | 2116 |
2120 | \v 2121 | 2122 | 2124 | 0x000B 2125 | 2126 | 2128 | LINE TABULATION 2129 | 2130 | 2132 | <VT> 2133 | 2134 |
2138 | \f 2139 | 2140 | 2142 | 0x000C 2143 | 2144 | 2146 | FORM FEED (FF) 2147 | 2148 | 2150 | <FF> 2151 | 2152 |
2156 | \r 2157 | 2158 | 2160 | 0x000D 2161 | 2162 | 2164 | CARRIAGE RETURN (CR) 2165 | 2166 | 2168 | <CR> 2169 | 2170 |
2174 | \" 2175 | 2176 | 2178 | 0x0022 2179 | 2180 | 2182 | QUOTATION MARK 2183 | 2184 | 2186 | " 2187 | 2188 |
2192 | \' 2193 | 2194 | 2196 | 0x0027 2197 | 2198 | 2200 | APOSTROPHE 2201 | 2202 | 2204 | ' 2205 | 2206 |
2210 | \\ 2211 | 2212 | 2214 | 0x005C 2215 | 2216 | 2218 | REVERSE SOLIDUS 2219 | 2220 | 2222 | \ 2223 | 2224 |
2228 |
2229 | 2267 |
2268 |
2269 | 2270 | 2271 | 2272 | 2273 |

2JSON.parse ( text [ , reviver ] )

2274 |

The parse function parses a JSON text (a JSON-formatted String) and produces an ECMAScript value. The JSON format represents literals, arrays, and objects with a syntax similar to the syntax for ECMAScript literals, Array Initializers, and Object Initializers. After parsing, JSON objects are realized as ECMAScript objects. JSON arrays are realized as ECMAScript Array instances. JSON strings, numbers, booleans, and null are realized as ECMAScript Strings, Numbers, Booleans, and null.

2275 |

The optional reviver parameter is a function that takes two parameters, key and value. It can filter and transform the results. It is called with each of the key/value pairs produced by the parse, and its return value is used instead of the original value. If it returns what it received, the structure is not modified. If it returns undefined then the property is deleted from the result.

2276 |
  1. Let JText be ? ToString(text).
  2. Parse JText interpreted as UTF-16 encoded Unicode points (6.1.4) as a JSON text as specified in ECMA-404. Throw a SyntaxError exception if JText is not a valid JSON text as defined in that specification.
  3. Let scriptText be the result of concatenating "(", JText, and ");".
  4. Let completion be the result of parsing and evaluating scriptText as if it was the source text of an ECMAScript Script, but using the alternative definition of DoubleStringCharacter provided below. The extended PropertyDefinitionEvaluation semantics defined in B.3.1 must not be used during the evaluation.
  5. Let unfiltered be completion.[[Value]].
  6. Assert: unfiltered is either a String, Number, Boolean, Null, or an Object that is defined by either an ArrayLiteral or an ObjectLiteral.
  7. If IsCallable(reviver) is true, then
    1. Let root be ObjectCreate(%ObjectPrototype%).
    2. Let rootName be the empty String.
    3. Let status be CreateDataProperty(root, rootName, unfiltered).
    4. Assert: status is true.
    5. Return ? InternalizeJSONProperty(root, rootName).
  8. Else,
    1. Return unfiltered. 2277 |
2278 |

The length property of the parse function is 2.

2279 | 2280 |

JSON allows Unicode code units 0x2028 (LINE SEPARATOR) and 0x2029 (PARAGRAPH SEPARATOR) to directly appear in String literals without using an escape sequence. This is enabled by using the following alternative definition of DoubleStringCharacter when parsing scriptText in step 4:

2281 | 2282 | DoubleStringCharacter::SourceCharacterbut not one of " or \ or U+0000 through U+001F 2283 | \EscapeSequence 2284 | 2285 | 2293 |
2294 | Note
2295 |

Valid JSON text is a subset of the ECMAScript PrimaryExpression syntax as modified by Step 4 above. Step 2 verifies that JText conforms to that subset, and step 6 verifies that that parsing and evaluation returns a value of an appropriate type.

2296 |
2297 |
2298 |

ACopyright & Software License

2299 | 2300 |

Copyright Notice

2301 |

© 2018 Richard Gibson

2302 | 2303 |

Software License

2304 |

All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.

2305 | 2306 |

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

2307 | 2308 |
    2309 |
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. 2310 |
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. 2311 |
  5. Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.
  6. 2312 |
2313 | 2314 |

THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2315 | 2316 |
2317 |
-------------------------------------------------------------------------------- /missing-productions.json: -------------------------------------------------------------------------------- 1 | { 2 | "https://tc39.github.io/ecma262/": [ 3 | { 4 | "type": "production", 5 | "id": "prod-annexB-LegacyOctalEscapeSequence", 6 | "name": "LegacyOctalEscapeSequence" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ecma262-proposal-json-superset", 3 | "requires": true, 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "@types/node": { 7 | "version": "6.0.85", 8 | "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz", 9 | "integrity": "sha512-6qLZpfQFO/g5Ns2e7RsW6brk0Q6Xzwiw7kVVU/XiQNOiJXSojhX76GP457PBYIsNMH2WfcGgcnZB4awFDHrwpA==", 10 | "dev": true 11 | }, 12 | "abab": { 13 | "version": "1.0.3", 14 | "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", 15 | "integrity": "sha1-uB3l9ydOxOdW15fNg08wNkJyTl0=", 16 | "dev": true 17 | }, 18 | "acorn": { 19 | "version": "4.0.13", 20 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", 21 | "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", 22 | "dev": true 23 | }, 24 | "acorn-globals": { 25 | "version": "3.1.0", 26 | "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", 27 | "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", 28 | "dev": true, 29 | "requires": { 30 | "acorn": "4.0.13" 31 | } 32 | }, 33 | "ajv": { 34 | "version": "4.11.8", 35 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", 36 | "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", 37 | "dev": true, 38 | "requires": { 39 | "co": "4.6.0", 40 | "json-stable-stringify": "1.0.1" 41 | } 42 | }, 43 | "amdefine": { 44 | "version": "1.0.1", 45 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 46 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", 47 | "dev": true, 48 | "optional": true 49 | }, 50 | "ansi-regex": { 51 | "version": "2.1.1", 52 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 53 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 54 | "dev": true 55 | }, 56 | "ansi-styles": { 57 | "version": "2.2.1", 58 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 59 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", 60 | "dev": true 61 | }, 62 | "argparse": { 63 | "version": "1.0.9", 64 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", 65 | "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", 66 | "dev": true, 67 | "requires": { 68 | "sprintf-js": "1.0.3" 69 | } 70 | }, 71 | "array-equal": { 72 | "version": "1.0.0", 73 | "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", 74 | "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", 75 | "dev": true 76 | }, 77 | "asn1": { 78 | "version": "0.2.3", 79 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", 80 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", 81 | "dev": true 82 | }, 83 | "assert-plus": { 84 | "version": "0.2.0", 85 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", 86 | "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", 87 | "dev": true 88 | }, 89 | "asynckit": { 90 | "version": "0.4.0", 91 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 92 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", 93 | "dev": true 94 | }, 95 | "aws-sign2": { 96 | "version": "0.6.0", 97 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", 98 | "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", 99 | "dev": true 100 | }, 101 | "aws4": { 102 | "version": "1.6.0", 103 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", 104 | "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", 105 | "dev": true 106 | }, 107 | "bcrypt-pbkdf": { 108 | "version": "1.0.1", 109 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", 110 | "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", 111 | "dev": true, 112 | "optional": true, 113 | "requires": { 114 | "tweetnacl": "0.14.5" 115 | } 116 | }, 117 | "bluebird": { 118 | "version": "3.5.0", 119 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", 120 | "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", 121 | "dev": true 122 | }, 123 | "boom": { 124 | "version": "2.10.1", 125 | "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", 126 | "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", 127 | "dev": true, 128 | "requires": { 129 | "hoek": "2.16.3" 130 | } 131 | }, 132 | "caseless": { 133 | "version": "0.12.0", 134 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 135 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", 136 | "dev": true 137 | }, 138 | "chalk": { 139 | "version": "1.1.3", 140 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 141 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 142 | "dev": true, 143 | "requires": { 144 | "ansi-styles": "2.2.1", 145 | "escape-string-regexp": "1.0.5", 146 | "has-ansi": "2.0.0", 147 | "strip-ansi": "3.0.1", 148 | "supports-color": "2.0.0" 149 | } 150 | }, 151 | "co": { 152 | "version": "4.6.0", 153 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 154 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", 155 | "dev": true 156 | }, 157 | "combined-stream": { 158 | "version": "1.0.5", 159 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", 160 | "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", 161 | "dev": true, 162 | "requires": { 163 | "delayed-stream": "1.0.0" 164 | } 165 | }, 166 | "content-type-parser": { 167 | "version": "1.0.1", 168 | "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.1.tgz", 169 | "integrity": "sha1-w+VpiMU8ZRJ/tG1AMqOpACRv3JQ=", 170 | "dev": true 171 | }, 172 | "cryptiles": { 173 | "version": "2.0.5", 174 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", 175 | "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", 176 | "dev": true, 177 | "requires": { 178 | "boom": "2.10.1" 179 | } 180 | }, 181 | "cssom": { 182 | "version": "0.3.2", 183 | "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", 184 | "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", 185 | "dev": true 186 | }, 187 | "cssstyle": { 188 | "version": "0.2.37", 189 | "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", 190 | "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", 191 | "dev": true, 192 | "requires": { 193 | "cssom": "0.3.2" 194 | } 195 | }, 196 | "dashdash": { 197 | "version": "1.14.1", 198 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 199 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 200 | "dev": true, 201 | "requires": { 202 | "assert-plus": "1.0.0" 203 | }, 204 | "dependencies": { 205 | "assert-plus": { 206 | "version": "1.0.0", 207 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 208 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 209 | "dev": true 210 | } 211 | } 212 | }, 213 | "deep-is": { 214 | "version": "0.1.3", 215 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 216 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 217 | "dev": true 218 | }, 219 | "delayed-stream": { 220 | "version": "1.0.0", 221 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 222 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 223 | "dev": true 224 | }, 225 | "ecc-jsbn": { 226 | "version": "0.1.1", 227 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", 228 | "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", 229 | "dev": true, 230 | "optional": true, 231 | "requires": { 232 | "jsbn": "0.1.1" 233 | } 234 | }, 235 | "ecmarkdown": { 236 | "version": "3.0.9", 237 | "resolved": "https://registry.npmjs.org/ecmarkdown/-/ecmarkdown-3.0.9.tgz", 238 | "integrity": "sha1-Pl5oc7SO9YRHN8s4jMq9hQYaevE=", 239 | "dev": true, 240 | "requires": { 241 | "escape-html": "1.0.3" 242 | } 243 | }, 244 | "ecmarkup": { 245 | "version": "3.11.5", 246 | "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-3.11.5.tgz", 247 | "integrity": "sha1-Vx3piTmVbHceYeAW9w/VuHr+Gj4=", 248 | "dev": true, 249 | "requires": { 250 | "bluebird": "3.5.0", 251 | "chalk": "1.1.3", 252 | "ecmarkdown": "3.0.9", 253 | "grammarkdown": "1.0.7", 254 | "he": "1.1.1", 255 | "highlight.js": "9.12.0", 256 | "html-escape": "1.0.2", 257 | "js-yaml": "3.9.0", 258 | "jsdom": "11.1.0", 259 | "nomnom": "1.8.1", 260 | "prex": "0.2.0", 261 | "promise-debounce": "1.0.1" 262 | } 263 | }, 264 | "escape-html": { 265 | "version": "1.0.3", 266 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 267 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", 268 | "dev": true 269 | }, 270 | "escape-string-regexp": { 271 | "version": "1.0.5", 272 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 273 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 274 | "dev": true 275 | }, 276 | "escodegen": { 277 | "version": "1.8.1", 278 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", 279 | "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", 280 | "dev": true, 281 | "requires": { 282 | "esprima": "2.7.3", 283 | "estraverse": "1.9.3", 284 | "esutils": "2.0.2", 285 | "optionator": "0.8.2", 286 | "source-map": "0.2.0" 287 | }, 288 | "dependencies": { 289 | "esprima": { 290 | "version": "2.7.3", 291 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", 292 | "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", 293 | "dev": true 294 | } 295 | } 296 | }, 297 | "esprima": { 298 | "version": "4.0.0", 299 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", 300 | "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", 301 | "dev": true 302 | }, 303 | "estraverse": { 304 | "version": "1.9.3", 305 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", 306 | "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", 307 | "dev": true 308 | }, 309 | "esutils": { 310 | "version": "2.0.2", 311 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 312 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 313 | "dev": true 314 | }, 315 | "extend": { 316 | "version": "3.0.1", 317 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", 318 | "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", 319 | "dev": true 320 | }, 321 | "extsprintf": { 322 | "version": "1.0.2", 323 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", 324 | "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", 325 | "dev": true 326 | }, 327 | "fast-levenshtein": { 328 | "version": "2.0.6", 329 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 330 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 331 | "dev": true 332 | }, 333 | "forever-agent": { 334 | "version": "0.6.1", 335 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 336 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", 337 | "dev": true 338 | }, 339 | "form-data": { 340 | "version": "2.1.4", 341 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", 342 | "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", 343 | "dev": true, 344 | "requires": { 345 | "asynckit": "0.4.0", 346 | "combined-stream": "1.0.5", 347 | "mime-types": "2.1.16" 348 | } 349 | }, 350 | "getpass": { 351 | "version": "0.1.7", 352 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 353 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 354 | "dev": true, 355 | "requires": { 356 | "assert-plus": "1.0.0" 357 | }, 358 | "dependencies": { 359 | "assert-plus": { 360 | "version": "1.0.0", 361 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 362 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 363 | "dev": true 364 | } 365 | } 366 | }, 367 | "grammarkdown": { 368 | "version": "1.0.7", 369 | "resolved": "https://registry.npmjs.org/grammarkdown/-/grammarkdown-1.0.7.tgz", 370 | "integrity": "sha1-NxO5ybqk9XDztqyJpH36ALNGWxs=", 371 | "dev": true, 372 | "requires": { 373 | "prex": "0.2.0" 374 | } 375 | }, 376 | "har-schema": { 377 | "version": "1.0.5", 378 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", 379 | "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", 380 | "dev": true 381 | }, 382 | "har-validator": { 383 | "version": "4.2.1", 384 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", 385 | "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", 386 | "dev": true, 387 | "requires": { 388 | "ajv": "4.11.8", 389 | "har-schema": "1.0.5" 390 | } 391 | }, 392 | "has-ansi": { 393 | "version": "2.0.0", 394 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 395 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 396 | "dev": true, 397 | "requires": { 398 | "ansi-regex": "2.1.1" 399 | } 400 | }, 401 | "has-color": { 402 | "version": "0.1.7", 403 | "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", 404 | "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", 405 | "dev": true 406 | }, 407 | "hawk": { 408 | "version": "3.1.3", 409 | "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", 410 | "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", 411 | "dev": true, 412 | "requires": { 413 | "boom": "2.10.1", 414 | "cryptiles": "2.0.5", 415 | "hoek": "2.16.3", 416 | "sntp": "1.0.9" 417 | } 418 | }, 419 | "he": { 420 | "version": "1.1.1", 421 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", 422 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", 423 | "dev": true 424 | }, 425 | "highlight.js": { 426 | "version": "9.12.0", 427 | "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz", 428 | "integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=", 429 | "dev": true 430 | }, 431 | "hoek": { 432 | "version": "2.16.3", 433 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", 434 | "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", 435 | "dev": true 436 | }, 437 | "html-encoding-sniffer": { 438 | "version": "1.0.1", 439 | "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz", 440 | "integrity": "sha1-eb96eF6klf5mFl5zQVPzY/9UN9o=", 441 | "dev": true, 442 | "requires": { 443 | "whatwg-encoding": "1.0.1" 444 | } 445 | }, 446 | "html-escape": { 447 | "version": "1.0.2", 448 | "resolved": "https://registry.npmjs.org/html-escape/-/html-escape-1.0.2.tgz", 449 | "integrity": "sha1-X6eHwFaAkP4zLtWzz0qk9kZCGnQ=", 450 | "dev": true 451 | }, 452 | "http-signature": { 453 | "version": "1.1.1", 454 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", 455 | "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", 456 | "dev": true, 457 | "requires": { 458 | "assert-plus": "0.2.0", 459 | "jsprim": "1.4.0", 460 | "sshpk": "1.13.1" 461 | } 462 | }, 463 | "iconv-lite": { 464 | "version": "0.4.13", 465 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", 466 | "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", 467 | "dev": true 468 | }, 469 | "is-typedarray": { 470 | "version": "1.0.0", 471 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 472 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", 473 | "dev": true 474 | }, 475 | "isstream": { 476 | "version": "0.1.2", 477 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 478 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", 479 | "dev": true 480 | }, 481 | "js-yaml": { 482 | "version": "3.9.0", 483 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.0.tgz", 484 | "integrity": "sha512-0LoUNELX4S+iofCT8f4uEHIiRBR+c2AINyC8qRWfC6QNruLtxVZRJaPcu/xwMgFIgDxF25tGHaDjvxzJCNE9yw==", 485 | "dev": true, 486 | "requires": { 487 | "argparse": "1.0.9", 488 | "esprima": "4.0.0" 489 | } 490 | }, 491 | "jsbn": { 492 | "version": "0.1.1", 493 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 494 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 495 | "dev": true, 496 | "optional": true 497 | }, 498 | "jsdom": { 499 | "version": "11.1.0", 500 | "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.1.0.tgz", 501 | "integrity": "sha512-vKKDU+Xh9O6VgzdOYf5Rmqbgp+Yz4YTBC19gaLtctXch33EmNucA395KJGGboldafPW1vv9XLuiprO4+wXfl0g==", 502 | "dev": true, 503 | "requires": { 504 | "abab": "1.0.3", 505 | "acorn": "4.0.13", 506 | "acorn-globals": "3.1.0", 507 | "array-equal": "1.0.0", 508 | "content-type-parser": "1.0.1", 509 | "cssom": "0.3.2", 510 | "cssstyle": "0.2.37", 511 | "escodegen": "1.8.1", 512 | "html-encoding-sniffer": "1.0.1", 513 | "nwmatcher": "1.4.1", 514 | "parse5": "3.0.2", 515 | "pn": "1.0.0", 516 | "request": "2.81.0", 517 | "request-promise-native": "1.0.4", 518 | "sax": "1.2.4", 519 | "symbol-tree": "3.2.2", 520 | "tough-cookie": "2.3.2", 521 | "webidl-conversions": "4.0.1", 522 | "whatwg-encoding": "1.0.1", 523 | "whatwg-url": "6.1.0", 524 | "xml-name-validator": "2.0.1" 525 | } 526 | }, 527 | "json-schema": { 528 | "version": "0.2.3", 529 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 530 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", 531 | "dev": true 532 | }, 533 | "json-stable-stringify": { 534 | "version": "1.0.1", 535 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", 536 | "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", 537 | "dev": true, 538 | "requires": { 539 | "jsonify": "0.0.0" 540 | } 541 | }, 542 | "json-stringify-safe": { 543 | "version": "5.0.1", 544 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 545 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", 546 | "dev": true 547 | }, 548 | "jsonify": { 549 | "version": "0.0.0", 550 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", 551 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", 552 | "dev": true 553 | }, 554 | "jsprim": { 555 | "version": "1.4.0", 556 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", 557 | "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", 558 | "dev": true, 559 | "requires": { 560 | "assert-plus": "1.0.0", 561 | "extsprintf": "1.0.2", 562 | "json-schema": "0.2.3", 563 | "verror": "1.3.6" 564 | }, 565 | "dependencies": { 566 | "assert-plus": { 567 | "version": "1.0.0", 568 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 569 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 570 | "dev": true 571 | } 572 | } 573 | }, 574 | "levn": { 575 | "version": "0.3.0", 576 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 577 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 578 | "dev": true, 579 | "requires": { 580 | "prelude-ls": "1.1.2", 581 | "type-check": "0.3.2" 582 | } 583 | }, 584 | "lodash": { 585 | "version": "4.17.4", 586 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", 587 | "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", 588 | "dev": true 589 | }, 590 | "lodash.sortby": { 591 | "version": "4.7.0", 592 | "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", 593 | "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", 594 | "dev": true 595 | }, 596 | "mime-db": { 597 | "version": "1.29.0", 598 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", 599 | "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=", 600 | "dev": true 601 | }, 602 | "mime-types": { 603 | "version": "2.1.16", 604 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", 605 | "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", 606 | "dev": true, 607 | "requires": { 608 | "mime-db": "1.29.0" 609 | } 610 | }, 611 | "nomnom": { 612 | "version": "1.8.1", 613 | "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", 614 | "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", 615 | "dev": true, 616 | "requires": { 617 | "chalk": "0.4.0", 618 | "underscore": "1.6.0" 619 | }, 620 | "dependencies": { 621 | "ansi-styles": { 622 | "version": "1.0.0", 623 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", 624 | "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", 625 | "dev": true 626 | }, 627 | "chalk": { 628 | "version": "0.4.0", 629 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", 630 | "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", 631 | "dev": true, 632 | "requires": { 633 | "ansi-styles": "1.0.0", 634 | "has-color": "0.1.7", 635 | "strip-ansi": "0.1.1" 636 | } 637 | }, 638 | "strip-ansi": { 639 | "version": "0.1.1", 640 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", 641 | "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", 642 | "dev": true 643 | } 644 | } 645 | }, 646 | "nwmatcher": { 647 | "version": "1.4.1", 648 | "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.1.tgz", 649 | "integrity": "sha1-eumwew6oBNt+JfBctf5Al9TklJ8=", 650 | "dev": true 651 | }, 652 | "oauth-sign": { 653 | "version": "0.8.2", 654 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", 655 | "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", 656 | "dev": true 657 | }, 658 | "optionator": { 659 | "version": "0.8.2", 660 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 661 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 662 | "dev": true, 663 | "requires": { 664 | "deep-is": "0.1.3", 665 | "fast-levenshtein": "2.0.6", 666 | "levn": "0.3.0", 667 | "prelude-ls": "1.1.2", 668 | "type-check": "0.3.2", 669 | "wordwrap": "1.0.0" 670 | } 671 | }, 672 | "parse5": { 673 | "version": "3.0.2", 674 | "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.2.tgz", 675 | "integrity": "sha1-Be/1fw70V3+xRKefi5qWemzERRA=", 676 | "dev": true, 677 | "requires": { 678 | "@types/node": "6.0.85" 679 | } 680 | }, 681 | "performance-now": { 682 | "version": "0.2.0", 683 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", 684 | "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", 685 | "dev": true 686 | }, 687 | "pn": { 688 | "version": "1.0.0", 689 | "resolved": "https://registry.npmjs.org/pn/-/pn-1.0.0.tgz", 690 | "integrity": "sha1-HPWjCw2AbNGPiPxBprXUrWFbO6k=", 691 | "dev": true 692 | }, 693 | "prelude-ls": { 694 | "version": "1.1.2", 695 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 696 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 697 | "dev": true 698 | }, 699 | "prex": { 700 | "version": "0.2.0", 701 | "resolved": "https://registry.npmjs.org/prex/-/prex-0.2.0.tgz", 702 | "integrity": "sha1-uIwvpNMhgrAcGjN3WjJ0bU4zp8U=", 703 | "dev": true 704 | }, 705 | "promise-debounce": { 706 | "version": "1.0.1", 707 | "resolved": "https://registry.npmjs.org/promise-debounce/-/promise-debounce-1.0.1.tgz", 708 | "integrity": "sha1-btdvj3nQFE/b0BzBVYnOV/nXHng=", 709 | "dev": true 710 | }, 711 | "punycode": { 712 | "version": "1.4.1", 713 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 714 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", 715 | "dev": true 716 | }, 717 | "qs": { 718 | "version": "6.4.0", 719 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", 720 | "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", 721 | "dev": true 722 | }, 723 | "request": { 724 | "version": "2.81.0", 725 | "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", 726 | "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", 727 | "dev": true, 728 | "requires": { 729 | "aws-sign2": "0.6.0", 730 | "aws4": "1.6.0", 731 | "caseless": "0.12.0", 732 | "combined-stream": "1.0.5", 733 | "extend": "3.0.1", 734 | "forever-agent": "0.6.1", 735 | "form-data": "2.1.4", 736 | "har-validator": "4.2.1", 737 | "hawk": "3.1.3", 738 | "http-signature": "1.1.1", 739 | "is-typedarray": "1.0.0", 740 | "isstream": "0.1.2", 741 | "json-stringify-safe": "5.0.1", 742 | "mime-types": "2.1.16", 743 | "oauth-sign": "0.8.2", 744 | "performance-now": "0.2.0", 745 | "qs": "6.4.0", 746 | "safe-buffer": "5.1.1", 747 | "stringstream": "0.0.5", 748 | "tough-cookie": "2.3.2", 749 | "tunnel-agent": "0.6.0", 750 | "uuid": "3.1.0" 751 | } 752 | }, 753 | "request-promise-core": { 754 | "version": "1.1.1", 755 | "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", 756 | "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", 757 | "dev": true, 758 | "requires": { 759 | "lodash": "4.17.4" 760 | } 761 | }, 762 | "request-promise-native": { 763 | "version": "1.0.4", 764 | "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.4.tgz", 765 | "integrity": "sha1-hpiOyO7kCORVefzoO/0Fs635oVU=", 766 | "dev": true, 767 | "requires": { 768 | "request-promise-core": "1.1.1", 769 | "stealthy-require": "1.1.1", 770 | "tough-cookie": "2.3.2" 771 | } 772 | }, 773 | "safe-buffer": { 774 | "version": "5.1.1", 775 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 776 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", 777 | "dev": true 778 | }, 779 | "sax": { 780 | "version": "1.2.4", 781 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 782 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", 783 | "dev": true 784 | }, 785 | "sntp": { 786 | "version": "1.0.9", 787 | "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", 788 | "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", 789 | "dev": true, 790 | "requires": { 791 | "hoek": "2.16.3" 792 | } 793 | }, 794 | "source-map": { 795 | "version": "0.2.0", 796 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", 797 | "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", 798 | "dev": true, 799 | "optional": true, 800 | "requires": { 801 | "amdefine": "1.0.1" 802 | } 803 | }, 804 | "sprintf-js": { 805 | "version": "1.0.3", 806 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 807 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 808 | "dev": true 809 | }, 810 | "sshpk": { 811 | "version": "1.13.1", 812 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", 813 | "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", 814 | "dev": true, 815 | "requires": { 816 | "asn1": "0.2.3", 817 | "assert-plus": "1.0.0", 818 | "bcrypt-pbkdf": "1.0.1", 819 | "dashdash": "1.14.1", 820 | "ecc-jsbn": "0.1.1", 821 | "getpass": "0.1.7", 822 | "jsbn": "0.1.1", 823 | "tweetnacl": "0.14.5" 824 | }, 825 | "dependencies": { 826 | "assert-plus": { 827 | "version": "1.0.0", 828 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 829 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 830 | "dev": true 831 | } 832 | } 833 | }, 834 | "stealthy-require": { 835 | "version": "1.1.1", 836 | "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", 837 | "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", 838 | "dev": true 839 | }, 840 | "stringstream": { 841 | "version": "0.0.5", 842 | "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", 843 | "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", 844 | "dev": true 845 | }, 846 | "strip-ansi": { 847 | "version": "3.0.1", 848 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 849 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 850 | "dev": true, 851 | "requires": { 852 | "ansi-regex": "2.1.1" 853 | } 854 | }, 855 | "supports-color": { 856 | "version": "2.0.0", 857 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 858 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", 859 | "dev": true 860 | }, 861 | "symbol-tree": { 862 | "version": "3.2.2", 863 | "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", 864 | "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", 865 | "dev": true 866 | }, 867 | "tough-cookie": { 868 | "version": "2.3.2", 869 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", 870 | "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", 871 | "dev": true, 872 | "requires": { 873 | "punycode": "1.4.1" 874 | } 875 | }, 876 | "tr46": { 877 | "version": "0.0.3", 878 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 879 | "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", 880 | "dev": true 881 | }, 882 | "tunnel-agent": { 883 | "version": "0.6.0", 884 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 885 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 886 | "dev": true, 887 | "requires": { 888 | "safe-buffer": "5.1.1" 889 | } 890 | }, 891 | "tweetnacl": { 892 | "version": "0.14.5", 893 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 894 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 895 | "dev": true, 896 | "optional": true 897 | }, 898 | "type-check": { 899 | "version": "0.3.2", 900 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 901 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 902 | "dev": true, 903 | "requires": { 904 | "prelude-ls": "1.1.2" 905 | } 906 | }, 907 | "underscore": { 908 | "version": "1.6.0", 909 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", 910 | "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", 911 | "dev": true 912 | }, 913 | "uuid": { 914 | "version": "3.1.0", 915 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", 916 | "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", 917 | "dev": true 918 | }, 919 | "verror": { 920 | "version": "1.3.6", 921 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", 922 | "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", 923 | "dev": true, 924 | "requires": { 925 | "extsprintf": "1.0.2" 926 | } 927 | }, 928 | "webidl-conversions": { 929 | "version": "4.0.1", 930 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.1.tgz", 931 | "integrity": "sha1-gBWherg+fhsxFjhIas6B2mziBqA=", 932 | "dev": true 933 | }, 934 | "whatwg-encoding": { 935 | "version": "1.0.1", 936 | "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz", 937 | "integrity": "sha1-PGxFGhmO567FWx7GHQkgxngBpfQ=", 938 | "dev": true, 939 | "requires": { 940 | "iconv-lite": "0.4.13" 941 | } 942 | }, 943 | "whatwg-url": { 944 | "version": "6.1.0", 945 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.1.0.tgz", 946 | "integrity": "sha1-X8gnm5PXVIO5ztiyYjmFSEehhXg=", 947 | "dev": true, 948 | "requires": { 949 | "lodash.sortby": "4.7.0", 950 | "tr46": "0.0.3", 951 | "webidl-conversions": "4.0.1" 952 | } 953 | }, 954 | "wordwrap": { 955 | "version": "1.0.0", 956 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 957 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 958 | "dev": true 959 | }, 960 | "xml-name-validator": { 961 | "version": "2.0.1", 962 | "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", 963 | "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", 964 | "dev": true 965 | } 966 | } 967 | } 968 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "ecmarkup": "^3.0.0", 5 | "@alrra/travis-scripts": "^3.0.1" 6 | }, 7 | "scripts": { 8 | "test": "exit 0", 9 | "build": "ecmarkup spec.emu docs/index.html" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spec.emu: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
  5 | title: Subsume JSON
  6 | status: proposal
  7 | stage: 4
  8 | shortname: <a href="https://github.com/tc39/proposal-json-superset">proposal-json-superset</a>
  9 | contributors: Richard Gibson
 10 | 
11 | 12 | 13 | 14 | 15 | 16 |

String Literals

17 | 18 |

A string literal is zero or more Unicode code points enclosed in single or double quotes. Unicode code points may also be represented by an escape sequence. All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), U+2028 (LINE SEPARATOR), U+2029 (PARAGRAPH SEPARATOR), and U+000A (LINE FEED). Any code points may appear in the form of an escape sequence. String literals evaluate to ECMAScript String values. When generating these String values Unicode code points are UTF-16 encoded as defined in . Code points belonging to the Basic Multilingual Plane are encoded as a single code unit element of the string. All other code points are encoded as two code unit elements of the string.

19 |
20 |

Syntax

21 | 22 | StringLiteral :: 23 | `"` DoubleStringCharacters? `"` 24 | `'` SingleStringCharacters? `'` 25 | 26 | DoubleStringCharacters :: 27 | DoubleStringCharacter DoubleStringCharacters? 28 | 29 | SingleStringCharacters :: 30 | SingleStringCharacter SingleStringCharacters? 31 | 32 | DoubleStringCharacter :: 33 | SourceCharacter but not one of `"` or `\` or LineTerminator 34 | <LS> 35 | <PS> 36 | `\` EscapeSequence 37 | LineContinuation 38 | 39 | SingleStringCharacter :: 40 | SourceCharacter but not one of `'` or `\` or LineTerminator 41 | <LS> 42 | <PS> 43 | `\` EscapeSequence 44 | LineContinuation 45 | 46 | LineContinuation :: 47 | `\` LineTerminatorSequence 48 | 49 | EscapeSequence :: 50 | CharacterEscapeSequence 51 | `0` [lookahead <! DecimalDigit] 52 | HexEscapeSequence 53 | UnicodeEscapeSequence 54 | 55 |

A conforming implementation, when processing strict mode code, must not extend the syntax of |EscapeSequence| to include as described in .

56 | 57 | CharacterEscapeSequence :: 58 | SingleEscapeCharacter 59 | NonEscapeCharacter 60 | 61 | SingleEscapeCharacter :: one of 62 | `'` `"` `\` `b` `f` `n` `r` `t` `v` 63 | 64 | NonEscapeCharacter :: 65 | SourceCharacter but not one of EscapeCharacter or LineTerminator 66 | 67 | EscapeCharacter :: 68 | SingleEscapeCharacter 69 | DecimalDigit 70 | `x` 71 | `u` 72 | 73 | HexEscapeSequence :: 74 | `x` HexDigit HexDigit 75 | 76 | UnicodeEscapeSequence :: 77 | `u` Hex4Digits 78 | `u{` HexDigits `}` 79 | 80 | Hex4Digits :: 81 | HexDigit HexDigit HexDigit HexDigit 82 | 83 |

The definition of the nonterminal |HexDigit| is given in . |SourceCharacter| is defined in .

84 | 85 |

A line terminator code point<LF> and <CR> cannot appear in a string literal, except as part of a |LineContinuation| to produce the empty code points sequence. The proper way to cause a line terminator code point to be part ofinclude either in the String value of a string literal is to use an escape sequence such as `\\n` or `\\u000A`.

86 |
87 | 88 | 89 | 90 |

Static Semantics: Early Errors

91 | UnicodeEscapeSequence :: `u{` HexDigits `}` 92 |
    93 |
  • 94 | It is a Syntax Error if the MV of |HexDigits| > 0x10FFFF. 95 |
  • 96 |
97 |
98 | 99 | 100 | 101 |

Static Semantics: StringValue

102 | 103 | 104 | StringLiteral :: 105 | `"` DoubleStringCharacters? `"` 106 | `'` SingleStringCharacters? `'` 107 | 108 | 109 | 1. Return the String value whose elements are the SV of this |StringLiteral|. 110 | 111 |
112 | 113 | 114 | 115 |

Static Semantics: SV

116 |

A string literal stands for a value of the String type. The String value (SV) of the literal is described in terms of code unit values contributed by the various parts of the string literal. As part of this process, some Unicode code points within the string literal are interpreted as having a mathematical value (MV), as described below or in .

117 |
    118 |
  • 119 | The SV of StringLiteral :: `"` `"` is the empty code unit sequence. 120 |
  • 121 |
  • 122 | The SV of StringLiteral :: `'` `'` is the empty code unit sequence. 123 |
  • 124 |
  • 125 | The SV of StringLiteral :: `"` DoubleStringCharacters `"` is the SV of |DoubleStringCharacters|. 126 |
  • 127 |
  • 128 | The SV of StringLiteral :: `'` SingleStringCharacters `'` is the SV of |SingleStringCharacters|. 129 |
  • 130 |
  • 131 | The SV of DoubleStringCharacters :: DoubleStringCharacter is a sequence of one or two code units that is the SV of |DoubleStringCharacter|. 132 |
  • 133 |
  • 134 | The SV of DoubleStringCharacters :: DoubleStringCharacter DoubleStringCharacters is a sequence of one or two code units that is the SV of |DoubleStringCharacter| followed by all the code units in the SV of |DoubleStringCharacters| in order. 135 |
  • 136 |
  • 137 | The SV of SingleStringCharacters :: SingleStringCharacter is a sequence of one or two code units that is the SV of |SingleStringCharacter|. 138 |
  • 139 |
  • 140 | The SV of SingleStringCharacters :: SingleStringCharacter SingleStringCharacters is a sequence of one or two code units that is the SV of |SingleStringCharacter| followed by all the code units in the SV of |SingleStringCharacters| in order. 141 |
  • 142 |
  • 143 | The SV of DoubleStringCharacter :: SourceCharacter but not one of `"` or `\` or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. 144 |
  • 145 | 146 |
  • 147 | The SV of DoubleStringCharacter :: <LS> is the code unit value 0x2028. 148 |
  • 149 |
  • 150 | The SV of DoubleStringCharacter :: <PS> is the code unit value 0x2029. 151 |
  • 152 |
    153 |
  • 154 | The SV of DoubleStringCharacter :: `\` EscapeSequence is the SV of the |EscapeSequence|. 155 |
  • 156 |
  • 157 | The SV of DoubleStringCharacter :: LineContinuation is the empty code unit sequence. 158 |
  • 159 |
  • 160 | The SV of SingleStringCharacter :: SourceCharacter but not one of `'` or `\` or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. 161 |
  • 162 | 163 |
  • 164 | The SV of SingleStringCharacter :: <LS> is the code unit value 0x2028. 165 |
  • 166 |
  • 167 | The SV of SingleStringCharacter :: <PS> is the code unit value 0x2029. 168 |
  • 169 |
    170 |
  • 171 | The SV of SingleStringCharacter :: `\` EscapeSequence is the SV of the |EscapeSequence|. 172 |
  • 173 |
  • 174 | The SV of SingleStringCharacter :: LineContinuation is the empty code unit sequence. 175 |
  • 176 |
  • 177 | The SV of EscapeSequence :: CharacterEscapeSequence is the SV of the |CharacterEscapeSequence|. 178 |
  • 179 |
  • 180 | The SV of EscapeSequence :: `0` is the code unit value 0. 181 |
  • 182 |
  • 183 | The SV of EscapeSequence :: HexEscapeSequence is the SV of the |HexEscapeSequence|. 184 |
  • 185 |
  • 186 | The SV of EscapeSequence :: UnicodeEscapeSequence is the SV of the |UnicodeEscapeSequence|. 187 |
  • 188 |
  • 189 | The SV of CharacterEscapeSequence :: SingleEscapeCharacter is the code unit whose value is determined by the |SingleEscapeCharacter| according to . 190 |
  • 191 |
192 | 193 | 194 | 195 | 196 | 199 | 202 | 205 | 208 | 209 | 210 | 213 | 216 | 219 | 222 | 223 | 224 | 227 | 230 | 233 | 236 | 237 | 238 | 241 | 244 | 247 | 250 | 251 | 252 | 255 | 258 | 261 | 264 | 265 | 266 | 269 | 272 | 275 | 278 | 279 | 280 | 283 | 286 | 289 | 292 | 293 | 294 | 297 | 300 | 303 | 306 | 307 | 308 | 311 | 314 | 317 | 320 | 321 | 322 | 325 | 328 | 331 | 334 | 335 | 336 |
197 | Escape Sequence 198 | 200 | Code Unit Value 201 | 203 | Unicode Character Name 204 | 206 | Symbol 207 |
211 | `\\b` 212 | 214 | `0x0008` 215 | 217 | BACKSPACE 218 | 220 | <BS> 221 |
225 | `\\t` 226 | 228 | `0x0009` 229 | 231 | CHARACTER TABULATION 232 | 234 | <HT> 235 |
239 | `\\n` 240 | 242 | `0x000A` 243 | 245 | LINE FEED (LF) 246 | 248 | <LF> 249 |
253 | `\\v` 254 | 256 | `0x000B` 257 | 259 | LINE TABULATION 260 | 262 | <VT> 263 |
267 | `\\f` 268 | 270 | `0x000C` 271 | 273 | FORM FEED (FF) 274 | 276 | <FF> 277 |
281 | `\\r` 282 | 284 | `0x000D` 285 | 287 | CARRIAGE RETURN (CR) 288 | 290 | <CR> 291 |
295 | `\\"` 296 | 298 | `0x0022` 299 | 301 | QUOTATION MARK 302 | 304 | `"` 305 |
309 | `\\'` 310 | 312 | `0x0027` 313 | 315 | APOSTROPHE 316 | 318 | `'` 319 |
323 | `\\\\` 324 | 326 | `0x005C` 327 | 329 | REVERSE SOLIDUS 330 | 332 | `\\` 333 |
337 |
338 |
    339 |
  • 340 | The SV of CharacterEscapeSequence :: NonEscapeCharacter is the SV of the |NonEscapeCharacter|. 341 |
  • 342 |
  • 343 | The SV of NonEscapeCharacter :: SourceCharacter but not one of EscapeCharacter or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. 344 |
  • 345 |
  • 346 | The SV of HexEscapeSequence :: `x` HexDigit HexDigit is the code unit value that is (16 times the MV of the first |HexDigit|) plus the MV of the second |HexDigit|. 347 |
  • 348 |
  • 349 | The SV of UnicodeEscapeSequence :: `u` Hex4Digits is the SV of |Hex4Digits|. 350 |
  • 351 |
  • 352 | The SV of Hex4Digits :: HexDigit HexDigit HexDigit HexDigit is the code unit value that is (0x1000 times the MV of the first |HexDigit|) plus (0x100 times the MV of the second |HexDigit|) plus (0x10 times the MV of the third |HexDigit|) plus the MV of the fourth |HexDigit|. 353 |
  • 354 |
  • 355 | The SV of UnicodeEscapeSequence :: `u{` HexDigits `}` is the UTF16Encoding of the MV of |HexDigits|. 356 |
  • 357 |
358 |
359 |
360 | 361 | 362 | 363 | 364 |

JSON.parse ( _text_ [ , _reviver_ ] )

365 |

The `parse` function parses a JSON text (a JSON-formatted String) and produces an ECMAScript value. The JSON format represents literals, arrays, and objects with a syntax similar to the syntax for ECMAScript literals, Array Initializers, and Object Initializers. After parsing, JSON objects are realized as ECMAScript objects. JSON arrays are realized as ECMAScript Array instances. JSON strings, numbers, booleans, and null are realized as ECMAScript Strings, Numbers, Booleans, and *null*.

366 |

The optional _reviver_ parameter is a function that takes two parameters, _key_ and _value_. It can filter and transform the results. It is called with each of the _key_/_value_ pairs produced by the parse, and its return value is used instead of the original value. If it returns what it received, the structure is not modified. If it returns *undefined* then the property is deleted from the result.

367 | 368 | 1. Let _JText_ be ? ToString(_text_). 369 | 1. Parse _JText_ interpreted as UTF-16 encoded Unicode points () as a JSON text as specified in ECMA-404. Throw a *SyntaxError* exception if _JText_ is not a valid JSON text as defined in that specification. 370 | 1. Let _scriptText_ be the result of concatenating `"("`, _JText_, and `");"`. 371 | 1. Let _completion_ be the result of parsing and evaluating _scriptText_ as if it was the source text of an ECMAScript |Script|, but using the alternative definition of |DoubleStringCharacter| provided below. The extended PropertyDefinitionEvaluation semantics defined in must not be used during the evaluation. 372 | 1. Let _unfiltered_ be _completion_.[[Value]]. 373 | 1. Assert: _unfiltered_ is either a String, Number, Boolean, Null, or an Object that is defined by either an |ArrayLiteral| or an |ObjectLiteral|. 374 | 1. If IsCallable(_reviver_) is *true*, then 375 | 1. Let _root_ be ObjectCreate(%ObjectPrototype%). 376 | 1. Let _rootName_ be the empty String. 377 | 1. Let _status_ be CreateDataProperty(_root_, _rootName_, _unfiltered_). 378 | 1. Assert: _status_ is *true*. 379 | 1. Return ? InternalizeJSONProperty(_root_, _rootName_). 380 | 1. Else, 381 | 1. Return _unfiltered_. 382 | 383 |

The `length` property of the `parse` function is 2.

384 | 385 |

JSON allows Unicode code units 0x2028 (LINE SEPARATOR) and 0x2029 (PARAGRAPH SEPARATOR) to directly appear in String literals without using an escape sequence. This is enabled by using the following alternative definition of |DoubleStringCharacter| when parsing _scriptText_ in step 4:

386 | 387 | DoubleStringCharacter :: 388 | SourceCharacter but not one of `"` or `\` or U+0000 through U+001F 389 | `\` EscapeSequence 390 | 391 |
    392 |
  • 393 | The SV of DoubleStringCharacter :: SourceCharacter but not one of `"` or `\` or U+0000 through U+001F is the UTF16Encoding of the code point value of |SourceCharacter|. 394 |
  • 395 |
396 |
397 | 398 |

Valid JSON text is a subset of the ECMAScript |PrimaryExpression| syntax as modified by Step 4 above. Step 2 verifies that _JText_ conforms to that subset, and step 6 verifies that that parsing and evaluation returns a value of an appropriate type.

399 |
400 |
401 | --------------------------------------------------------------------------------