Skip to content

Commit 36fc154

Browse files
committed
Merge pull request webpack#342 from Taytay/fix/node_stuff_set_constants
Fix: setConstant and setModuleConstant now function correctly again.
2 parents 197d2f2 + d661eb1 commit 36fc154

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎lib/NodeStuffPlugin.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ NodeStuffPlugin.prototype.apply = function(compiler) {
2121
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
2222
});
2323
function ignore() { return true; }
24-
function setConstant(expr, value) {
25-
compiler.parser.plugin("expression " + expr, function(expr) {
26-
this.state.current.addVariable(expr, JSON.stringify(value));
24+
function setConstant(expressionName, value) {
25+
compiler.parser.plugin("expression " + expressionName, function(expr) {
26+
this.state.current.addVariable(expressionName, JSON.stringify(value));
2727
return true;
28-
});
28+
});
2929
}
30-
function setModuleConstant(expr, fn) {
31-
compiler.parser.plugin("expression " + expr, function(expr) {
32-
this.state.current.addVariable(expr, JSON.stringify(fn(this.state.module)));
30+
function setModuleConstant(expressionName, fn) {
31+
compiler.parser.plugin("expression " + expressionName, function(expr) {
32+
this.state.current.addVariable(expressionName, JSON.stringify(fn(this.state.module)));
3333
return true;
34-
});
34+
});
3535
}
3636
var context = compiler.context;
3737
if(this.options.__filename === "mock") {

0 commit comments

Comments
 (0)