Skip to content

Commit

Permalink
fix babel#243
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Feb 1, 2016
1 parent 3dcb32c commit d8ac8f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function monkeypatch() {
}
var referencerMod = createModule(referencerLoc);
var referencer = require(referencerLoc);
if (typeof referencer === 'object' && referencer.default) {
referencer = referencer.default;
}

// monkeypatch escope/pattern-visitor
var patternVisitorLoc;
Expand All @@ -89,6 +92,9 @@ function monkeypatch() {
patternVisitorLoc = Module._resolveFilename("./pattern-visitor", escopeMod);
patternVisitorMod = createModule(patternVisitorLoc);
patternVisitor = require(patternVisitorLoc);
if (typeof patternVisitor === 'object' && patternVisitor.default) {
patternVisitor = patternVisitor.default;
}
} catch (err) {
// When eslint uses old escope, we cannot find pattern visitor.
// Fallback to the old way.
Expand Down

0 comments on commit d8ac8f9

Please sign in to comment.