e28e1ebffaa3bf3f2374868f53e632684425c27ea8f87d1ee38262e588c2a00fc259478e37a4dafa102b0c1ae9b5669830187ab10f3a088da762350827c733 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ### Version 3.0.2 (2017-06-28) ###
  2. - No code changes. Just updates to the readme.
  3. ### Version 3.0.1 (2017-01-30) ###
  4. - Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched
  5. correctly.
  6. ### Version 3.0.0 (2017-01-11) ###
  7. This release contains one breaking change, that should [improve performance in
  8. V8][v8-perf]:
  9. > So how can you, as a JavaScript developer, ensure that your RegExps are fast?
  10. > If you are not interested in hooking into RegExp internals, make sure that
  11. > neither the RegExp instance, nor its prototype is modified in order to get the
  12. > best performance:
  13. >
  14. > ```js
  15. > var re = /./g;
  16. > re.exec(''); // Fast path.
  17. > re.new_property = 'slow';
  18. > ```
  19. This module used to export a single regex, with `.matchToToken` bolted
  20. on, just like in the above example. This release changes the exports of
  21. the module to avoid this issue.
  22. Before:
  23. ```js
  24. import jsTokens from "js-tokens"
  25. // or:
  26. var jsTokens = require("js-tokens")
  27. var matchToToken = jsTokens.matchToToken
  28. ```
  29. After:
  30. ```js
  31. import jsTokens, {matchToToken} from "js-tokens"
  32. // or:
  33. var jsTokens = require("js-tokens").default
  34. var matchToToken = require("js-tokens").matchToToken
  35. ```
  36. [v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html
  37. ### Version 2.0.0 (2016-06-19) ###
  38. - Added: Support for ES2016. In other words, support for the `**` exponentiation
  39. operator.
  40. These are the breaking changes:
  41. - `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`.
  42. - `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`.
  43. ### Version 1.0.3 (2016-03-27) ###
  44. - Improved: Made the regex ever so slightly smaller.
  45. - Updated: The readme.
  46. ### Version 1.0.2 (2015-10-18) ###
  47. - Improved: Limited npm package contents for a smaller download. Thanks to
  48. @zertosh!
  49. ### Version 1.0.1 (2015-06-20) ###
  50. - Fixed: Declared an undeclared variable.
  51. ### Version 1.0.0 (2015-02-26) ###
  52. - Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That
  53. type is now equivalent to the Punctuator token in the ECMAScript
  54. specification. (Backwards-incompatible change.)
  55. - Fixed: A `-` followed by a number is now correctly matched as a punctuator
  56. followed by a number. It used to be matched as just a number, but there is no
  57. such thing as negative number literals. (Possibly backwards-incompatible
  58. change.)
  59. ### Version 0.4.1 (2015-02-21) ###
  60. - Added: Support for the regex `u` flag.
  61. ### Version 0.4.0 (2015-02-21) ###
  62. - Improved: `jsTokens.matchToToken` performance.
  63. - Added: Support for octal and binary number literals.
  64. - Added: Support for template strings.
  65. ### Version 0.3.1 (2015-01-06) ###
  66. - Fixed: Support for unicode spaces. They used to be allowed in names (which is
  67. very confusing), and some unicode newlines were wrongly allowed in strings and
  68. regexes.
  69. ### Version 0.3.0 (2014-12-19) ###
  70. - Changed: The `jsTokens.names` array has been replaced with the
  71. `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no
  72. longer part of the public API; instead use said function. See this [gist] for
  73. an example. (Backwards-incompatible change.)
  74. - Changed: The empty string is now considered an “invalid” token, instead an
  75. “empty” token (its own group). (Backwards-incompatible change.)
  76. - Removed: component support. (Backwards-incompatible change.)
  77. [gist]: https://gist.github.com/lydell/be49dbf80c382c473004
  78. ### Version 0.2.0 (2014-06-19) ###
  79. - Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own
  80. category (“functionArrow”), for simplicity. (Backwards-incompatible change.)
  81. - Added: ES6 splats (`...`) are now matched as an operator (instead of three
  82. punctuations). (Backwards-incompatible change.)
  83. ### Version 0.1.0 (2014-03-08) ###
  84. - Initial release.