项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. ### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]]
  2. [c0.5.1]: https://github.com/aseemk/json5/tree/v0.5.1
  3. [d0.5.1]: https://github.com/aseemk/json5/compare/v0.5.0...v0.5.1
  4. This release includes a minor fix for indentations when stringifying empty
  5. arrays.
  6. - Fix: Indents no longer appear in empty arrays when stringified. ([#134])
  7. ### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]]
  8. [c0.5.0]: https://github.com/aseemk/json5/tree/v0.5.0
  9. [d0.5.0]: https://github.com/aseemk/json5/compare/v0.4.0...v0.5.0
  10. This release includes major internal changes and public API enhancements.
  11. - **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for
  12. Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12
  13. remain.
  14. - Fix: YUI Compressor no longer fails when compressing json5.js. ([#97])
  15. - New: `parse` and the CLI provide line and column numbers when displaying error
  16. messages. ([#101]; awesome work by [@amb26].)
  17. ### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]]
  18. [c0.4.0]: https://github.com/aseemk/json5/tree/v0.4.0
  19. [d0.4.0]: https://github.com/aseemk/json5/compare/v0.2.0...v0.4.0
  20. Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0
  21. changelog entry includes v0.3.0 features.
  22. This is a massive release that adds `stringify` support, among other things.
  23. - **Major:** `JSON5.stringify()` now exists!
  24. This method is analogous to the native `JSON.stringify()`;
  25. it just avoids quoting keys where possible.
  26. See the [usage documentation](./README.md#usage) for more.
  27. ([#32]; huge thanks and props [@aeisenberg]!)
  28. - New: `NaN` and `-NaN` are now allowed number literals.
  29. ([#30]; thanks [@rowanhill].)
  30. - New: Duplicate object keys are now allowed; the last value is used.
  31. This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].)
  32. - Fix: Properly handle various whitespace and newline cases now.
  33. E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings,
  34. and JSON5 now accepts the same whitespace as JSON (stricter than ES5).
  35. ([#58], [#60], and [#63]; thanks [@jordanbtucker].)
  36. - New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again.
  37. (They were disallowed in v0.2.0; see below.)
  38. It turns out they *are* valid in ES5, so JSON5 supports them now too.
  39. ([#36]; thanks [@jordanbtucker]!)
  40. ### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]]
  41. [c0.2.0]: https://github.com/aseemk/json5/tree/v0.2.0
  42. [d0.2.0]: https://github.com/aseemk/json5/compare/v0.1.0...v0.2.0
  43. This release fixes some bugs and adds some more utility features to help you
  44. express data more easily:
  45. - **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now.
  46. While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid
  47. in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome
  48. and Node), so JSON5 officially rejects them now, too. ([#36])
  49. - New: Trailing decimal points in decimal numbers are allowed again.
  50. (They were disallowed in v0.1.0; see below.)
  51. They're allowed by ES5, and differentiating between integers and floats may
  52. make sense on some platforms. ([#16]; thanks [@Midar].)
  53. - New: `Infinity` and `-Infinity` are now allowed number literals.
  54. ([#30]; thanks [@pepkin88].)
  55. - New: Plus signs (`+`) in front of numbers are now allowed, since it can
  56. be helpful in some contexts to explicitly mark numbers as positive.
  57. (E.g. when a property represents changes or deltas.)
  58. - Fix: unescaped newlines in strings are rejected now.
  59. ([#24]; thanks [@Midar].)
  60. ### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]]
  61. [c0.1.0]: https://github.com/aseemk/json5/tree/v0.1.0
  62. [d0.1.0]: https://github.com/aseemk/json5/compare/v0.0.1...v0.1.0
  63. This release tightens JSON5 support and adds helpful utility features:
  64. - New: Support hexadecimal numbers. (Thanks [@MaxNanasy].)
  65. - Fix: Reject octal numbers properly now. Previously, they were accepted but
  66. improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].)
  67. - **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a
  68. leading zero). These are disallowed by both JSON5 and JSON, as well as by
  69. ES5's strict mode. (Thanks [@MaxNanasy].)
  70. - New: Support leading decimal points in decimal numbers.
  71. (Thanks [@MaxNanasy].)
  72. - **Breaking:** Reject trailing decimal points in decimal numbers now. These
  73. are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].)
  74. - **Breaking:** Reject omitted elements in arrays now. These are disallowed by
  75. both JSON5 and JSON.
  76. - Fix: Throw proper `SyntaxError` instances on errors now.
  77. - New: Add Node.js `require()` hook. Register via `json5/lib/require`.
  78. - New: Add Node.js `json5` executable to compile JSON5 files to JSON.
  79. ### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]]
  80. [c0.0.1]: https://github.com/aseemk/json5/tree/v0.0.1
  81. [d0.0.1]: https://github.com/aseemk/json5/compare/v0.0.0...v0.0.1
  82. This was the first implementation of this JSON5 parser.
  83. - Support unquoted object keys, including reserved words. Unicode characters
  84. and escape sequences sequences aren't yet supported.
  85. - Support single-quoted strings.
  86. - Support multi-line strings.
  87. - Support trailing commas in arrays and objects.
  88. - Support comments, both inline and block.
  89. ### v0.0.0 [[code](https://github.com/aseemk/json5/tree/v0.0.0)]
  90. Let's consider this to be Douglas Crockford's original [json_parse.js] — a
  91. parser for the regular JSON format.
  92. [json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
  93. [v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240
  94. [@MaxNanasy]: https://github.com/MaxNanasy
  95. [@Midar]: https://github.com/Midar
  96. [@pepkin88]: https://github.com/pepkin88
  97. [@rowanhill]: https://github.com/rowanhill
  98. [@aeisenberg]: https://github.com/aeisenberg
  99. [@jordanbtucker]: https://github.com/jordanbtucker
  100. [@amb26]: https://github.com/amb26
  101. [#16]: https://github.com/aseemk/json5/issues/16
  102. [#24]: https://github.com/aseemk/json5/issues/24
  103. [#30]: https://github.com/aseemk/json5/issues/30
  104. [#32]: https://github.com/aseemk/json5/issues/32
  105. [#36]: https://github.com/aseemk/json5/issues/36
  106. [#57]: https://github.com/aseemk/json5/issues/57
  107. [#58]: https://github.com/aseemk/json5/pull/58
  108. [#60]: https://github.com/aseemk/json5/pull/60
  109. [#63]: https://github.com/aseemk/json5/pull/63
  110. [#97]: https://github.com/aseemk/json5/pull/97
  111. [#101]: https://github.com/aseemk/json5/pull/101