babel-code-frame: Upgrade to js-tokens@3 (#5094)

That version brings a big performance boost.
This commit is contained in:
Simon Lydell
2017-01-13 18:11:44 +01:00
committed by Henry Zhu
parent 3a1c0c84fb
commit d2113d4881
2 changed files with 3 additions and 3 deletions

View File

@@ -10,6 +10,6 @@
"dependencies": {
"chalk": "^1.1.0",
"esutils": "^2.0.2",
"js-tokens": "^2.0.0"
"js-tokens": "^3.0.0"
}
}

View File

@@ -1,4 +1,4 @@
import jsTokens from "js-tokens";
import jsTokens, {matchToToken} from "js-tokens";
import esutils from "esutils";
import Chalk from "chalk";
@@ -47,7 +47,7 @@ const BRACKET = /^[()\[\]{}]$/;
function getTokenType(match) {
let [offset, text] = match.slice(-2);
let token = jsTokens.matchToToken(match);
let token = matchToToken(match);
if (token.type === "name") {
if (esutils.keyword.isReservedWordES6(token.value)) {