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

@@ -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)) {