diff options
Diffstat (limited to 'js/vendor/traceur-runtime')
-rw-r--r-- | js/vendor/traceur-runtime/.bower.json | 21 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/README.md | 35 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/bower.json | 11 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.js | 2412 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.min.js | 2412 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.min.map | 1 |
6 files changed, 0 insertions, 4892 deletions
diff --git a/js/vendor/traceur-runtime/.bower.json b/js/vendor/traceur-runtime/.bower.json deleted file mode 100644 index 61fc26bcd..000000000 --- a/js/vendor/traceur-runtime/.bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "traceur-runtime", - "version": "0.0.60", - "main": "./traceur-runtime.js", - "ignore": [ - "node_modules", - "Gruntfile.js", - "*.json", - ".*" - ], - "homepage": "https://github.com/jmcriffey/bower-traceur-runtime", - "_release": "0.0.60", - "_resolution": { - "type": "version", - "tag": "0.0.60", - "commit": "74f6bf024d21aa5bd7d32edf5e0ee50dfe370845" - }, - "_source": "git://github.com/jmcriffey/bower-traceur-runtime.git", - "_target": "~0.0.60", - "_originalSource": "traceur-runtime" -}
\ No newline at end of file diff --git a/js/vendor/traceur-runtime/README.md b/js/vendor/traceur-runtime/README.md deleted file mode 100644 index a1150103b..000000000 --- a/js/vendor/traceur-runtime/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# bower-traceur-runtime - -This repo is for distribution on `bower`. The source for this module is in the -[main traceur repo](https://github.com/google/traceur-compiler/). -Please file issues and pull requests against that repo. - -## Install - -Install with `bower`: - -```shell -bower install traceur-runtime -``` - -Add a `<script>` to your `index.html`: - -```html -<script src="/bower_components/traceur-runtime/traceur-runtime.js"></script> -``` - -## License - -Copyright 2012 Traceur Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/js/vendor/traceur-runtime/bower.json b/js/vendor/traceur-runtime/bower.json deleted file mode 100644 index d7f81ae02..000000000 --- a/js/vendor/traceur-runtime/bower.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "traceur-runtime", - "version": "0.0.60", - "main": "./traceur-runtime.js", - "ignore": [ - "node_modules", - "Gruntfile.js", - "*.json", - ".*" - ] -} diff --git a/js/vendor/traceur-runtime/traceur-runtime.js b/js/vendor/traceur-runtime/traceur-runtime.js deleted file mode 100644 index aacdc2ff7..000000000 --- a/js/vendor/traceur-runtime/traceur-runtime.js +++ /dev/null @@ -1,2412 +0,0 @@ -(function(global) { - 'use strict'; - if (global.$traceurRuntime) { - return; - } - var $Object = Object; - var $TypeError = TypeError; - var $create = $Object.create; - var $defineProperties = $Object.defineProperties; - var $defineProperty = $Object.defineProperty; - var $freeze = $Object.freeze; - var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; - var $getOwnPropertyNames = $Object.getOwnPropertyNames; - var $keys = $Object.keys; - var $hasOwnProperty = $Object.prototype.hasOwnProperty; - var $toString = $Object.prototype.toString; - var $preventExtensions = Object.preventExtensions; - var $seal = Object.seal; - var $isExtensible = Object.isExtensible; - function nonEnum(value) { - return { - configurable: true, - enumerable: false, - value: value, - writable: true - }; - } - var types = { - void: function voidType() {}, - any: function any() {}, - string: function string() {}, - number: function number() {}, - boolean: function boolean() {} - }; - var method = nonEnum; - var counter = 0; - function newUniqueString() { - return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; - } - var symbolInternalProperty = newUniqueString(); - var symbolDescriptionProperty = newUniqueString(); - var symbolDataProperty = newUniqueString(); - var symbolValues = $create(null); - var privateNames = $create(null); - function createPrivateName() { - var s = newUniqueString(); - privateNames[s] = true; - return s; - } - function isSymbol(symbol) { - return typeof symbol === 'object' && symbol instanceof SymbolValue; - } - function typeOf(v) { - if (isSymbol(v)) - return 'symbol'; - return typeof v; - } - function Symbol(description) { - var value = new SymbolValue(description); - if (!(this instanceof Symbol)) - return value; - throw new TypeError('Symbol cannot be new\'ed'); - } - $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); - $defineProperty(Symbol.prototype, 'toString', method(function() { - var symbolValue = this[symbolDataProperty]; - if (!getOption('symbols')) - return symbolValue[symbolInternalProperty]; - if (!symbolValue) - throw TypeError('Conversion from symbol to string'); - var desc = symbolValue[symbolDescriptionProperty]; - if (desc === undefined) - desc = ''; - return 'Symbol(' + desc + ')'; - })); - $defineProperty(Symbol.prototype, 'valueOf', method(function() { - var symbolValue = this[symbolDataProperty]; - if (!symbolValue) - throw TypeError('Conversion from symbol to string'); - if (!getOption('symbols')) - return symbolValue[symbolInternalProperty]; - return symbolValue; - })); - function SymbolValue(description) { - var key = newUniqueString(); - $defineProperty(this, symbolDataProperty, {value: this}); - $defineProperty(this, symbolInternalProperty, {value: key}); - $defineProperty(this, symbolDescriptionProperty, {value: description}); - freeze(this); - symbolValues[key] = this; - } - $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); - $defineProperty(SymbolValue.prototype, 'toString', { - value: Symbol.prototype.toString, - enumerable: false - }); - $defineProperty(SymbolValue.prototype, 'valueOf', { - value: Symbol.prototype.valueOf, - enumerable: false - }); - var hashProperty = createPrivateName(); - var hashPropertyDescriptor = {value: undefined}; - var hashObjectProperties = { - hash: {value: undefined}, - self: {value: undefined} - }; - var hashCounter = 0; - function getOwnHashObject(object) { - var hashObject = object[hashProperty]; - if (hashObject && hashObject.self === object) - return hashObject; - if ($isExtensible(object)) { - hashObjectProperties.hash.value = hashCounter++; - hashObjectProperties.self.value = object; - hashPropertyDescriptor.value = $create(null, hashObjectProperties); - $defineProperty(object, hashProperty, hashPropertyDescriptor); - return hashPropertyDescriptor.value; - } - return undefined; - } - function freeze(object) { - getOwnHashObject(object); - return $freeze.apply(this, arguments); - } - function preventExtensions(object) { - getOwnHashObject(object); - return $preventExtensions.apply(this, arguments); - } - function seal(object) { - getOwnHashObject(object); - return $seal.apply(this, arguments); - } - Symbol.iterator = Symbol(); - freeze(SymbolValue.prototype); - function toProperty(name) { - if (isSymbol(name)) - return name[symbolInternalProperty]; - return name; - } - function getOwnPropertyNames(object) { - var rv = []; - var names = $getOwnPropertyNames(object); - for (var i = 0; i < names.length; i++) { - var name = names[i]; - if (!symbolValues[name] && !privateNames[name]) - rv.push(name); - } - return rv; - } - function getOwnPropertyDescriptor(object, name) { - return $getOwnPropertyDescriptor(object, toProperty(name)); - } - function getOwnPropertySymbols(object) { - var rv = []; - var names = $getOwnPropertyNames(object); - for (var i = 0; i < names.length; i++) { - var symbol = symbolValues[names[i]]; - if (symbol) - rv.push(symbol); - } - return rv; - } - function hasOwnProperty(name) { - return $hasOwnProperty.call(this, toProperty(name)); - } - function getOption(name) { - return global.traceur && global.traceur.options[name]; - } - function setProperty(object, name, value) { - var sym, - desc; - if (isSymbol(name)) { - sym = name; - name = name[symbolInternalProperty]; - } - object[name] = value; - if (sym && (desc = $getOwnPropertyDescriptor(object, name))) - $defineProperty(object, name, {enumerable: false}); - return value; - } - function defineProperty(object, name, descriptor) { - if (isSymbol(name)) { - if (descriptor.enumerable) { - descriptor = $create(descriptor, {enumerable: {value: false}}); - } - name = name[symbolInternalProperty]; - } - $defineProperty(object, name, descriptor); - return object; - } - function polyfillObject(Object) { - $defineProperty(Object, 'defineProperty', {value: defineProperty}); - $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); - $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); - $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); - $defineProperty(Object, 'freeze', {value: freeze}); - $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); - $defineProperty(Object, 'seal', {value: seal}); - Object.getOwnPropertySymbols = getOwnPropertySymbols; - } - function exportStar(object) { - for (var i = 1; i < arguments.length; i++) { - var names = $getOwnPropertyNames(arguments[i]); - for (var j = 0; j < names.length; j++) { - var name = names[j]; - if (privateNames[name]) - continue; - (function(mod, name) { - $defineProperty(object, name, { - get: function() { - return mod[name]; - }, - enumerable: true - }); - })(arguments[i], names[j]); - } - } - return object; - } - function isObject(x) { - return x != null && (typeof x === 'object' || typeof x === 'function'); - } - function toObject(x) { - if (x == null) - throw $TypeError(); - return $Object(x); - } - function checkObjectCoercible(argument) { - if (argument == null) { - throw new TypeError('Value cannot be converted to an Object'); - } - return argument; - } - function setupGlobals(global) { - global.Symbol = Symbol; - global.Reflect = global.Reflect || {}; - global.Reflect.global = global.Reflect.global || global; - polyfillObject(global.Object); - } - setupGlobals(global); - global.$traceurRuntime = { - createPrivateName: createPrivateName, - exportStar: exportStar, - getOwnHashObject: getOwnHashObject, - privateNames: privateNames, - setProperty: setProperty, - setupGlobals: setupGlobals, - toObject: toObject, - isObject: isObject, - toProperty: toProperty, - type: types, - typeof: typeOf, - checkObjectCoercible: checkObjectCoercible, - hasOwnProperty: function(o, p) { - return hasOwnProperty.call(o, p); - }, - defineProperties: $defineProperties, - defineProperty: $defineProperty, - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - getOwnPropertyNames: $getOwnPropertyNames, - keys: $keys - }; -})(typeof global !== 'undefined' ? global : this); -(function() { - 'use strict'; - function spread() { - var rv = [], - j = 0, - iterResult; - for (var i = 0; i < arguments.length; i++) { - var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]); - if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') { - throw new TypeError('Cannot spread non-iterable object.'); - } - var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)](); - while (!(iterResult = iter.next()).done) { - rv[j++] = iterResult.value; - } - } - return rv; - } - $traceurRuntime.spread = spread; -})(); -(function() { - 'use strict'; - var $Object = Object; - var $TypeError = TypeError; - var $create = $Object.create; - var $defineProperties = $traceurRuntime.defineProperties; - var $defineProperty = $traceurRuntime.defineProperty; - var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; - var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames; - var $getPrototypeOf = Object.getPrototypeOf; - function superDescriptor(homeObject, name) { - var proto = $getPrototypeOf(homeObject); - do { - var result = $getOwnPropertyDescriptor(proto, name); - if (result) - return result; - proto = $getPrototypeOf(proto); - } while (proto); - return undefined; - } - function superCall(self, homeObject, name, args) { - return superGet(self, homeObject, name).apply(self, args); - } - function superGet(self, homeObject, name) { - var descriptor = superDescriptor(homeObject, name); - if (descriptor) { - if (!descriptor.get) - return descriptor.value; - return descriptor.get.call(self); - } - return undefined; - } - function superSet(self, homeObject, name, value) { - var descriptor = superDescriptor(homeObject, name); - if (descriptor && descriptor.set) { - descriptor.set.call(self, value); - return value; - } - throw $TypeError("super has no setter '" + name + "'."); - } - function getDescriptors(object) { - var descriptors = {}, - name, - names = $getOwnPropertyNames(object); - for (var i = 0; i < names.length; i++) { - var name = names[i]; - descriptors[name] = $getOwnPropertyDescriptor(object, name); - } - return descriptors; - } - function createClass(ctor, object, staticObject, superClass) { - $defineProperty(object, 'constructor', { - value: ctor, - configurable: true, - enumerable: false, - writable: true - }); - if (arguments.length > 3) { - if (typeof superClass === 'function') - ctor.__proto__ = superClass; - ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); - } else { - ctor.prototype = object; - } - $defineProperty(ctor, 'prototype', { - configurable: false, - writable: false - }); - return $defineProperties(ctor, getDescriptors(staticObject)); - } - function getProtoParent(superClass) { - if (typeof superClass === 'function') { - var prototype = superClass.prototype; - if ($Object(prototype) === prototype || prototype === null) - return superClass.prototype; - throw new $TypeError('super prototype must be an Object or null'); - } - if (superClass === null) - return null; - throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + ".")); - } - function defaultSuperCall(self, homeObject, args) { - if ($getPrototypeOf(homeObject) !== null) - superCall(self, homeObject, 'constructor', args); - } - $traceurRuntime.createClass = createClass; - $traceurRuntime.defaultSuperCall = defaultSuperCall; - $traceurRuntime.superCall = superCall; - $traceurRuntime.superGet = superGet; - $traceurRuntime.superSet = superSet; -})(); -(function() { - 'use strict'; - var createPrivateName = $traceurRuntime.createPrivateName; - var $defineProperties = $traceurRuntime.defineProperties; - var $defineProperty = $traceurRuntime.defineProperty; - var $create = Object.create; - var $TypeError = TypeError; - function nonEnum(value) { - return { - configurable: true, - enumerable: false, - value: value, - writable: true - }; - } - var ST_NEWBORN = 0; - var ST_EXECUTING = 1; - var ST_SUSPENDED = 2; - var ST_CLOSED = 3; - var END_STATE = -2; - var RETHROW_STATE = -3; - function getInternalError(state) { - return new Error('Traceur compiler bug: invalid state in state machine: ' + state); - } - function GeneratorContext() { - this.state = 0; - this.GState = ST_NEWBORN; - this.storedException = undefined; - this.finallyFallThrough = undefined; - this.sent_ = undefined; - this.returnValue = undefined; - this.tryStack_ = []; - } - GeneratorContext.prototype = { - pushTry: function(catchState, finallyState) { - if (finallyState !== null) { - var finallyFallThrough = null; - for (var i = this.tryStack_.length - 1; i >= 0; i--) { - if (this.tryStack_[i].catch !== undefined) { - finallyFallThrough = this.tryStack_[i].catch; - break; - } - } - if (finallyFallThrough === null) - finallyFallThrough = RETHROW_STATE; - this.tryStack_.push({ - finally: finallyState, - finallyFallThrough: finallyFallThrough - }); - } - if (catchState !== null) { - this.tryStack_.push({catch: catchState}); - } - }, - popTry: function() { - this.tryStack_.pop(); - }, - get sent() { - this.maybeThrow(); - return this.sent_; - }, - set sent(v) { - this.sent_ = v; - }, - get sentIgnoreThrow() { - return this.sent_; - }, - maybeThrow: function() { - if (this.action === 'throw') { - this.action = 'next'; - throw this.sent_; - } - }, - end: function() { - switch (this.state) { - case END_STATE: - return this; - case RETHROW_STATE: - throw this.storedException; - default: - throw getInternalError(this.state); - } - }, - handleException: function(ex) { - this.GState = ST_CLOSED; - this.state = END_STATE; - throw ex; - } - }; - function nextOrThrow(ctx, moveNext, action, x) { - switch (ctx.GState) { - case ST_EXECUTING: - throw new Error(("\"" + action + "\" on executing generator")); - case ST_CLOSED: - if (action == 'next') { - return { - value: undefined, - done: true - }; - } - throw x; - case ST_NEWBORN: - if (action === 'throw') { - ctx.GState = ST_CLOSED; - throw x; - } - if (x !== undefined) - throw $TypeError('Sent value to newborn generator'); - case ST_SUSPENDED: - ctx.GState = ST_EXECUTING; - ctx.action = action; - ctx.sent = x; - var value = moveNext(ctx); - var done = value === ctx; - if (done) - value = ctx.returnValue; - ctx.GState = done ? ST_CLOSED : ST_SUSPENDED; - return { - value: value, - done: done - }; - } - } - var ctxName = createPrivateName(); - var moveNextName = createPrivateName(); - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - GeneratorFunction.prototype = GeneratorFunctionPrototype; - $defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction)); - GeneratorFunctionPrototype.prototype = { - constructor: GeneratorFunctionPrototype, - next: function(v) { - return nextOrThrow(this[ctxName], this[moveNextName], 'next', v); - }, - throw: function(v) { - return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v); - } - }; - $defineProperties(GeneratorFunctionPrototype.prototype, { - constructor: {enumerable: false}, - next: {enumerable: false}, - throw: {enumerable: false} - }); - Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { - return this; - })); - function createGeneratorInstance(innerFunction, functionObject, self) { - var moveNext = getMoveNext(innerFunction, self); - var ctx = new GeneratorContext(); - var object = $create(functionObject.prototype); - object[ctxName] = ctx; - object[moveNextName] = moveNext; - return object; - } - function initGeneratorFunction(functionObject) { - functionObject.prototype = $create(GeneratorFunctionPrototype.prototype); - functionObject.__proto__ = GeneratorFunctionPrototype; - return functionObject; - } - function AsyncFunctionContext() { - GeneratorContext.call(this); - this.err = undefined; - var ctx = this; - ctx.result = new Promise(function(resolve, reject) { - ctx.resolve = resolve; - ctx.reject = reject; - }); - } - AsyncFunctionContext.prototype = $create(GeneratorContext.prototype); - AsyncFunctionContext.prototype.end = function() { - switch (this.state) { - case END_STATE: - this.resolve(this.returnValue); - break; - case RETHROW_STATE: - this.reject(this.storedException); - break; - default: - this.reject(getInternalError(this.state)); - } - }; - AsyncFunctionContext.prototype.handleException = function() { - this.state = RETHROW_STATE; - }; - function asyncWrap(innerFunction, self) { - var moveNext = getMoveNext(innerFunction, self); - var ctx = new AsyncFunctionContext(); - ctx.createCallback = function(newState) { - return function(value) { - ctx.state = newState; - ctx.value = value; - moveNext(ctx); - }; - }; - ctx.errback = function(err) { - handleCatch(ctx, err); - moveNext(ctx); - }; - moveNext(ctx); - return ctx.result; - } - function getMoveNext(innerFunction, self) { - return function(ctx) { - while (true) { - try { - return innerFunction.call(self, ctx); - } catch (ex) { - handleCatch(ctx, ex); - } - } - }; - } - function handleCatch(ctx, ex) { - ctx.storedException = ex; - var last = ctx.tryStack_[ctx.tryStack_.length - 1]; - if (!last) { - ctx.handleException(ex); - return; - } - ctx.state = last.catch !== undefined ? last.catch : last.finally; - if (last.finallyFallThrough !== undefined) - ctx.finallyFallThrough = last.finallyFallThrough; - } - $traceurRuntime.asyncWrap = asyncWrap; - $traceurRuntime.initGeneratorFunction = initGeneratorFunction; - $traceurRuntime.createGeneratorInstance = createGeneratorInstance; -})(); -(function() { - function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { - var out = []; - if (opt_scheme) { - out.push(opt_scheme, ':'); - } - if (opt_domain) { - out.push('//'); - if (opt_userInfo) { - out.push(opt_userInfo, '@'); - } - out.push(opt_domain); - if (opt_port) { - out.push(':', opt_port); - } - } - if (opt_path) { - out.push(opt_path); - } - if (opt_queryData) { - out.push('?', opt_queryData); - } - if (opt_fragment) { - out.push('#', opt_fragment); - } - return out.join(''); - } - ; - var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); - var ComponentIndex = { - SCHEME: 1, - USER_INFO: 2, - DOMAIN: 3, - PORT: 4, - PATH: 5, - QUERY_DATA: 6, - FRAGMENT: 7 - }; - function split(uri) { - return (uri.match(splitRe)); - } - function removeDotSegments(path) { - if (path === '/') - return '/'; - var leadingSlash = path[0] === '/' ? '/' : ''; - var trailingSlash = path.slice(-1) === '/' ? '/' : ''; - var segments = path.split('/'); - var out = []; - var up = 0; - for (var pos = 0; pos < segments.length; pos++) { - var segment = segments[pos]; - switch (segment) { - case '': - case '.': - break; - case '..': - if (out.length) - out.pop(); - else - up++; - break; - default: - out.push(segment); - } - } - if (!leadingSlash) { - while (up-- > 0) { - out.unshift('..'); - } - if (out.length === 0) - out.push('.'); - } - return leadingSlash + out.join('/') + trailingSlash; - } - function joinAndCanonicalizePath(parts) { - var path = parts[ComponentIndex.PATH] || ''; - path = removeDotSegments(path); - parts[ComponentIndex.PATH] = path; - return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]); - } - function canonicalizeUrl(url) { - var parts = split(url); - return joinAndCanonicalizePath(parts); - } - function resolveUrl(base, url) { - var parts = split(url); - var baseParts = split(base); - if (parts[ComponentIndex.SCHEME]) { - return joinAndCanonicalizePath(parts); - } else { - parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME]; - } - for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) { - if (!parts[i]) { - parts[i] = baseParts[i]; - } - } - if (parts[ComponentIndex.PATH][0] == '/') { - return joinAndCanonicalizePath(parts); - } - var path = baseParts[ComponentIndex.PATH]; - var index = path.lastIndexOf('/'); - path = path.slice(0, index + 1) + parts[ComponentIndex.PATH]; - parts[ComponentIndex.PATH] = path; - return joinAndCanonicalizePath(parts); - } - function isAbsolute(name) { - if (!name) - return false; - if (name[0] === '/') - return true; - var parts = split(name); - if (parts[ComponentIndex.SCHEME]) - return true; - return false; - } - $traceurRuntime.canonicalizeUrl = canonicalizeUrl; - $traceurRuntime.isAbsolute = isAbsolute; - $traceurRuntime.removeDotSegments = removeDotSegments; - $traceurRuntime.resolveUrl = resolveUrl; -})(); -(function(global) { - 'use strict'; - var $__2 = $traceurRuntime, - canonicalizeUrl = $__2.canonicalizeUrl, - resolveUrl = $__2.resolveUrl, - isAbsolute = $__2.isAbsolute; - var moduleInstantiators = Object.create(null); - var baseURL; - if (global.location && global.location.href) - baseURL = resolveUrl(global.location.href, './'); - else - baseURL = ''; - var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) { - this.url = url; - this.value_ = uncoatedModule; - }; - ($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {}); - var ModuleEvaluationError = function ModuleEvaluationError(erroneousModuleName, cause) { - this.message = this.constructor.name + (cause ? ': \'' + cause + '\'' : '') + ' in ' + erroneousModuleName; - }; - ($traceurRuntime.createClass)(ModuleEvaluationError, {loadedBy: function(moduleName) { - this.message += '\n loaded by ' + moduleName; - }}, {}, Error); - var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) { - $traceurRuntime.superCall(this, $UncoatedModuleInstantiator.prototype, "constructor", [url, null]); - this.func = func; - }; - var $UncoatedModuleInstantiator = UncoatedModuleInstantiator; - ($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() { - if (this.value_) - return this.value_; - try { - return this.value_ = this.func.call(global); - } catch (ex) { - if (ex instanceof ModuleEvaluationError) { - ex.loadedBy(this.url); - throw ex; - } - throw new ModuleEvaluationError(this.url, ex); - } - }}, {}, UncoatedModuleEntry); - function getUncoatedModuleInstantiator(name) { - if (!name) - return; - var url = ModuleStore.normalize(name); - return moduleInstantiators[url]; - } - ; - var moduleInstances = Object.create(null); - var liveModuleSentinel = {}; - function Module(uncoatedModule) { - var isLive = arguments[1]; - var coatedModule = Object.create(null); - Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) { - var getter, - value; - if (isLive === liveModuleSentinel) { - var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name); - if (descr.get) - getter = descr.get; - } - if (!getter) { - value = uncoatedModule[name]; - getter = function() { - return value; - }; - } - Object.defineProperty(coatedModule, name, { - get: getter, - enumerable: true - }); - })); - Object.preventExtensions(coatedModule); - return coatedModule; - } - var ModuleStore = { - normalize: function(name, refererName, refererAddress) { - if (typeof name !== "string") - throw new TypeError("module name must be a string, not " + typeof name); - if (isAbsolute(name)) - return canonicalizeUrl(name); - if (/[^\.]\/\.\.\//.test(name)) { - throw new Error('module name embeds /../: ' + name); - } - if (name[0] === '.' && refererName) - return resolveUrl(refererName, name); - return canonicalizeUrl(name); - }, - get: function(normalizedName) { - var m = getUncoatedModuleInstantiator(normalizedName); - if (!m) - return undefined; - var moduleInstance = moduleInstances[m.url]; - if (moduleInstance) - return moduleInstance; - moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel); - return moduleInstances[m.url] = moduleInstance; - }, - set: function(normalizedName, module) { - normalizedName = String(normalizedName); - moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() { - return module; - })); - moduleInstances[normalizedName] = module; - }, - get baseURL() { - return baseURL; - }, - set baseURL(v) { - baseURL = String(v); - }, - registerModule: function(name, func) { - var normalizedName = ModuleStore.normalize(name); - if (moduleInstantiators[normalizedName]) - throw new Error('duplicate module named ' + normalizedName); - moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func); - }, - bundleStore: Object.create(null), - register: function(name, deps, func) { - if (!deps || !deps.length && !func.length) { - this.registerModule(name, func); - } else { - this.bundleStore[name] = { - deps: deps, - execute: function() { - var $__0 = arguments; - var depMap = {}; - deps.forEach((function(dep, index) { - return |