liferay-amd-loader
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -9,2 +9,3 @@ define("liferay@1.0.0/ambrin/aui-ambrin", ['exports', 'liferay/aui-core'], function (exports, _auiCore) { | ||
function log(text) { | ||
@@ -11,0 +12,0 @@ (0, _auiCore.log)('module aui-chemaps says via aui-core: ' + text); |
@@ -7,3 +7,2 @@ define("liferay@1.0.0/aui-base", ['exports'], function (exports) { | ||
}); | ||
function log(text) { | ||
@@ -10,0 +9,0 @@ console.log('module aui-base says', text); |
@@ -7,3 +7,2 @@ define("liferay@1.0.0/aui-core", ['exports'], function (exports) { | ||
}); | ||
function log(text) { | ||
@@ -10,0 +9,0 @@ console.log('module aui-core says', text); |
@@ -9,2 +9,3 @@ define("liferay@1.0.0/aui-dialog", ['exports', 'liferay/aui-base', 'liferay/aui-core', 'liferay/aui-event'], function (exports, _auiBase, _auiCore, _auiEvent) { | ||
function log(text) { | ||
@@ -11,0 +12,0 @@ (0, _auiEvent.log)('module aui-dialog says via aui-event: ' + text); |
@@ -7,3 +7,2 @@ define("liferay@1.0.0/aui-event", ['exports'], function (exports) { | ||
}); | ||
function log(text) { | ||
@@ -10,0 +9,0 @@ console.log('module aui-event says', text); |
@@ -9,2 +9,3 @@ define("liferay@1.0.0/chema/chemaps/aui-chemaps", ['exports', 'liferay/aui-base'], function (exports, _auiBase) { | ||
function log(text) { | ||
@@ -11,0 +12,0 @@ (0, _auiBase.log)('module aui-chemaps says via aui-base: ' + text); |
@@ -7,3 +7,2 @@ define("liferay@1.0.0/liferay/liferay", ['exports'], function (exports) { | ||
}); | ||
function log(text) { | ||
@@ -10,0 +9,0 @@ console.log('module liferay says', text); |
@@ -7,3 +7,2 @@ define("liferay@1.0.0/liferay/liferay2", ['exports'], function (exports) { | ||
}); | ||
function log(text) { | ||
@@ -10,0 +9,0 @@ console.log('module liferay2 says', text); |
@@ -1,1 +0,1 @@ | ||
(function(){function e(e,t){j[C]=e,j[C+1]=t,C+=2,2===C&&P()}function t(e){return"function"==typeof e}function n(){return function(){process.nextTick(s)}}function o(){var e=0,t=new O(s),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function i(){var e=new MessageChannel;return e.port1.onmessage=s,function(){e.port2.postMessage(0)}}function r(){return function(){setTimeout(s,1)}}function s(){for(var e=0;C>e;e+=2)(0,j[e])(j[e+1]),j[e]=void 0,j[e+1]=void 0;C=0}function u(){}function a(e,t,n,o){try{e.call(t,n,o)}catch(i){return i}}function l(t,n,o){e(function(e){var t=!1,i=a(o,n,function(o){t||(t=!0,n!==o?f(e,o):h(e,o))},function(n){t||(t=!0,p(e,n))});!t&&i&&(t=!0,p(e,i))},t)}function c(e,t){1===t.a?h(e,t.b):2===e.a?p(e,t.b):g(t,void 0,function(t){f(e,t)},function(t){p(e,t)})}function f(e,n){if(e===n)p(e,new TypeError("You cannot resolve a promise with itself"));else if("function"==typeof n||"object"==typeof n&&null!==n)if(n.constructor===e.constructor)c(e,n);else{var o;try{o=n.then}catch(i){k.error=i,o=k}o===k?p(e,k.error):void 0===o?h(e,n):t(o)?l(e,n,o):h(e,n)}else h(e,n)}function d(e){e.f&&e.f(e.b),m(e)}function h(t,n){void 0===t.a&&(t.b=n,t.a=1,0!==t.e.length&&e(m,t))}function p(t,n){void 0===t.a&&(t.a=2,t.b=n,e(d,t))}function g(t,n,o,i){var r=t.e,s=r.length;t.f=null,r[s]=n,r[s+1]=o,r[s+2]=i,0===s&&t.a&&e(m,t)}function m(e){var t=e.e,n=e.a;if(0!==t.length){for(var o,i,r=e.b,s=0;s<t.length;s+=3)o=t[s],i=t[s+n],o?_(n,o,i,r):i(r);e.e.length=0}}function v(){this.error=null}function _(e,n,o,i){var r,s,u,a,l=t(o);if(l){try{r=o(i)}catch(c){q.error=c,r=q}if(r===q?(a=!0,s=r.error,r=null):u=!0,n===r)return void p(n,new TypeError("A promises callback cannot return that same promise."))}else r=i,u=!0;void 0===n.a&&(l&&u?f(n,r):a?p(n,s):1===e?h(n,r):2===e&&p(n,r))}function y(e,t){try{t(function(t){f(e,t)},function(t){p(e,t)})}catch(n){p(e,n)}}function M(e,t,n,o){this.n=e,this.c=new e(u,o),this.i=n,this.o(t)?(this.m=t,this.d=this.length=t.length,this.l(),0===this.length?h(this.c,this.b):(this.length=this.length||0,this.k(),0===this.d&&h(this.c,this.b))):p(this.c,this.p())}function b(e){if(A++,this.b=this.a=void 0,this.e=[],u!==e){if(!t(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof b))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");y(this,e)}}var P,w=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},C=0,x="undefined"!=typeof window?window:{},O=x.MutationObserver||x.WebKitMutationObserver,x="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,j=Array(1e3);P="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?n():O?o():x?i():r();var k=new v,q=new v;M.prototype.o=function(e){return w(e)},M.prototype.p=function(){return Error("Array Methods must be provided an Array")},M.prototype.l=function(){this.b=Array(this.length)},M.prototype.k=function(){for(var e=this.length,t=this.c,n=this.m,o=0;void 0===t.a&&e>o;o++)this.j(n[o],o)},M.prototype.j=function(e,t){var n=this.n;"object"==typeof e&&null!==e?e.constructor===n&&void 0!==e.a?(e.f=null,this.g(e.a,t,e.b)):this.q(n.resolve(e),t):(this.d--,this.b[t]=this.h(e))},M.prototype.g=function(e,t,n){var o=this.c;void 0===o.a&&(this.d--,this.i&&2===e?p(o,n):this.b[t]=this.h(n)),0===this.d&&h(o,this.b)},M.prototype.h=function(e){return e},M.prototype.q=function(e,t){var n=this;g(e,void 0,function(e){n.g(1,t,e)},function(e){n.g(2,t,e)})};var A=0;b.all=function(e,t){return new M(this,e,!0,t).c},b.race=function(e,t){function n(e){f(i,e)}function o(e){p(i,e)}var i=new this(u,t);if(!w(e))return p(i,new TypeError("You must pass an array to race.")),i;for(var r=e.length,s=0;void 0===i.a&&r>s;s++)g(this.resolve(e[s]),void 0,n,o);return i},b.resolve=function(e,t){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(u,t);return f(n,e),n},b.reject=function(e,t){var n=new this(u,t);return p(n,e),n},b.prototype={constructor:b,then:function(t,n){var o=this.a;if(1===o&&!t||2===o&&!n)return this;var i=new this.constructor(u),r=this.b;if(o){var s=arguments[o-1];e(function(){_(o,i,s,r)})}else g(this,i,t,n);return i},"catch":function(e){return this.then(null,e)}};var D={Promise:b,polyfill:function(){var e;e="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self,"Promise"in e&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var n;return new e.Promise(function(e){n=e}),t(n)}()||(e.Promise=b)}};"function"==typeof define&&define.amd?define(function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:"undefined"!=typeof this&&(this.ES6Promise=D)}).call(this),function(){var global={};global.__CONFIG__=window.__CONFIG__,function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.EventEmitter=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(){this._events={}}return t.prototype={constructor:t,on:function(e,t){var n=this._events[e]=this._events[e]||[];n.push(t)},off:function(e,t){var n=this._events[e];if(n){var o=n.indexOf(t);o>-1&&n.splice(o,1)}},emit:function(e,t){var n=this._events[e];if(n){n=n.slice(0);for(var o=0;o<n.length;o++){var i=n[o];i.call(i,t)}}}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.ConfigParser=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(e){this._config={},this._modules={},this._conditionalModules={},this._parseConfig(e)}return t.prototype={constructor:t,addModule:function(e){var t=this._modules[e.name];if(t)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);else this._modules[e.name]=e;return this._registerConditionalModule(e),this._modules[e.name]},getConfig:function(){return this._config},getConditionalModules:function(){return this._conditionalModules},getModules:function(){return this._modules},mapModule:function(e){if(!this._config.maps)return e;var t;t=Array.isArray(e)?e:[e];for(var n=0;n<t.length;n++){var o=t[n],i=!1;for(var r in this._config.maps)if(Object.prototype.hasOwnProperty.call(this._config.maps,r)&&(o===r||0===o.indexOf(r+"/"))){o=this._config.maps[r]+o.substring(r.length),t[n]=o,i=!0;break}i||"function"!=typeof this._config.maps["*"]||(t[n]=this._config.maps["*"](o))}return Array.isArray(e)?t:t[0]},_parseConfig:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&("modules"===t?this._parseModules(e[t]):this._config[t]=e[t]);return this._config},_parseModules:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];n.name=t,this.addModule(n)}return this._modules},_registerConditionalModule:function(e){if(e.condition){var t=this._conditionalModules[e.condition.trigger];t||(this._conditionalModules[e.condition.trigger]=t=[]),t.push(e.name)}}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.DependencyBuilder=n}("undefined"!=typeof global?global:this,function(global){"use strict";function DependencyBuilder(e){this._configParser=e,this._pathResolver=new global.PathResolver,this._result=[]}var hasOwnProperty=Object.prototype.hasOwnProperty;return DependencyBuilder.prototype={constructor:DependencyBuilder,resolveDependencies:function(e){this._queue=e.slice(0);var t;try{this._resolveDependencies(),t=this._result.reverse().slice(0)}finally{this._cleanup()}return t},_cleanup:function(){var e=this._configParser.getModules();for(var t in e)if(hasOwnProperty.call(e,t)){var n=e[t];n.conditionalMark=!1,n.mark=!1,n.tmpMark=!1}this._queue.length=0,this._result.length=0},_processConditionalModules:function(e){var t=this._configParser.getConditionalModules()[e.name];if(t&&!e.conditionalMark){for(var n=this._configParser.getModules(),o=0;o<t.length;o++){var i=n[t[o]];-1===this._queue.indexOf(i.name)&&this._testConditionalModule(i.condition.test)&&this._queue.push(i.name)}e.conditionalMark=!0}},_resolveDependencies:function(){for(var e=this._configParser.getModules(),t=0;t<this._queue.length;t++){var n=e[this._queue[t]];n||(n=this._configParser.addModule({name:this._queue[t],dependencies:[]})),n.mark||this._visit(n)}},_testConditionalModule:function(testFunction){return"function"==typeof testFunction?testFunction():eval("false || "+testFunction)()},_visit:function(e){if(e.tmpMark)throw new Error("Error processing module: "+e.name+". The provided configuration is not Directed Acyclic Graph.");if(this._processConditionalModules(e),!e.mark){e.tmpMark=!0;for(var t=this._configParser.getModules(),n=0;n<e.dependencies.length;n++){var o=e.dependencies[n];if("exports"!==o&&"module"!==o){o=this._pathResolver.resolvePath(e.name,o);var i=this._configParser.mapModule(o),r=t[i];r||(r=this._configParser.addModule({name:i,dependencies:[]})),this._visit(r)}}e.mark=!0,e.tmpMark=!1,this._result.unshift(e.name)}},_queue:[]},DependencyBuilder}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.URLBuilder=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(e){this._configParser=e}var n=/^https?:\/\/|\/\/|www\./;return t.prototype={constructor:t,build:function(e){var t=[],o=[],i=[],r=[],s=[],u=this._configParser.getConfig(),a=u.basePath||"",l=this._configParser.getModules();a.length&&"/"!==a.charAt(a.length-1)&&(a+="/");for(var c=0;c<e.length;c++){var f=l[e[c]];if(f.fullPath)s.push({modules:[f.name],url:f.fullPath});else{var d=this._getModulePath(f),h=0===d.indexOf("/");n.test(d)?s.push({modules:[f.name],url:d}):u.combine?h?(t.push(d),i.push(f.name)):(o.push(d),r.push(f.name)):s.push({modules:[f.name],url:u.url+(h?"":a)+d})}f.requested=!0}return o.length&&(s.push({modules:r,url:u.url+a+o.join("&"+a)}),o.length=0),t.length&&(s.push({modules:i,url:u.url+t.join("&")}),t.length=0),s},_getModulePath:function(e){var t=e.path||e.name,o=this._configParser.getConfig().paths;for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t===i||0===t.indexOf(i+"/"))&&(t=o[i]+t.substring(i.length));return n.test(t)||t.indexOf(".js")===t.length-3||(t+=".js"),t}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.PathResolver=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(){}return t.prototype={constructor:t,resolvePath:function(e,t){if("exports"===t||"module"===t||0!==t.indexOf(".")&&0!==t.indexOf(".."))return t;var n=e.split("/");n.splice(-1,1);for(var o=t.split("/"),i=o.splice(-1,1),r=0;r<o.length;r++){var s=o[r];if("."!==s)if(".."===s){if(!n.length){n=n.concat(o.slice(r));break}n.splice(-1,1)}else n.push(s)}return n.push(i),n.join("/")}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.Loader=new n,e.require=e.Loader.require.bind(e.Loader),e.define=e.Loader.define.bind(e.Loader),e.define.amd={}}("undefined"!=typeof global?global:this,function(e){"use strict";function t(n){t.superclass.constructor.apply(this,arguments),this._config=n||e.__CONFIG__,this._modulesMap={}}t.prototype=Object.create(e.EventEmitter.prototype),t.prototype.constructor=t,t.superclass=e.EventEmitter.prototype;var n={addModule:function(e){return this._getConfigParser().addModule(e)},define:function(e,t,n,o){var i=arguments.length;if(!(2>i)){if(2===i){if("string"!=typeof e)return;n=t,t=["module","exports"]}var r=o||{},s=this._getConfigParser(),u=this._getPathResolver();t=t.map(function(t){return u.resolvePath(e,t)}),r.name=e,r.dependencies=t,r.pendingImplementation=n,s.addModule(r),this._modulesMap[r.name]||(this._modulesMap[r.name]=!0),this.emit("moduleRegister",e)}},getConditionalModules:function(){return this._getConfigParser().getConditionalModules()},getModules:function(){return this._getConfigParser().getModules()},require:function(){var e,t,n,o,i=this;if(Array.isArray(arguments[0]))n=arguments[0],o="function"==typeof arguments[1]?arguments[1]:null,e="function"==typeof arguments[2]?arguments[2]:null;else for(n=[],t=0;t<arguments.length;++t)if("string"==typeof arguments[t])n[t]=arguments[t];else if("function"==typeof arguments[t]){o=arguments[t],e="function"==typeof arguments[++t]?arguments[t]:null;break}var r,s=i._getConfigParser(),u=s.mapModule(n);new Promise(function(e,t){i._resolveDependencies(u).then(function(o){var a=s.getConfig();0!==a.waitTimeout&&(r=setTimeout(function(){var e=s.getModules(),i=new Error("Load timeout for modules: "+n);i.dependecies=o,i.mappedModules=u,i.missingDependencies=o.filter(function(t){return!e[t].implementation}),i.modules=n,t(i)},a.waitTimeout||7e3)),i._loadModules(o).then(e,t)},t)}).then(function(e){if(clearTimeout(r),o){var t=i._getModuleImplementations(u);o.apply(o,t)}},function(t){clearTimeout(r),e&&e.call(e,t)})},_createModulePromise:function(e){var t=this;return new Promise(function(n,o){var i=t._getConfigParser().getModules(),r=i[e];if(r.exports){var s=t._getValueGlobalNS(r.exports);if(s)n(s);else{var u=function(i){if(i.indexOf(e)>=0){t.off("scriptLoaded",u);var s=t._getValueGlobalNS(r.exports);s?n(s):o(new Error("Module "+e+" does not export the specified value: "+r.exports))}};t.on("scriptLoaded",u)}}else{var a=function(o){o===e&&(t.off("moduleRegister",a),t._modulesMap[e]=!0,n(e))};t.on("moduleRegister",a)}})},_getConfigParser:function(){return this._configParser||(this._configParser=new e.ConfigParser(this._config)),this._configParser},_getDependencyBuilder:function(){return this._dependencyBuilder||(this._dependencyBuilder=new e.DependencyBuilder(this._getConfigParser())),this._dependencyBuilder},_getValueGlobalNS:function(e){return(0,eval)("this")[e]},_getMissingDepenencies:function(e){for(var t=this._getConfigParser(),n=t.getModules(),o=Object.create(null),i=0;i<e.length;i++)for(var r=n[e[i]],s=t.mapModule(r.dependencies),u=0;u<s.length;u++){var a=s[u],l=n[a];"exports"===a||"module"===a||l&&l.pendingImplementation||(o[a]=1)}return Object.keys(o)},_getModuleImplementations:function(e){for(var t=[],n=this._getConfigParser().getModules(),o=0;o<e.length;o++){var i=n[e[o]];t.push(i?i.implementation:void 0)}return t},_getPathResolver:function(){return this._pathResolver||(this._pathResolver=new e.PathResolver),this._pathResolver},_getURLBuilder:function(){return this._urlBuilder||(this._urlBuilder=new e.URLBuilder(this._getConfigParser())),this._urlBuilder},_filterNotRequestedModules:function(e){for(var t=[],n=this._getConfigParser().getModules(),o=0;o<e.length;o++){var i=n[e[o]];"exports"===i||"module"===i||i&&i.requested||t.push(e[o])}return t},_loadModules:function(e){var t=this;return new Promise(function(n,o){var i=t._filterNotRequestedModules(e);if(i.length){for(var r=t._getURLBuilder().build(i),s=[],u=0;u<r.length;u++)s.push(t._loadScript(r[u]));Promise.all(s).then(function(n){return t._waitForModules(e)}).then(function(e){n(e)})["catch"](function(e){o(e)})}else t._waitForModules(e).then(function(e){n(e)})["catch"](function(e){o(e)})})},_loadScript:function(e){var t=this;return new Promise(function(n,o){var i=document.createElement("script");i.src=e.url,i.onload=i.onreadystatechange=function(){this.readyState&&"complete"!==this.readyState&&"load"!==this.readyState||(i.onload=i.onreadystatechange=null,n(i),t.emit("scriptLoaded",e.modules))},i.onerror=function(){document.head.removeChild(i),o(i)},document.head.appendChild(i)})},_resolveDependencies:function(e){var t=this;return new Promise(function(n,o){try{var i=t._getDependencyBuilder().resolveDependencies(e);n(i)}catch(r){o(r)}})},_setModuleImplementation:function(e){for(var t=this._getConfigParser().getModules(),n=0;n<e.length;n++){var o=e[n];if(!o.implementation)if(o.exports)o.pendingImplementation=o.implementation=this._getValueGlobalNS(o.exports);else{for(var i,r=[],s=this._getConfigParser(),u=0;u<o.dependencies.length;u++){var a=o.dependencies[u];if("exports"===a)i={},r.push(i);else if("module"===a)i={exports:{}},r.push(i);else{var l=t[s.mapModule(a)],c=l.implementation;r.push(c)}}var f;f="function"==typeof o.pendingImplementation?o.pendingImplementation.apply(o.pendingImplementation,r):o.pendingImplementation,f?o.implementation=f:i&&(o.implementation=i.exports||i)}}},_waitForModule:function(e){var t=this,n=t._modulesMap[e];return n||(n=t._createModulePromise(e),t._modulesMap[e]=n),n},_waitForModules:function(e){var t=this;return new Promise(function(n,o){for(var i=[],r=0;r<e.length;r++)i.push(t._waitForModule(e[r]));Promise.all(i).then(function(i){var r=t._getConfigParser().getModules(),s=function(){for(var o=[],i=0;i<e.length;i++)o.push(r[e[i]]);t._setModuleImplementation(o),n(o)},u=t._getMissingDepenencies(e);u.length?t.require(u,s,o):s()},o)})}};return Object.keys(n).forEach(function(e){t.prototype[e]=n[e]}),t}),window.Loader=global.Loader,window.require=global.require,window.define=global.define}(); | ||
(function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function t(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function r(e){G=e}function o(e){K=e}function i(){return function(){process.nextTick(c)}}function s(){return function(){N(c)}}function u(){var e=0,t=new H(c),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function a(){var e=new MessageChannel;return e.port1.onmessage=c,function(){e.port2.postMessage(0)}}function l(){return function(){setTimeout(c,1)}}function c(){for(var e=0;Y>e;e+=2){var t=X[e],n=X[e+1];t(n),X[e]=void 0,X[e+1]=void 0}Y=0}function f(){try{var e=require,t=e("vertx");return N=t.runOnLoop||t.runOnContext,s()}catch(n){return l()}}function d(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function h(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(t){return te.error=t,te}}function m(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function _(e,t,n){K(function(e){var r=!1,o=m(n,t,function(n){r||(r=!0,t!==n?b(e,n):w(e,n))},function(t){r||(r=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,P(e,o))},e)}function v(e,t){t._state===$?w(e,t._result):t._state===ee?P(e,t._result):C(t,void 0,function(t){b(e,t)},function(t){P(e,t)})}function y(e,n){if(n.constructor===e.constructor)v(e,n);else{var r=g(n);r===te?P(e,te.error):void 0===r?w(e,n):t(r)?_(e,n,r):w(e,n)}}function b(t,n){t===n?P(t,p()):e(n)?y(t,n):w(t,n)}function M(e){e._onerror&&e._onerror(e._result),x(e)}function w(e,t){e._state===Z&&(e._result=t,e._state=$,0!==e._subscribers.length&&K(x,e))}function P(e,t){e._state===Z&&(e._state=ee,e._result=t,K(M,e))}function C(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+$]=n,o[i+ee]=r,0===i&&e._state&&K(x,e)}function x(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?A(n,r,o,i):o(i);e._subscribers.length=0}}function O(){this.error=null}function j(e,t){try{return e(t)}catch(n){return ne.error=n,ne}}function A(e,n,r,o){var i,s,u,a,l=t(r);if(l){if(i=j(r,o),i===ne?(a=!0,s=i.error,i=null):u=!0,n===i)return void P(n,h())}else i=o,u=!0;n._state!==Z||(l&&u?b(n,i):a?P(n,s):e===$?w(n,i):e===ee&&P(n,i))}function E(e,t){try{t(function(t){b(e,t)},function(t){P(e,t)})}catch(n){P(e,n)}}function q(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(d),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?w(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&w(n.promise,n._result))):P(n.promise,n._validationError())}function k(e){return new re(this,e).promise}function D(e){function t(e){b(o,e)}function n(e){P(o,e)}var r=this,o=new r(d);if(!V(e))return P(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,s=0;o._state===Z&&i>s;s++)C(r.resolve(e[s]),void 0,t,n);return o}function R(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(d);return b(n,e),n}function S(e){var t=this,n=new t(d);return P(n,e),n}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function I(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function L(e){this._id=ae++,this._state=void 0,this._result=void 0,this._subscribers=[],d!==e&&(t(e)||B(),this instanceof L||I(),E(this,e))}function F(){var e;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=le)}var T;T=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var N,G,U,V=T,Y=0,K=({}.toString,function(e,t){X[Y]=e,X[Y+1]=t,Y+=2,2===Y&&(G?G(c):U())}),W="undefined"!=typeof window?window:void 0,z=W||{},H=z.MutationObserver||z.WebKitMutationObserver,J="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,X=new Array(1e3);U=J?i():H?u():Q?a():void 0===W&&"function"==typeof require?f():l();var Z=void 0,$=1,ee=2,te=new O,ne=new O;q.prototype._validateInput=function(e){return V(e)},q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},q.prototype._init=function(){this._result=new Array(this.length)};var re=q;q.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===Z&&t>o;o++)e._eachEntry(r[o],o)},q.prototype._eachEntry=function(e,t){var r=this,o=r._instanceConstructor;n(e)?e.constructor===o&&e._state!==Z?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(o.resolve(e),t):(r._remaining--,r._result[t]=e)},q.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===Z&&(r._remaining--,e===ee?P(o,n):r._result[t]=n),0===r._remaining&&w(o,r._result)},q.prototype._willSettleAt=function(e,t){var n=this;C(e,void 0,function(e){n._settledAt($,t,e)},function(e){n._settledAt(ee,t,e)})};var oe=k,ie=D,se=R,ue=S,ae=0,le=L;L.all=oe,L.race=ie,L.resolve=se,L.reject=ue,L._setScheduler=r,L._setAsap=o,L._asap=K,L.prototype={constructor:L,then:function(e,t){var n=this,r=n._state;if(r===$&&!e||r===ee&&!t)return this;var o=new this.constructor(d),i=n._result;if(r){var s=arguments[r-1];K(function(){A(r,o,s,i)})}else C(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var ce=F,fe={Promise:le,polyfill:ce};"function"==typeof define&&define.amd?define(function(){return fe}):"undefined"!=typeof module&&module.exports?module.exports=fe:"undefined"!=typeof this&&(this.ES6Promise=fe),ce()}).call(this),function(){var global={};global.__CONFIG__=window.__CONFIG__,function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.EventEmitter=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(){this._events={}}return t.prototype={constructor:t,on:function(e,t){var n=this._events[e]=this._events[e]||[];n.push(t)},off:function(e,t){var n=this._events[e];if(n){var r=n.indexOf(t);r>-1&&n.splice(r,1)}},emit:function(e,t){var n=this._events[e];if(n){n=n.slice(0);for(var r=0;r<n.length;r++){var o=n[r];o.call(o,t)}}}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.ConfigParser=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(e){this._config={},this._modules={},this._conditionalModules={},this._parseConfig(e)}return t.prototype={constructor:t,addModule:function(e){var t=this._modules[e.name];if(t)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);else this._modules[e.name]=e;return this._registerConditionalModule(e),this._modules[e.name]},getConfig:function(){return this._config},getConditionalModules:function(){return this._conditionalModules},getModules:function(){return this._modules},mapModule:function(e){if(!this._config.maps)return e;var t;t=Array.isArray(e)?e:[e];for(var n=0;n<t.length;n++){var r=t[n],o=!1;for(var i in this._config.maps)if(Object.prototype.hasOwnProperty.call(this._config.maps,i)&&(r===i||0===r.indexOf(i+"/"))){r=this._config.maps[i]+r.substring(i.length),t[n]=r,o=!0;break}o||"function"!=typeof this._config.maps["*"]||(t[n]=this._config.maps["*"](r))}return Array.isArray(e)?t:t[0]},_parseConfig:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&("modules"===t?this._parseModules(e[t]):this._config[t]=e[t]);return this._config},_parseModules:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];n.name=t,this.addModule(n)}return this._modules},_registerConditionalModule:function(e){if(e.condition){var t=this._conditionalModules[e.condition.trigger];t||(this._conditionalModules[e.condition.trigger]=t=[]),t.push(e.name)}}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.DependencyBuilder=n}("undefined"!=typeof global?global:this,function(global){"use strict";function DependencyBuilder(e){this._configParser=e,this._pathResolver=new global.PathResolver,this._result=[]}var hasOwnProperty=Object.prototype.hasOwnProperty;return DependencyBuilder.prototype={constructor:DependencyBuilder,resolveDependencies:function(e){this._queue=e.slice(0);var t;try{this._resolveDependencies(),t=this._result.reverse().slice(0)}finally{this._cleanup()}return t},_cleanup:function(){var e=this._configParser.getModules();for(var t in e)if(hasOwnProperty.call(e,t)){var n=e[t];n.conditionalMark=!1,n.mark=!1,n.tmpMark=!1}this._queue.length=0,this._result.length=0},_processConditionalModules:function(e){var t=this._configParser.getConditionalModules()[e.name];if(t&&!e.conditionalMark){for(var n=this._configParser.getModules(),r=0;r<t.length;r++){var o=n[t[r]];-1===this._queue.indexOf(o.name)&&this._testConditionalModule(o.condition.test)&&this._queue.push(o.name)}e.conditionalMark=!0}},_resolveDependencies:function(){for(var e=this._configParser.getModules(),t=0;t<this._queue.length;t++){var n=e[this._queue[t]];n||(n=this._configParser.addModule({name:this._queue[t],dependencies:[]})),n.mark||this._visit(n)}},_testConditionalModule:function(testFunction){return"function"==typeof testFunction?testFunction():eval("false || "+testFunction)()},_visit:function(e){if(e.tmpMark)throw new Error("Error processing module: "+e.name+". The provided configuration is not Directed Acyclic Graph.");if(this._processConditionalModules(e),!e.mark){e.tmpMark=!0;for(var t=this._configParser.getModules(),n=0;n<e.dependencies.length;n++){var r=e.dependencies[n];if("exports"!==r&&"module"!==r){r=this._pathResolver.resolvePath(e.name,r);var o=this._configParser.mapModule(r),i=t[o];i||(i=this._configParser.addModule({name:o,dependencies:[]})),this._visit(i)}}e.mark=!0,e.tmpMark=!1,this._result.unshift(e.name)}},_queue:[]},DependencyBuilder}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.URLBuilder=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(e){this._configParser=e}var n=/^https?:\/\/|\/\/|www\./;return t.prototype={constructor:t,build:function(e){var t=[],r=[],o=[],i=[],s=[],u=this._configParser.getConfig(),a=u.basePath||"",l=this._configParser.getModules();a.length&&"/"!==a.charAt(a.length-1)&&(a+="/");for(var c=0;c<e.length;c++){var f=l[e[c]];if(f.fullPath)s.push({modules:[f.name],url:f.fullPath});else{var d=this._getModulePath(f),p=0===d.indexOf("/");n.test(d)?s.push({modules:[f.name],url:d}):u.combine?p?(t.push(d),o.push(f.name)):(r.push(d),i.push(f.name)):s.push({modules:[f.name],url:u.url+(p?"":a)+d})}f.requested=!0}return r.length&&(s.push({modules:i,url:u.url+a+r.join("&"+a)}),r.length=0),t.length&&(s.push({modules:o,url:u.url+t.join("&")}),t.length=0),s},_getModulePath:function(e){var t=e.path||e.name,r=this._configParser.getConfig().paths;for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t===o||0===t.indexOf(o+"/"))&&(t=r[o]+t.substring(o.length));return n.test(t)||t.indexOf(".js")===t.length-3||(t+=".js"),t}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.PathResolver=n}("undefined"!=typeof global?global:this,function(e){"use strict";function t(){}return t.prototype={constructor:t,resolvePath:function(e,t){if("exports"===t||"module"===t||0!==t.indexOf(".")&&0!==t.indexOf(".."))return t;var n=e.split("/");n.splice(-1,1);for(var r=t.split("/"),o=r.splice(-1,1),i=0;i<r.length;i++){var s=r[i];if("."!==s)if(".."===s){if(!n.length){n=n.concat(r.slice(i));break}n.splice(-1,1)}else n.push(s)}return n.push(o),n.join("/")}},t}),function(e,t){"use strict";var n=t(e);"object"==typeof module&&module&&(module.exports=n),"function"==typeof define&&define.amd&&define(t),e.Loader=new n,e.require=e.Loader.require.bind(e.Loader),e.define=e.Loader.define.bind(e.Loader),e.define.amd={}}("undefined"!=typeof global?global:this,function(e){"use strict";function t(n){t.superclass.constructor.apply(this,arguments),this._config=n||e.__CONFIG__,this._modulesMap={}}t.prototype=Object.create(e.EventEmitter.prototype),t.prototype.constructor=t,t.superclass=e.EventEmitter.prototype;var n={addModule:function(e){return this._getConfigParser().addModule(e)},define:function(e,t,n,r){var o=arguments.length;if(!(2>o)){if(2===o){if("string"!=typeof e)return;n=t,t=["module","exports"]}var i=r||{},s=this._getConfigParser(),u=this._getPathResolver();t=t.map(function(t){return u.resolvePath(e,t)}),i.name=e,i.dependencies=t,i.pendingImplementation=n,s.addModule(i),this._modulesMap[i.name]||(this._modulesMap[i.name]=!0),this.emit("moduleRegister",e)}},getConditionalModules:function(){return this._getConfigParser().getConditionalModules()},getModules:function(){return this._getConfigParser().getModules()},require:function(){var e,t,n,r,o=this;if(Array.isArray(arguments[0]))n=arguments[0],r="function"==typeof arguments[1]?arguments[1]:null,e="function"==typeof arguments[2]?arguments[2]:null;else for(n=[],t=0;t<arguments.length;++t)if("string"==typeof arguments[t])n[t]=arguments[t];else if("function"==typeof arguments[t]){r=arguments[t],e="function"==typeof arguments[++t]?arguments[t]:null;break}var i,s=o._getConfigParser(),u=s.mapModule(n);new Promise(function(e,t){o._resolveDependencies(u).then(function(r){var a=s.getConfig();0!==a.waitTimeout&&(i=setTimeout(function(){var e=s.getModules(),o=new Error("Load timeout for modules: "+n);o.dependecies=r,o.mappedModules=u,o.missingDependencies=r.filter(function(t){return!e[t].implementation}),o.modules=n,t(o)},a.waitTimeout||7e3)),o._loadModules(r).then(e,t)},t)}).then(function(e){if(clearTimeout(i),r){var t=o._getModuleImplementations(u);r.apply(r,t)}},function(t){clearTimeout(i),e&&e.call(e,t)})},_createModulePromise:function(e){var t=this;return new Promise(function(n,r){var o=t._getConfigParser().getModules(),i=o[e];if(i.exports){var s=t._getValueGlobalNS(i.exports);if(s)n(s);else{var u=function(o){if(o.indexOf(e)>=0){t.off("scriptLoaded",u);var s=t._getValueGlobalNS(i.exports);s?n(s):r(new Error("Module "+e+" does not export the specified value: "+i.exports))}};t.on("scriptLoaded",u)}}else{var a=function(r){r===e&&(t.off("moduleRegister",a),t._modulesMap[e]=!0,n(e))};t.on("moduleRegister",a)}})},_getConfigParser:function(){return this._configParser||(this._configParser=new e.ConfigParser(this._config)),this._configParser},_getDependencyBuilder:function(){return this._dependencyBuilder||(this._dependencyBuilder=new e.DependencyBuilder(this._getConfigParser())),this._dependencyBuilder},_getValueGlobalNS:function(e){return(0,eval)("this")[e]},_getMissingDepenencies:function(e){for(var t=this._getConfigParser(),n=t.getModules(),r=Object.create(null),o=0;o<e.length;o++)for(var i=n[e[o]],s=t.mapModule(i.dependencies),u=0;u<s.length;u++){var a=s[u],l=n[a];"exports"===a||"module"===a||l&&l.pendingImplementation||(r[a]=1)}return Object.keys(r)},_getModuleImplementations:function(e){for(var t=[],n=this._getConfigParser().getModules(),r=0;r<e.length;r++){var o=n[e[r]];t.push(o?o.implementation:void 0)}return t},_getPathResolver:function(){return this._pathResolver||(this._pathResolver=new e.PathResolver),this._pathResolver},_getURLBuilder:function(){return this._urlBuilder||(this._urlBuilder=new e.URLBuilder(this._getConfigParser())),this._urlBuilder},_filterNotRequestedModules:function(e){for(var t=[],n=this._getConfigParser().getModules(),r=0;r<e.length;r++){var o=n[e[r]];"exports"===o||"module"===o||o&&o.requested||t.push(e[r])}return t},_loadModules:function(e){var t=this;return new Promise(function(n,r){var o=t._filterNotRequestedModules(e);if(o.length){for(var i=t._getURLBuilder().build(o),s=[],u=0;u<i.length;u++)s.push(t._loadScript(i[u]));Promise.all(s).then(function(n){return t._waitForModules(e)}).then(function(e){n(e)})["catch"](function(e){r(e)})}else t._waitForModules(e).then(function(e){n(e)})["catch"](function(e){r(e)})})},_loadScript:function(e){var t=this;return new Promise(function(n,r){var o=document.createElement("script");o.src=e.url,o.onload=o.onreadystatechange=function(){this.readyState&&"complete"!==this.readyState&&"load"!==this.readyState||(o.onload=o.onreadystatechange=null,n(o),t.emit("scriptLoaded",e.modules))},o.onerror=function(){document.head.removeChild(o),r(o)},document.head.appendChild(o)})},_resolveDependencies:function(e){var t=this;return new Promise(function(n,r){try{var o=t._getDependencyBuilder().resolveDependencies(e);n(o)}catch(i){r(i)}})},_setModuleImplementation:function(e){for(var t=this._getConfigParser().getModules(),n=0;n<e.length;n++){var r=e[n];if(!r.implementation)if(r.exports)r.pendingImplementation=r.implementation=this._getValueGlobalNS(r.exports);else{for(var o,i=[],s=this._getConfigParser(),u=0;u<r.dependencies.length;u++){var a=r.dependencies[u];if("exports"===a)o={},i.push(o);else if("module"===a)o={exports:{}},i.push(o);else{var l=t[s.mapModule(a)],c=l.implementation;i.push(c)}}var f;f="function"==typeof r.pendingImplementation?r.pendingImplementation.apply(r.pendingImplementation,i):r.pendingImplementation,f?r.implementation=f:o&&(r.implementation=o.exports||o)}}},_waitForModule:function(e){var t=this,n=t._modulesMap[e];return n||(n=t._createModulePromise(e),t._modulesMap[e]=n),n},_waitForModules:function(e){var t=this;return new Promise(function(n,r){for(var o=[],i=0;i<e.length;i++)o.push(t._waitForModule(e[i]));Promise.all(o).then(function(o){var i=t._getConfigParser().getModules(),s=function(){for(var r=[],o=0;o<e.length;o++)r.push(i[e[o]]);t._setModuleImplementation(r),n(r)},u=t._getMissingDepenencies(e);u.length?t.require(u,s,r):s()},r)})}};return Object.keys(n).forEach(function(e){t.prototype[e]=n[e]}),t}),window.Loader=global.Loader,window.require=global.require,window.define=global.define}(); |
@@ -69,3 +69,3 @@ 'use strict'; | ||
.pipe(template({ | ||
vendor: fs.readFileSync('src/vendor/promise.js').toString(), | ||
vendor: fs.readFileSync('node_modules/es6-promise/dist/es6-promise.js').toString(), | ||
source: fs.readFileSync('dist/loader-pure-debug.js').toString() | ||
@@ -72,0 +72,0 @@ })) |
{ | ||
"name": "liferay-amd-loader", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "AMD Loader with support for combo URL and conditional loading", | ||
@@ -31,2 +31,3 @@ "main": "main.js", | ||
"del": "^2.2.0", | ||
"es6-promise": "^3.0.2", | ||
"escodegen": "^1.6.1", | ||
@@ -33,0 +34,0 @@ "gulp": "^3.9.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
991793
12390
24
150
1
6
11