From de98e0b232509d5f40c135d540a70e415272ff85 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 3 May 2017 15:35:00 +0200 Subject: node_modules --- .../dependencies/RequireEnsureDependenciesBlock.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js (limited to 'node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js') diff --git a/node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js b/node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js new file mode 100644 index 000000000..4b3a378e9 --- /dev/null +++ b/node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js @@ -0,0 +1,28 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; +const AsyncDependenciesBlock = require("../AsyncDependenciesBlock"); +const RequireEnsureDependency = require("./RequireEnsureDependency"); + +module.exports = class RequireEnsureDependenciesBlock extends AsyncDependenciesBlock { + constructor(expr, successExpression, errorExpression, chunkName, chunkNameRange, module, loc) { + super(chunkName, module, loc); + this.expr = expr; + const successBodyRange = successExpression && successExpression.body && successExpression.body.range; + const errorBodyRange = errorExpression && errorExpression.body && errorExpression.body.range; + this.range = null; + if(successBodyRange) { + if(errorBodyRange) { + this.range = [successBodyRange[0] + 1, errorBodyRange[1] - 1]; + } else { + this.range = [successBodyRange[0] + 1, successBodyRange[1] - 1]; + } + } + this.chunkNameRange = chunkNameRange; + const dep = new RequireEnsureDependency(this); + dep.loc = loc; + this.addDependency(dep); + } +}; -- cgit v1.2.3