returntargetLocation.host===''// Relative paths are always internal links
returntargetLocation.host===''||// Relative paths are always internal links
||(
(
targetLocation.host===referenceLocation.host&&targetLocation.protocol===referenceLocation.protocol// Otherwise need to check if protocol and host match
targetLocation.host===referenceLocation.host&&targetLocation.protocol===referenceLocation.protocol&&// Otherwise need to check if protocol and host match
&&(relative_path.length>0?targetLocation.pathname.indexOf(relative_path)===0:true)// Subfolder installs need this additional check
(relative_path.length>0?targetLocation.pathname.indexOf(relative_path)===0:true)// Subfolder installs need this additional check
+'\n\t\tdocument.body.innerHTML = \'Stuff has been done\';'
'\n\t\tdocument.body.innerHTML = \'Stuff has been done\';'+
+'\n\t};'
'\n\t};'+
+'\n})(window, document);'
'\n})(window, document);'+
+'\n'
'\n'+
+'\n;function foo(name, age) {'
'\n;function foo(name, age) {'+
+'\n\treturn \'The person known as "\' + name + \'" is \' + age + \' years old\';'
'\n\treturn \'The person known as "\' + name + \'" is \' + age + \' years old\';'+
+'\n}'
'\n}'+
+'\n'
'\n'
);
);
done();
done();
});
});
@ -69,8 +69,8 @@ describe('minifier', function () {
assert.strictEqual(
assert.strictEqual(
fs.readFileSync(destPath).toString(),
fs.readFileSync(destPath).toString(),
'(function(n,o){n.doStuff=function(){o.body.innerHTML="Stuff has been done"}})(window,document);function foo(n,o){return\'The person known as "\'+n+\'" is \'+o+" years old"}'
'(function(n,o){n.doStuff=function(){o.body.innerHTML="Stuff has been done"}})(window,document);function foo(n,o){return\'The person known as "\'+n+\'" is \'+o+" years old"}'+
+'\n//# sourceMappingURL=minified.js.map'
'\n//# sourceMappingURL=minified.js.map'
);
);
done();
done();
});
});
@ -87,8 +87,8 @@ describe('minifier', function () {
assert.ifError(err);
assert.ifError(err);
assert.strictEqual(
assert.strictEqual(
buffer.toString(),
buffer.toString(),
'(function(n,o){n.doStuff=function(){o.body.innerHTML="Stuff has been done"}})(window,document);'
'(function(n,o){n.doStuff=function(){o.body.innerHTML="Stuff has been done"}})(window,document);'+