Skip to content

Commit

Permalink
Make define dependency object creation overridable.
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckdumont committed Oct 9, 2017
1 parent 30a591d commit 2c457c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/dependencies/AMDDefineDependencyParserPlugin.js
Expand Up @@ -28,6 +28,10 @@ class AMDDefineDependencyParserPlugin {
this.options = options;
}

newDefineDependency(range, arrayRange, functionRange, objectRange, namedModule) {
return new AMDDefineDependency(range, arrayRange, functionRange, objectRange, namedModule);
}

apply(parser) {
const options = this.options;
parser.plugin("call define", (expr) => {
Expand Down Expand Up @@ -156,7 +160,7 @@ class AMDDefineDependencyParserPlugin {
parser.walkExpression(fn || obj);
}

const dep = new AMDDefineDependency(
const dep = this.newDefineDependency(
expr.range,
array ? array.range : null,
fn ? fn.range : null,
Expand Down

0 comments on commit 2c457c6

Please sign in to comment.