|
|
@ -25,6 +25,12 @@ var runInThisContext = Script.runInThisContext; |
|
|
|
var runInNewContext = Script.runInNewContext; |
|
|
|
var assert = require('assert').ok; |
|
|
|
|
|
|
|
|
|
|
|
function hOP(obj, prop) { |
|
|
|
return Object.prototype.hasOwnProperty.call(obj, prop); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function Module(id, parent) { |
|
|
|
this.id = id; |
|
|
|
this.exports = {}; |
|
|
@ -85,7 +91,7 @@ function statPath(path) { |
|
|
|
var packageCache = {}; |
|
|
|
|
|
|
|
function readPackage(requestPath) { |
|
|
|
if (packageCache.hasOwnProperty(requestPath)) { |
|
|
|
if (hOP(packageCache, requestPath)) { |
|
|
|
return packageCache[requestPath]; |
|
|
|
} |
|
|
|
|
|
|
|