Skip to content

Commit 3092982

Browse files
committed
fixed test cases with updated DefinePlugin
1 parent 4d1e328 commit 3092982

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/DefinePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ DefinePlugin.prototype.apply = function(compiler) {
3838
if(code === null) return "null";
3939
else if(code === undefined) return "undefined";
4040
else if(code instanceof RegExp && code.toString) return code.toString();
41-
else if(typeof code === "function" && code.toString) return code.toString();
41+
else if(typeof code === "function" && code.toString) return "(" + code.toString() + ")";
4242
else if(typeof code === "object") return stringifyObj(code);
4343
else return code + "";
4444
}

test/browsertest/library2config.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports =
2323
CONST_FALSE: false,
2424
CONST_FUNCTION: -> return "ok";
2525
CONST_NUMBER: 123,
26-
CONST_NUMBER_EXPR: "1*100+23",
26+
CONST_NUMBER_EXPR: "(1*100+23)",
2727
CONST_OBJECT: {
2828
A: 1,
2929
B: JSON.stringify("B"),
@@ -36,4 +36,4 @@ module.exports =
3636
nmf.plugin "after-resolve", (data, callback) ->
3737
data.resource = data.resource.replace /extra\.js/, "extra2.js";
3838
callback null, data;
39-
]
39+
]

test/browsertest/node_modules/library2/lib/main.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)