Comparing version 0.2.4 to 0.2.5
@@ -126,7 +126,9 @@ (function (global, undefined) { | ||
if (name) { | ||
// If this file was created with `name`, join it with `parent.id` to | ||
// generate a module identifier. | ||
file.id = (parent && parent.id || "") + "/" + name; | ||
} | ||
// The module object for this File, which will eventually boast an | ||
// .exports property when/if the file is evaluated. | ||
file.m = { | ||
// If this file was created with `name`, join it with `parent.m.id` | ||
// to generate a module identifier. | ||
id: name ? (parent && parent.m.id || "") + "/" + name : null | ||
}; | ||
@@ -158,6 +160,6 @@ // Queue for tracking required modules with unmet dependencies, | ||
var result = !! file; | ||
var module = file && file.c; | ||
var deps = isFunction(module) && module.d; | ||
if (deps && ! getOwn(module, "seen")) { | ||
module.seen = true; | ||
var factory = file && file.c; | ||
var deps = isFunction(factory) && factory.d; | ||
if (deps && ! getOwn(factory, "seen")) { | ||
factory.seen = true; | ||
var parentReadyCache = file.p.ready; | ||
@@ -172,3 +174,3 @@ result = Object.keys(deps).every(function (dep) { | ||
}); | ||
module.seen = undefined; | ||
factory.seen = undefined; | ||
} | ||
@@ -179,7 +181,7 @@ return result; | ||
function fileEvaluate(file) { | ||
var module = file && file.c; | ||
if (isFunction(module)) { | ||
var factory = file && file.c; | ||
if (isFunction(factory)) { | ||
var module = file.m; | ||
if (! hasOwn.call(module, "exports")) { | ||
module.id = file.id; | ||
module.call(global, file.r, module.exports = {}, module); | ||
factory.call(global, file.r, module.exports = {}, module); | ||
} | ||
@@ -186,0 +188,0 @@ return module.exports; |
@@ -1,1 +0,1 @@ | ||
!function(n,r){function t(n){var r=new l({}),t=r.q={};return t.h=t.t={},t.d=n&&n.defer||function(n){setTimeout(n,0)},function(n){return o(n)&&(h(r,n),c(r.q)),r.r}}function e(n,r){return A.call(n,r)&&n[r]}function o(n){return n&&"object"==typeof n}function i(n){return"function"==typeof n}function f(n){return"string"==typeof n}function u(n,r){n.t=n.t.n={f:r},n.h.n===n.t&&c(n)}function c(n){n.p||(n.p=!0,n.d(function(){n.p=r;var t=n.h.n;t&&d(t.f)&&(c(n),n.h=t,y(t.f))}))}function a(n){var r=y(k(this,n));if(r===q)throw new Error("Cannot find module '"+n+"'");return r}function s(){var n=E.concat.apply(E,arguments),r=b(n);u(this.q,new l(r,this))}function p(n){var r=a.bind(n);return r.ensure=s.bind(n),r}function l(n,r,t){var e=this;e.p=r=r||null,t&&(e.id=(r&&r.id||"")+"/"+t),e.q=r&&r.q,e.r=o(n)?p(e):r&&r.r,h(e,n),e.ready=v(e)&&{}}function d(n){var t=!!n,o=n&&n.c,f=i(o)&&o.d;if(f&&!e(o,"seen")){o.seen=!0;var u=n.p.ready;t=Object.keys(f).every(function(r){return u[r]=u[r]||d(k(n.p,r))}),o.seen=r}return t}function y(r){var t=r&&r.c;return i(t)?(A.call(t,"exports")||(t.id=r.id,t.call(n,r.r,t.exports={},t)),t.exports):q}function v(n){return o(n.c)}function h(n,r){if(r=b(r)){var t=n.c=n.c||(i(r)?r:{});o(r)&&v(n)&&Object.keys(r).forEach(function(o){var i=e(t,o);i?h(i,r[o]):t[o]=new l(r[o],n,o)})}}function b(n){if(Array.isArray(n)){var r,t={};n.forEach(function(n){f(n)?t[n]=!1:i(n)&&(r=n)}),n=r||function(n){Object.keys(t).forEach(n)},n.d=t}else i(n)?n.d=n.d||{}:o(n)||(n=null);return n}function j(n,r,t){for(;n&&!v(n);)n=n.p;if(!n||!r||"."===r)return n;if(".."===r)return n.p;for(var o=0;o<x.length;++o){var i=r+x[o],f=e(n.c,i);if(f)return f;if(!t)break}}function w(n,r){var t=r.split("/");return t.every(function(r,e){return n=j(n,r,e===t.length-1)}),n}function m(n){return n&&m(n.p)||n}function k(n,r){for(n="/"===r.charAt(0)?w(m(n),r):"."===r.charAt(0)?w(n,r):g(n,r);n&&v(n);){var t=y(j(n,"package.json"));n=t&&f(t.main)&&w(n,t.main)||j(n,"index.js")}return n}function g(n,r){return v(n)&&w(n,"node_modules/"+r)||n.p&&g(n.p,r)}if(!n.makeInstaller){n.makeInstaller=t,"object"==typeof exports&&(exports.makeInstaller=t);var x=["",".js",".json"],q={},A=q.hasOwnProperty,E=Array.prototype}}("object"==typeof global?global:"object"==typeof window?window:"object"==typeof self?self:this); | ||
!function(n,r){function t(n){var r=new p({}),t=r.q={};return t.h=t.t={},t.d=n&&n.defer||function(n){setTimeout(n,0)},function(n){return o(n)&&(h(r,n),c(r.q)),r.r}}function e(n,r){return A.call(n,r)&&n[r]}function o(n){return n&&"object"==typeof n}function f(n){return"function"==typeof n}function u(n){return"string"==typeof n}function i(n,r){n.t=n.t.n={f:r},n.h.n===n.t&&c(n)}function c(n){n.p||(n.p=!0,n.d(function(){n.p=r;var t=n.h.n;t&&d(t.f)&&(c(n),n.h=t,v(t.f))}))}function a(n){var r=v(k(this,n));if(r===q)throw new Error("Cannot find module '"+n+"'");return r}function s(){var n=E.concat.apply(E,arguments),r=b(n);i(this.q,new p(r,this))}function l(n){var r=a.bind(n);return r.ensure=s.bind(n),r}function p(n,r,t){var e=this;e.p=r=r||null,e.m={id:t?(r&&r.m.id||"")+"/"+t:null},e.q=r&&r.q,e.r=o(n)?l(e):r&&r.r,h(e,n),e.ready=y(e)&&{}}function d(n){var t=!!n,o=n&&n.c,u=f(o)&&o.d;if(u&&!e(o,"seen")){o.seen=!0;var i=n.p.ready;t=Object.keys(u).every(function(r){return i[r]=i[r]||d(k(n.p,r))}),o.seen=r}return t}function v(r){var t=r&&r.c;if(f(t)){var e=r.m;return A.call(e,"exports")||t.call(n,r.r,e.exports={},e),e.exports}return q}function y(n){return o(n.c)}function h(n,r){if(r=b(r)){var t=n.c=n.c||(f(r)?r:{});o(r)&&y(n)&&Object.keys(r).forEach(function(o){var f=e(t,o);f?h(f,r[o]):t[o]=new p(r[o],n,o)})}}function b(n){if(Array.isArray(n)){var r,t={};n.forEach(function(n){u(n)?t[n]=!1:f(n)&&(r=n)}),n=r||function(n){Object.keys(t).forEach(n)},n.d=t}else f(n)?n.d=n.d||{}:o(n)||(n=null);return n}function j(n,r,t){for(;n&&!y(n);)n=n.p;if(!n||!r||"."===r)return n;if(".."===r)return n.p;for(var o=0;o<x.length;++o){var f=r+x[o],u=e(n.c,f);if(u)return u;if(!t)break}}function m(n,r){var t=r.split("/");return t.every(function(r,e){return n=j(n,r,e===t.length-1)}),n}function w(n){return n&&w(n.p)||n}function k(n,r){for(n="/"===r.charAt(0)?m(w(n),r):"."===r.charAt(0)?m(n,r):g(n,r);n&&y(n);){var t=v(j(n,"package.json"));n=t&&u(t.main)&&m(n,t.main)||j(n,"index.js")}return n}function g(n,r){return y(n)&&m(n,"node_modules/"+r)||n.p&&g(n.p,r)}if(!n.makeInstaller){n.makeInstaller=t,"object"==typeof exports&&(exports.makeInstaller=t);var x=["",".js",".json"],q={},A=q.hasOwnProperty,E=Array.prototype}}("object"==typeof global?global:"object"==typeof window?window:"object"==typeof self?self:this); |
@@ -18,3 +18,3 @@ { | ||
], | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": "MIT", | ||
@@ -21,0 +21,0 @@ "homepage": "http://github.com/benjamn/install", |
418441
1019