Comparing version 0.1.2 to 0.1.3
@@ -0,1 +1,7 @@ | ||
## 0.1.3 | ||
- Don't throw when we cannot delete the introduced globals. | ||
## 0.1.2 | ||
- Fixes optional globals arg. | ||
## 0.1.1 | ||
@@ -2,0 +8,0 @@ - Make it possible to add globals to the loaded script. |
10
index.js
@@ -23,4 +23,4 @@ 'use strict'; | ||
globals["__filename"] = path.basename(location); | ||
globals["__dirname"] = path.dirname(location); | ||
globals.__filename = path.basename(location); | ||
globals.__dirname = path.dirname(location); | ||
@@ -63,3 +63,4 @@ return compiler(read(location), path.basename(location), globals); | ||
if (context[global] === missing[global]) { | ||
delete context[global]; | ||
try { delete context[global]; } | ||
catch (e) {} | ||
} | ||
@@ -69,3 +70,4 @@ }); | ||
if (context[global] === globals[global]) { | ||
delete context[global]; | ||
try { delete context[global]; } | ||
catch (e) {} | ||
} | ||
@@ -72,0 +74,0 @@ }); |
{ | ||
"name": "load", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Load plain JavaScript files that don't use module patterns directly in node.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,7 @@ 'use strict'; | ||
} | ||
}, { | ||
it: 'doesnt throw when it wants to delete undefined variables', | ||
does: function () { | ||
load('./fixtures/globals.js', { undefined: undefined }); | ||
} | ||
}].forEach(function compiling(test, index) { | ||
@@ -40,0 +45,0 @@ console.log('('+ index +') it '+ test.it); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7469
176