diff options
Diffstat (limited to 'js/vendor/traceur-runtime/traceur-runtime.js')
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.js | 1313 |
1 files changed, 1002 insertions, 311 deletions
diff --git a/js/vendor/traceur-runtime/traceur-runtime.js b/js/vendor/traceur-runtime/traceur-runtime.js index b3f9f54d5..58f3cff67 100644 --- a/js/vendor/traceur-runtime/traceur-runtime.js +++ b/js/vendor/traceur-runtime/traceur-runtime.js @@ -11,7 +11,6 @@ var $freeze = $Object.freeze; var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; var $getOwnPropertyNames = $Object.getOwnPropertyNames; - var $getPrototypeOf = $Object.getPrototypeOf; var $keys = $Object.keys; var $hasOwnProperty = $Object.prototype.hasOwnProperty; var $toString = $Object.prototype.toString; @@ -198,43 +197,6 @@ $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); $defineProperty(Object, 'seal', {value: seal}); Object.getOwnPropertySymbols = getOwnPropertySymbols; - function is(left, right) { - if (left === right) - return left !== 0 || 1 / left === 1 / right; - return left !== left && right !== right; - } - $defineProperty(Object, 'is', method(is)); - function assign(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - var props = $keys(source); - var p, - length = props.length; - for (p = 0; p < length; p++) { - var name = props[p]; - if (privateNames[name]) - continue; - target[name] = source[name]; - } - } - return target; - } - $defineProperty(Object, 'assign', method(assign)); - function mixin(target, source) { - var props = $getOwnPropertyNames(source); - var p, - descriptor, - length = props.length; - for (p = 0; p < length; p++) { - var name = props[p]; - if (privateNames[name]) - continue; - descriptor = $getOwnPropertyDescriptor(source, props[p]); - $defineProperty(target, props[p], descriptor); - } - return target; - } - $defineProperty(Object, 'mixin', method(mixin)); } function exportStar(object) { for (var i = 1; i < arguments.length; i++) { @@ -263,22 +225,72 @@ throw $TypeError(); return $Object(x); } - function assertObject(x) { - if (!isObject(x)) - throw $TypeError(x + ' is not an Object'); - return 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 = [], - k = 0; + j = 0, + iterResult; for (var i = 0; i < arguments.length; i++) { - var valueToSpread = toObject(arguments[i]); - for (var j = 0; j < valueToSpread.length; j++) { - rv[k++] = valueToSpread[j]; + 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 { @@ -344,15 +356,37 @@ 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(); + 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; @@ -432,7 +466,13 @@ case ST_EXECUTING: throw new Error(("\"" + action + "\" on executing generator")); case ST_CLOSED: - throw new Error(("\"" + action + "\" on closed generator")); + if (action == 'next') { + return { + value: undefined, + done: true + }; + } + throw x; case ST_NEWBORN: if (action === 'throw') { ctx.GState = ST_CLOSED; @@ -475,7 +515,7 @@ next: {enumerable: false}, throw: {enumerable: false} }); - defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { + Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { return this; })); function createGeneratorInstance(innerFunction, functionObject, self) { @@ -500,7 +540,7 @@ ctx.reject = reject; }); } - AsyncFunctionContext.prototype = Object.create(GeneratorContext.prototype); + AsyncFunctionContext.prototype = $create(GeneratorContext.prototype); AsyncFunctionContext.prototype.end = function() { switch (this.state) { case END_STATE: @@ -555,32 +595,10 @@ if (last.finallyFallThrough !== undefined) ctx.finallyFallThrough = last.finallyFallThrough; } - function setupGlobals(global) { - global.Symbol = Symbol; - polyfillObject(global.Object); - } - setupGlobals(global); - global.$traceurRuntime = { - assertObject: assertObject, - asyncWrap: asyncWrap, - createClass: createClass, - defaultSuperCall: defaultSuperCall, - exportStar: exportStar, - initGeneratorFunction: initGeneratorFunction, - createGeneratorInstance: createGeneratorInstance, - getOwnHashObject: getOwnHashObject, - setProperty: setProperty, - setupGlobals: setupGlobals, - spread: spread, - superCall: superCall, - superGet: superGet, - superSet: superSet, - toObject: toObject, - toProperty: toProperty, - type: types, - typeof: typeOf - }; -})(typeof global !== 'undefined' ? global : this); + $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 = []; @@ -704,7 +722,7 @@ })(); (function(global) { 'use strict'; - var $__2 = $traceurRuntime.assertObject($traceurRuntime), + var $__2 = $traceurRuntime, canonicalizeUrl = $__2.canonicalizeUrl, resolveUrl = $__2.resolveUrl, isAbsolute = $__2.isAbsolute; @@ -719,6 +737,12 @@ 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; @@ -727,7 +751,15 @@ ($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() { if (this.value_) return this.value_; - return this.value_ = this.func.call(global); + 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) @@ -859,12 +891,18 @@ return instantiator && instantiator.getUncoatedModule(); }; })(typeof global !== 'undefined' ? global : this); -System.register("traceur-runtime@0.0.41/src/runtime/polyfills/utils", [], function() { +System.register("traceur-runtime@0.0.58/src/runtime/polyfills/utils", [], function() { "use strict"; - var __moduleName = "traceur-runtime@0.0.41/src/runtime/polyfills/utils"; + var __moduleName = "traceur-runtime@0.0.58/src/runtime/polyfills/utils"; + var $ceil = Math.ceil; + var $floor = Math.floor; + var $isFinite = isFinite; + var $isNaN = isNaN; + var $pow = Math.pow; + var $min = Math.min; var toObject = $traceurRuntime.toObject; function toUint32(x) { - return x | 0; + return x >>> 0; } function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); @@ -872,18 +910,89 @@ System.register("traceur-runtime@0.0.41/src/runtime/polyfills/utils", [], functi function isCallable(x) { return typeof x === 'function'; } + function isNumber(x) { + return typeof x === 'number'; + } function toInteger(x) { x = +x; - if (isNaN(x)) + if ($isNaN(x)) return 0; - if (!isFinite(x) || x === 0) + if (x === 0 || !$isFinite(x)) return x; - return x > 0 ? Math.floor(x) : Math.ceil(x); + return x > 0 ? $floor(x) : $ceil(x); } - var MAX_SAFE_LENGTH = Math.pow(2, 53) - 1; + var MAX_SAFE_LENGTH = $pow(2, 53) - 1; function toLength(x) { var len = toInteger(x); - return len < 0 ? 0 : Math.min(len, MAX_SAFE_LENGTH); + return len < 0 ? 0 : $min(len, MAX_SAFE_LENGTH); + } + function checkIterable(x) { + return !isObject(x) ? undefined : x[Symbol.iterator]; + } + function isConstructor(x) { + return isCallable(x); + } + function createIteratorResultObject(value, done) { + return { + value: value, + done: done + }; + } + function maybeDefine(object, name, descr) { + if (!(name in object)) { + Object.defineProperty(object, name, descr); + } + } + function maybeDefineMethod(object, name, value) { + maybeDefine(object, name, { + value: value, + configurable: true, + enumerable: false, + writable: true + }); + } + function maybeDefineConst(object, name, value) { + maybeDefine(object, name, { + value: value, + configurable: false, + enumerable: false, + writable: false + }); + } + function maybeAddFunctions(object, functions) { + for (var i = 0; i < functions.length; i += 2) { + var name = functions[i]; + var value = functions[i + 1]; + maybeDefineMethod(object, name, value); + } + } + function maybeAddConsts(object, consts) { + for (var i = 0; i < consts.length; i += 2) { + var name = consts[i]; + var value = consts[i + 1]; + maybeDefineConst(object, name, value); + } + } + function maybeAddIterator(object, func, Symbol) { + if (!Symbol || !Symbol.iterator || object[Symbol.iterator]) + return; + if (object['@@iterator']) + func = object['@@iterator']; + Object.defineProperty(object, Symbol.iterator, { + value: func, + configurable: true, + enumerable: false, + writable: true + }); + } + var polyfills = []; + function registerPolyfill(func) { + polyfills.push(func); + } + function polyfillAll(global) { + polyfills.forEach((function(f) { + return f(global); + })); } return { get toObject() { @@ -898,157 +1007,57 @@ System.register("traceur-runtime@0.0.41/src/runtime/polyfills/utils", [], functi get isCallable() { return isCallable; }, + get isNumber() { + return isNumber; + }, get toInteger() { return toInteger; }, get toLength() { return toLength; - } - }; -}); -System.register("traceur-runtime@0.0.41/src/runtime/polyfills/Array", [], function() { - "use strict"; - var __moduleName = "traceur-runtime@0.0.41/src/runtime/polyfills/Array"; - var $__3 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.41/src/runtime/polyfills/utils")), - toInteger = $__3.toInteger, - toLength = $__3.toLength, - toObject = $__3.toObject, - isCallable = $__3.isCallable; - function fill(value) { - var start = arguments[1] !== (void 0) ? arguments[1] : 0; - var end = arguments[2]; - var object = toObject(this); - var len = toLength(object.length); - var fillStart = toInteger(start); - var fillEnd = end !== undefined ? toInteger(end) : len; - fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len); - fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len); - while (fillStart < fillEnd) { - object[fillStart] = value; - fillStart++; - } - return object; - } - function find(predicate) { - var thisArg = arguments[1]; - return findHelper(this, predicate, thisArg); - } - function findIndex(predicate) { - var thisArg = arguments[1]; - return findHelper(this, predicate, thisArg, true); - } - function findHelper(self, predicate) { - var thisArg = arguments[2]; - var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false; - var object = toObject(self); - var len = toLength(object.length); - if (!isCallable(predicate)) { - throw TypeError(); - } - for (var i = 0; i < len; i++) { - if (i in object) { - var value = object[i]; - if (predicate.call(thisArg, value, i, object)) { - return returnIndex ? i : value; - } - } - } - return returnIndex ? -1 : undefined; - } - return { - get fill() { - return fill; }, - get find() { - return find; + get checkIterable() { + return checkIterable; }, - get findIndex() { - return findIndex; - } - }; -}); -System.register("traceur-runtime@0.0.41/src/runtime/polyfills/ArrayIterator", [], function() { - "use strict"; - var $__5; - var __moduleName = "traceur-runtime@0.0.41/src/runtime/polyfills/ArrayIterator"; - var $__6 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.41/src/runtime/polyfills/utils")), - toObject = $__6.toObject, - toUint32 = $__6.toUint32; - var ARRAY_ITERATOR_KIND_KEYS = 1; - var ARRAY_ITERATOR_KIND_VALUES = 2; - var ARRAY_ITERATOR_KIND_ENTRIES = 3; - var ArrayIterator = function ArrayIterator() {}; - ($traceurRuntime.createClass)(ArrayIterator, ($__5 = {}, Object.defineProperty($__5, "next", { - value: function() { - var iterator = toObject(this); - var array = iterator.iteratorObject_; - if (!array) { - throw new TypeError('Object is not an ArrayIterator'); - } - var index = iterator.arrayIteratorNextIndex_; - var itemKind = iterator.arrayIterationKind_; - var length = toUint32(array.length); - if (index >= length) { - iterator.arrayIteratorNextIndex_ = Infinity; - return createIteratorResultObject(undefined, true); - } - iterator.arrayIteratorNextIndex_ = index + 1; - if (itemKind == ARRAY_ITERATOR_KIND_VALUES) - return createIteratorResultObject(array[index], false); - if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES) - return createIteratorResultObject([index, array[index]], false); - return createIteratorResultObject(index, false); + get isConstructor() { + return isConstructor; }, - configurable: true, - enumerable: true, - writable: true - }), Object.defineProperty($__5, Symbol.iterator, { - value: function() { - return this; + get createIteratorResultObject() { + return createIteratorResultObject; }, - configurable: true, - enumerable: true, - writable: true - }), $__5), {}); - function createArrayIterator(array, kind) { - var object = toObject(array); - var iterator = new ArrayIterator; - iterator.iteratorObject_ = object; - iterator.arrayIteratorNextIndex_ = 0; - iterator.arrayIterationKind_ = kind; - return iterator; - } - function createIteratorResultObject(value, done) { - return { - value: value, - done: done - }; - } - function entries() { - return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES); - } - function keys() { - return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS); - } - function values() { - return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES); - } - return { - get entries() { - return entries; + get maybeDefine() { + return maybeDefine; }, - get keys() { - return keys; + get maybeDefineMethod() { + return maybeDefineMethod; }, - get values() { - return values; + get maybeDefineConst() { + return maybeDefineConst; + }, + get maybeAddFunctions() { + return maybeAddFunctions; + }, + get maybeAddConsts() { + return maybeAddConsts; + }, + get maybeAddIterator() { + return maybeAddIterator; + }, + get registerPolyfill() { + return registerPolyfill; + }, + get polyfillAll() { + return polyfillAll; } }; }); -System.register("traceur-runtime@0.0.41/src/runtime/polyfills/Map", [], function() { +System.register("traceur-runtime@0.0.58/src/runtime/polyfills/Map", [], function() { "use strict"; - var __moduleName = "traceur-runtime@0.0.41/src/runtime/polyfills/Map"; - var isObject = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.41/src/runtime/polyfills/utils")).isObject; + var __moduleName = "traceur-runtime@0.0.58/src/runtime/polyfills/Map"; + var $__3 = System.get("traceur-runtime@0.0.58/src/runtime/polyfills/utils"), + isObject = $__3.isObject, + maybeAddIterator = $__3.maybeAddIterator, + registerPolyfill = $__3.registerPolyfill; var getOwnHashObject = $traceurRuntime.getOwnHashObject; var $hasOwnProperty = Object.prototype.hasOwnProperty; var deletedSentinel = {}; @@ -1071,22 +1080,19 @@ System.register("traceur-runtime@0.0.41/src/runtime/polyfills/Map", [], function var Map = function Map() { var iterable = arguments[0]; if (!isObject(this)) - throw new TypeError("Constructor Map requires 'new'"); + throw new TypeError('Map called on incompatible type'); if ($hasOwnProperty.call(this, 'entries_')) { - throw new TypeError("Map can not be reentrantly initialised"); + throw new TypeError('Map can not be reentrantly initialised'); } initMap(this); if (iterable !== null && iterable !== undefined) { - var iter = iterable[Symbol.iterator]; - if (iter !== undefined) { - for (var $__8 = iterable[Symbol.iterator](), - $__9; !($__9 = $__8.next()).done; ) { - var $__10 = $traceurRuntime.assertObject($__9.value), - key = $__10[0], - value = $__10[1]; - { - this.set(key, value); - } + for (var $__5 = iterable[Symbol.iterator](), + $__6; !($__6 = $__5.next()).done; ) { + var $__7 = $__6.value, + key = $__7[0], + value = $__7[1]; + { + this.set(key, value); } } } @@ -1162,21 +1168,318 @@ System.register("traceur-runtime@0.0.41/src/runtime/polyfills/Map", [], function continue; callbackFn.call(thisArg, value, key, this); } - } + }, + entries: $traceurRuntime.initGeneratorFunction(function $__8() { + var i, + len, + key, + value; + return $traceurRuntime.createGeneratorInstance(function($ctx) { + while (true) + switch ($ctx.state) { + case 0: + i = 0, len = this.entries_.length; + $ctx.state = 12; + break; + case 12: + $ctx.state = (i < len) ? 8 : -2; + break; + case 4: + i += 2; + $ctx.state = 12; + break; + case 8: + key = this.entries_[i]; + value = this.entries_[i + 1]; + $ctx.state = 9; + break; + case 9: + $ctx.state = (key === deletedSentinel) ? 4 : 6; + break; + case 6: + $ctx.state = 2; + return [key, value]; + case 2: + $ctx.maybeThrow(); + $ctx.state = 4; + break; + default: + return $ctx.end(); + } + }, $__8, this); + }), + keys: $traceurRuntime.initGeneratorFunction(function $__9() { + var i, + len, + key, + value; + return $traceurRuntime.createGeneratorInstance(function($ctx) { + while (true) + switch ($ctx.state) { + case 0: + i = 0, len = this.entries_.length; + $ctx.state = 12; + break; + case 12: + $ctx.state = (i < len) ? 8 : -2; + break; + case 4: + i += 2; + $ctx.state = 12; + break; + case 8: + key = this.entries_[i]; + value = this.entries_[i + 1]; + $ctx.state = 9; + break; + case 9: + $ctx.state = (key === deletedSentinel) ? 4 : 6; + break; + case 6: + $ctx.state = 2; + return key; + case 2: + $ctx.maybeThrow(); + $ctx.state = 4; + break; + default: + return $ctx.end(); + } + }, $__9, this); + }), + values: $traceurRuntime.initGeneratorFunction(function $__10() { + var i, + len, + key, + value; + return $traceurRuntime.createGeneratorInstance(function($ctx) { + while (true) + switch ($ctx.state) { + case 0: + i = 0, len = this.entries_.length; + $ctx.state = 12; + break; + case 12: + $ctx.state = (i < len) ? 8 : -2; + break; + case 4: + i += 2; + $ctx.state = 12; + break; + case 8: + key = this.entries_[i]; + value = this.entries_[i + 1]; + $ctx.state = 9; + break; + case 9: + $ctx.state = (key === deletedSentinel) ? 4 : 6; + break; + case 6: + $ctx.state = 2; + return value; + case 2: + $ctx.maybeThrow(); + $ctx.state = 4; + break; + default: + return $ctx.end(); + } + }, $__10, this); + }) }, {}); - return {get Map() { + Object.defineProperty(Map.prototype, Symbol.iterator, { + configurable: true, + writable: true, + value: Map.prototype.entries + }); + function polyfillMap(global) { + var $__7 = global, + Object = $__7.Object, + Symbol = $__7.Symbol; + if (!global.Map) + global.Map = Map; + var mapPrototype = global.Map.prototype; + if (mapPrototype.entries) { + maybeAddIterator(mapPrototype, mapPrototype.entries, Symbol); + maybeAddIterator(Object.getPrototypeOf(new global.Map().entries()), function() { + return this; + }, Symbol); + } + } + registerPolyfill(polyfillMap); + return { + get Map() { return Map; - }}; + }, + get polyfillMap() { + return polyfillMap; + } + }; +}); +System.get("traceur-runtime@0.0.58/src/runtime/polyfills/Map" + ''); +System.register("traceur-runtime@0.0.58/src/runtime/polyfills/Set", [], function() { + "use strict"; + var __moduleName = "traceur-runtime@0.0.58/src/runtime/polyfills/Set"; + var $__11 = System.get("traceur-runtime@0.0.58/src/runtime/polyfills/utils"), + isObject = $__11.isObject, + maybeAddIterator = $__11.maybeAddIterator, + registerPolyfill = $__11.registerPolyfill; + var Map = System.get("traceur-runtime@0.0.58/src/runtime/polyfills/Map").Map; + var getOwnHashObject = $traceurRuntime.getOwnHashObject; + var $hasOwnProperty = Object.prototype.hasOwnProperty; + function initSet(set) { + set.map_ = new Map(); + } + var Set = function Set() { + var iterable = arguments[0]; + if (!isObject(this)) + throw new TypeError('Set called on incompatible type'); + if ($hasOwnProperty.call(this, 'map_')) { + throw new TypeError('Set can not be reentrantly initialised'); + } + initSet(this); + if (iterable !== null && iterable !== undefined) { + for (var $__15 = iterable[Symbol.iterator](), + $__16; !($__16 = $__15.next()).done; ) { + var item = $__16.value; + { + this.add(item); + } + } + } + }; + ($traceurRuntime.createClass)(Set, { + get size() { + return this.map_.size; + }, + has: function(key) { + return this.map_.has(key); + }, + add: function(key) { + return this.map_.set(key, key); + }, + delete: function(key) { + return this.map_.delete(key); + }, + clear: function() { + return this.map_.clear(); + }, + forEach: function(callbackFn) { + var thisArg = arguments[1]; + var $__13 = this; + return this.map_.forEach((function(value, key) { + callbackFn.call(thisArg, key, key, $__13); + })); + }, + values: $traceurRuntime.initGeneratorFunction(function $__18() { + var $__19, + $__20; + return $traceurRuntime.createGeneratorInstance(function($ctx) { + while (true) + switch ($ctx.state) { + case 0: + $__19 = this.map_.keys()[Symbol.iterator](); + $ctx.sent = void 0; + $ctx.action = 'next'; + $ctx.state = 12; + break; + case 12: + $__20 = $__19[$ctx.action]($ctx.sentIgnoreThrow); + $ctx.state = 9; + break; + case 9: + $ctx.state = ($__20.done) ? 3 : 2; + break; + case 3: + $ctx.sent = $__20.value; + $ctx.state = -2; + break; + case 2: + $ctx.state = 12; + return $__20.value; + default: + return $ctx.end(); + } + }, $__18, this); + }), + entries: $traceurRuntime.initGeneratorFunction(function $__21() { + var $__22, + $__23; + return $traceurRuntime.createGeneratorInstance(function($ctx) { + while (true) + switch ($ctx.state) { + case 0: + $__22 = this.map_.entries()[Symbol.iterator](); + $ctx.sent = void 0; + $ctx.action = 'next'; + $ctx.state = 12; + break; + case 12: + $__23 = $__22[$ctx.action]($ctx.sentIgnoreThrow); + $ctx.state = 9; + break; + case 9: + $ctx.state = ($__23.done) ? 3 : 2; + break; + case 3: + $ctx.sent = $__23.value; + $ctx.state = -2; + break; + case 2: + $ctx.state = 12; + return $__23.value; + default: + return $ctx.end(); + } + }, $__21, this); + }) + }, {}); + Object.defineProperty(Set.prototype, Symbol.iterator, { + configurable: true, + writable: true, + value: Set.prototype.values + }); + Object.defineProperty(Set.prototype, 'keys', { + configurable: true, + writable: true, + value: Set.prototype.values + }); + function polyfillSet(global) { + var $__17 = global, + Object = $__17.Object, + Symbol = $__17.Symbol; + if (!global.Set) + global.Set = Set; + var setPrototype = global.Set.prototype; + if (setPrototype.values) { + maybeAddIterator(setPrototype, setPrototype.values, Symbol); + maybeAddIterator(Object.getPrototypeOf(new global.Set().values()), function() { + return this; + }, Symbol); + } + } + registerPolyfill(polyfillSet); + return { + get Set() { + return Set; + }, + get polyfillSet() { + return polyfillSet; + } + }; }); -System.register("traceur-runtime@0.0.41/node_modules/rsvp/lib/rsvp/asap", [], function() { +System.get("traceur-runtime@0.0.58/src/runtime/polyfills/Set" + ''); +System.register("traceur-runtime@0.0.58/node_modules/rsvp/lib/rsvp/asap", [], function() { "use strict"; - var __moduleName = "traceur-runtime@0.0.41/node_modules/rsvp/lib/rsvp/asap"; - var $__default = function asap(callback, arg) { + var __moduleName = "traceur-runtime@0.0.58/node_modules/rsvp/lib/rsvp/asap"; + function asap(callback, arg) { var length = queue.push([callback, arg]); if (length === 1) { scheduleFlush(); } - }; + } + var $__default = asap; + ; var browserGlobal = (typeof window !== 'undefined') ? window : {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; function useNextTick() { @@ -1220,10 +1523,11 @@ System.register("traceur-runtime@0.0.41/node_modules/rsvp/lib/rsvp/asap", [], fu return $__default; }}; }); -System.register("traceur-runtime@0.0.41/src/runtime/polyfills/Promise", [], function() { +System.register("traceur-runtime@0.0.58/src/runtime/polyfills/Promise", [], function() { "use strict"; - var __moduleName = "traceur-runtime@0.0.41/src/runtime/polyfills/Promise"; - var async = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.41/node_modules/rsvp/lib/rsvp/asap")).default; + var __moduleName = "traceur-runtime@0.0.58/src/runtime/polyfills/Promise"; + var async = System.get("traceur-runtime@0.0.58/node_modules/rsvp/lib/rsvp/asap").default; + var registerPolyfill = System.get("traceur-runtime@0.0.58/src/runtime/polyfills/utils").registerPolyfill; var promiseRaw = {}; function isPromise(x) { return x |