1 ### Version 4.0.0 (2018-01-28) ###
3 - Added: Support for ES2018. The only change needed was recognizing the `s`
5 - Changed: _All_ tokens returned by the `matchToToken` function now have a
6 `closed` property. It is set to `undefined` for the tokens where “closed”
7 doesn’t make sense. This means that all tokens objects have the same shape,
8 which might improve performance.
10 These are the breaking changes:
12 - `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but
13 `['/a/s']`. (There are of course other variations of this.)
14 - Code that rely on some token objects not having the `closed` property could
15 now behave differently.
18 ### Version 3.0.2 (2017-06-28) ###
20 - No code changes. Just updates to the readme.
23 ### Version 3.0.1 (2017-01-30) ###
25 - Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched
29 ### Version 3.0.0 (2017-01-11) ###
31 This release contains one breaking change, that should [improve performance in
34 > So how can you, as a JavaScript developer, ensure that your RegExps are fast?
35 > If you are not interested in hooking into RegExp internals, make sure that
36 > neither the RegExp instance, nor its prototype is modified in order to get the
41 > re.exec(''); // Fast path.
42 > re.new_property = 'slow';
45 This module used to export a single regex, with `.matchToToken` bolted
46 on, just like in the above example. This release changes the exports of
47 the module to avoid this issue.
52 import jsTokens from "js-tokens"
54 var jsTokens = require("js-tokens")
55 var matchToToken = jsTokens.matchToToken
61 import jsTokens, {matchToToken} from "js-tokens"
63 var jsTokens = require("js-tokens").default
64 var matchToToken = require("js-tokens").matchToToken
67 [v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html
70 ### Version 2.0.0 (2016-06-19) ###
72 - Added: Support for ES2016. In other words, support for the `**` exponentiation
75 These are the breaking changes:
77 - `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`.
78 - `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`.
81 ### Version 1.0.3 (2016-03-27) ###
83 - Improved: Made the regex ever so slightly smaller.
84 - Updated: The readme.
87 ### Version 1.0.2 (2015-10-18) ###
89 - Improved: Limited npm package contents for a smaller download. Thanks to
93 ### Version 1.0.1 (2015-06-20) ###
95 - Fixed: Declared an undeclared variable.
98 ### Version 1.0.0 (2015-02-26) ###
100 - Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That
101 type is now equivalent to the Punctuator token in the ECMAScript
102 specification. (Backwards-incompatible change.)
103 - Fixed: A `-` followed by a number is now correctly matched as a punctuator
104 followed by a number. It used to be matched as just a number, but there is no
105 such thing as negative number literals. (Possibly backwards-incompatible
109 ### Version 0.4.1 (2015-02-21) ###
111 - Added: Support for the regex `u` flag.
114 ### Version 0.4.0 (2015-02-21) ###
116 - Improved: `jsTokens.matchToToken` performance.
117 - Added: Support for octal and binary number literals.
118 - Added: Support for template strings.
121 ### Version 0.3.1 (2015-01-06) ###
123 - Fixed: Support for unicode spaces. They used to be allowed in names (which is
124 very confusing), and some unicode newlines were wrongly allowed in strings and
128 ### Version 0.3.0 (2014-12-19) ###
130 - Changed: The `jsTokens.names` array has been replaced with the
131 `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no
132 longer part of the public API; instead use said function. See this [gist] for
133 an example. (Backwards-incompatible change.)
134 - Changed: The empty string is now considered an “invalid” token, instead an
135 “empty” token (its own group). (Backwards-incompatible change.)
136 - Removed: component support. (Backwards-incompatible change.)
138 [gist]: https://gist.github.com/lydell/be49dbf80c382c473004
141 ### Version 0.2.0 (2014-06-19) ###
143 - Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own
144 category (“functionArrow”), for simplicity. (Backwards-incompatible change.)
145 - Added: ES6 splats (`...`) are now matched as an operator (instead of three
146 punctuations). (Backwards-incompatible change.)
149 ### Version 0.1.0 (2014-03-08) ###