Changelog
Version 3.0.1 (2017-01-30)
Changelog
Version 3.0.0 (2017-01-11)
This release contains one breaking change, that should [improve performance in V8][v8-perf]:
So how can you, as a JavaScript developer, ensure that your RegExps are fast? If you are not interested in hooking into RegExp internals, make sure that neither the RegExp instance, nor its prototype is modified in order to get the best performance:
var re = /./g; re.exec(""); // Fast path. re.new_property = "slow";
This module used to export a single regex, with .matchToToken
bolted on, just like in the above example. This release changes the exports of the module to avoid this issue.
Before:
import jsTokens from "js-tokens";
// or:
var jsTokens = require("js-tokens");
var matchToToken = jsTokens.matchToToken;
After:
import jsTokens, { matchToToken } from "js-tokens";
// or:
var jsTokens = require("js-tokens").default;
var matchToToken = require("js-tokens").matchToToken;
Changelog
Version 2.0.0 (2016-06-19)
**
exponentiation operator.These are the breaking changes:
'**'.match(jsTokens)
no longer returns ['*', '*']
, but ['**']
.'**='.match(jsTokens)
no longer returns ['*', '*=']
, but ['**=']
.Changelog
Version 1.0.3 (2016-03-27)
Changelog
Version 1.0.2 (2015-10-18)
Changelog
Version 1.0.0 (2015-02-26)
-
followed by a number is now correctly matched as a punctuator followed by a number. It used to be matched as just a number, but there is no such thing as negative number literals. (Possibly backwards-incompatible change.)Changelog
Version 0.4.0 (2015-02-21)
jsTokens.matchToToken
performance.