diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index f480727283..82b2bcdc10 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -10,6 +10,6 @@ "dependencies": { "chalk": "^1.1.0", "esutils": "^2.0.2", - "js-tokens": "^2.0.0" + "js-tokens": "^3.0.0" } } diff --git a/packages/babel-code-frame/src/index.js b/packages/babel-code-frame/src/index.js index 05637e9e40..1e570ab692 100644 --- a/packages/babel-code-frame/src/index.js +++ b/packages/babel-code-frame/src/index.js @@ -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)) {