You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
4.8 KiB
1 lines
4.8 KiB
{"version":3,"file":"global.min.js","sources":["../../src/extras/global.js"],"sourcesContent":["/*\n * SystemJS global script loading support\n * Extra for the s.js build only\n * (Included by default in system.js build)\n */\n(function (global) {\n var systemJSPrototype = global.System.constructor.prototype;\n\n // safari unpredictably lists some new globals first or second in object order\n var firstGlobalProp, secondGlobalProp, lastGlobalProp;\n function getGlobalProp (useFirstGlobalProp) {\n var cnt = 0;\n var foundLastProp, result;\n for (var p in global) {\n // do not check frames cause it could be removed during import\n if (shouldSkipProperty(p))\n continue;\n if (cnt === 0 && p !== firstGlobalProp || cnt === 1 && p !== secondGlobalProp)\n return p;\n if (foundLastProp) {\n lastGlobalProp = p;\n result = useFirstGlobalProp && result || p;\n }\n else {\n foundLastProp = p === lastGlobalProp;\n }\n cnt++;\n }\n return result;\n }\n\n function noteGlobalProps () {\n // alternatively Object.keys(global).pop()\n // but this may be faster (pending benchmarks)\n firstGlobalProp = secondGlobalProp = undefined;\n for (var p in global) {\n // do not check frames cause it could be removed during import\n if (shouldSkipProperty(p))\n continue;\n if (!firstGlobalProp)\n firstGlobalProp = p;\n else if (!secondGlobalProp)\n secondGlobalProp = p;\n lastGlobalProp = p;\n }\n return lastGlobalProp;\n }\n\n var impt = systemJSPrototype.import;\n systemJSPrototype.import = function (id, parentUrl) {\n noteGlobalProps();\n return impt.call(this, id, parentUrl);\n };\n\n var emptyInstantiation = [[], function () { return {} }];\n\n var getRegister = systemJSPrototype.getRegister;\n systemJSPrototype.getRegister = function () {\n var lastRegister = getRegister.call(this);\n if (lastRegister)\n return lastRegister;\n\n // no registration -> attempt a global detection as difference from snapshot\n // when multiple globals, we take the global value to be the last defined new global object property\n // for performance, this will not support multi-version / global collisions as previous SystemJS versions did\n // note in Edge, deleting and re-adding a global does not change its ordering\n var globalProp = getGlobalProp(this.firstGlobalProp);\n if (!globalProp)\n return emptyInstantiation;\n\n var globalExport;\n try {\n globalExport = global[globalProp];\n }\n catch (e) {\n return emptyInstantiation;\n }\n\n return [[], function (_export) {\n return {\n execute: function () {\n _export(globalExport);\n _export({ default: globalExport, __useDefault: true });\n }\n };\n }];\n };\n\n var isIE11 = typeof navigator !== 'undefined' && navigator.userAgent.indexOf('Trident') !== -1;\n\n function shouldSkipProperty(p) {\n return !global.hasOwnProperty(p)\n || !isNaN(p) && p < global.length\n || isIE11 && global[p] && typeof window !== 'undefined' && global[p].parent === window;\n }\n})(typeof self !== 'undefined' ? self : global);\n"],"names":["global","shouldSkipProperty","p","hasOwnProperty","isNaN","length","isIE11","window","parent","firstGlobalProp","secondGlobalProp","lastGlobalProp","systemJSPrototype","System","constructor","prototype","impt","import","id","parentUrl","undefined","noteGlobalProps","call","this","emptyInstantiation","getRegister","lastRegister","globalExport","globalProp","useFirstGlobalProp","foundLastProp","result","cnt","getGlobalProp","e","_export","execute","default","__useDefault","navigator","userAgent","indexOf","self"],"mappings":"CAKA,SAAWA,GAqFT,SAASC,EAAmBC,GAC1B,OAAQF,EAAOG,eAAeD,KACxBE,MAAMF,IAAUF,EAAOK,OAAXH,GACbI,GAAUN,EAAOE,IAAwB,oBAAXK,QAA0BP,EAAOE,GAAGM,SAAWD,OAvFpF,IAGIE,EAAiBC,EAAkBC,EAHnCC,EAAoBZ,EAAOa,OAAOC,YAAYC,UA0C9CC,EAAOJ,EAAkBK,OAC7BL,EAAkBK,OAAS,SAAUC,EAAIC,GAEvC,OApBF,WAIE,IAAK,IAAIjB,KADTO,EAAkBC,OAAmBU,EACvBpB,EAERC,EAAmBC,KAElBO,EAEKC,IACRA,EAAmBR,GAFnBO,EAAkBP,EAGpBS,EAAiBT,GAOnBmB,GACOL,EAAKM,KAAKC,KAAML,EAAIC,IAG7B,IAAIK,EAAqB,CAAC,GAAI,WAAc,MAAO,KAE/CC,EAAcb,EAAkBa,YACpCb,EAAkBa,YAAc,WAC9B,IAAIC,EAAeD,EAAYH,KAAKC,MACp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