fixed #1044 and fixed #1244

This commit is contained in:
Tobias Koppers 2015-07-22 23:40:46 +02:00
parent c2a8b8a843
commit dd73373d86
2 changed files with 6 additions and 1 deletions

View File

@ -32,7 +32,7 @@ ConstPlugin.prototype.apply = function(compiler) {
var bool = param.asBool();
if(typeof bool === "boolean") {
if(expression.test.type !== "Literal") {
var dep = new ConstDependency(bool + "", param.range);
var dep = new ConstDependency(" " + bool + "", param.range);
dep.loc = expression.loc;
this.state.current.addDependency(dep);
}

View File

@ -0,0 +1,5 @@
it("should not crash on missing spaces", function() {
(function() {
return"function"==typeof define&&define.amd?"hello":"world";
})();
});