1 line
78 KiB
Plaintext
1 line
78 KiB
Plaintext
|
{"version":3,"file":"browser-es-module-loader.js","sources":["../../../node_modules/es-module-loader/core/common.js","../../../node_modules/es-module-loader/core/loader-polyfill.js","../../../node_modules/es-module-loader/core/resolve.js","../../../node_modules/es-module-loader/core/register-loader.js","../src/browser-es-module-loader.js"],"sourcesContent":["/*\n * Environment\n */\nexport var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\nexport var isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\nexport var isWindows = typeof process !== 'undefined' && typeof process.platform === 'string' && process.platform.match(/^win/);\n\nvar envGlobal = typeof self !== 'undefined' ? self : global;\nexport { envGlobal as global }\n\n/*\n * Simple Symbol() shim\n */\nvar hasSymbol = typeof Symbol !== 'undefined';\nexport function createSymbol (name) {\n return hasSymbol ? Symbol() : '@@' + name;\n}\n\nexport function pathToFileUrl (filePath) {\n return 'file://' + (isWindows ? '/' : '') + (isWindows ? filePath.replace(/\\\\/g, '/') : filePath);\n}\n\nexport function fileUrlToPath (fileUrl) {\n if (fileUrl.substr(0, 7) !== 'file://')\n throw new RangeError(fileUrl + ' is not a valid file url');\n if (isWindows)\n return fileUrl.substr(8).replace(/\\\\/g, '/');\n else\n return fileUrl.substr(7);\n}\n\n/*\n * Environment baseURI\n */\nexport var baseURI;\n\n// environent baseURI detection\nif (typeof document != 'undefined' && document.getElementsByTagName) {\n baseURI = document.baseURI;\n\n if (!baseURI) {\n var bases = document.getElementsByTagName('base');\n baseURI = bases[0] && bases[0].href || window.location.href;\n }\n}\nelse if (typeof location != 'undefined') {\n baseURI = location.href;\n}\n\n// sanitize out the hash and querystring\nif (baseURI) {\n baseURI = baseURI.split('#')[0].split('?')[0];\n var slashIndex = baseURI.lastIndexOf('/');\n if (slashIndex !== -1)\n baseURI = baseURI.substr(0, slashIndex + 1);\n}\nelse if (typeof process !== 'undefined' && process.cwd) {\n baseURI = 'file://' + (isWindows ? '/' : '') + process.cwd();\n if (isWindows)\n baseURI = baseURI.replace(/\\\\/g, '/');\n}\nelse {\n throw new TypeError('No environment baseURI');\n}\n\n// ensure baseURI has trailing \"/\"\nif (baseURI[baseURI.length - 1] !== '/')\n baseURI += '/';\n\n/*\n * LoaderError with chaining for loader stacks\n */\nvar errArgs = new Error(0, '_').fileName == '_';\nfunction LoaderError__Check_error_message_for_loader_stack (childErr, newMessage) {\n // Convert file:/// URLs to paths in Node\n if (!isBrowser)\n newMessage = newMessage.replace(isWindows ? /file:\\/\\/\\//g : /file:\\/\\//g, '');\n\n var message = (childErr.message || childErr) + '\\n ' + newMessage;\n\n var err;\n if (errArgs && childErr.fileName)\n err = new Error(message, childErr.fileName, childErr.lineNumber);\n else\n err = new Error(message);\n\n\n var stack = childErr.originalErr ? childErr.originalErr.stack : childErr.stack;\n\n if (isNode)\n // node doesn't show the message otherwise\n err.stack = message + '\\n ' + stack;\n else\n err.stack = stack;\n\n err.originalErr = childErr.originalErr || childErr;\n\n return err;\n}\nexport { LoaderError__Check_error_message_for_loader_stack as addToError }\n","import { addToError, createSymbol } from './common.js';\n\nexport { Loader, ModuleNamespace, REGISTRY }\n\nvar resolvedPromise = Promise.resolve();\n\n/*\n * Simple Array values shim\n */\nfunction arrayValues (arr) {\n if (arr.values)\n return arr.values();\n\n if (typeof Symbol === 'undefined' || !Symbol.iterator)\n throw new Error('Symbol.iterator not supported in this browser');\n\n var iterable = {};\n iterable[Symbol.iterator] = function () {\n var keys = Object.keys(arr);\n var keyIndex = 0;\n return {\n next: function () {\n if (keyIndex < keys.length)\n return {\n value: arr[keys[keyIndex++]],\n done: false\n };\n else\n retu
|