]> git.openstreetmap.org Git - rails.git/blob - vendor/assets/polyfill/es6.js
Localisation updates from https://translatewiki.net.
[rails.git] / vendor / assets / polyfill / es6.js
1 /* Polyfill service v3.34.0
2  * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
3  * 
4  * Features requested: es6
5  * 
6  * - _ESAbstract.ArrayCreate, License: CC0 (required by "Array.from", "es6", "Array.of", "_ESAbstract.ArraySpeciesCreate", "Array.prototype.filter", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
7  * - _ESAbstract.Call, License: CC0 (required by "Array.from", "es6", "Array.prototype.find", "Array.prototype.findIndex", "WeakMap", "WeakSet", "_ESAbstract.GetIterator", "Map", "Set", "_ESAbstract.IteratorClose", "_ESAbstract.IteratorNext", "_ESAbstract.IteratorStep", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "Array.of", "Array.prototype.fill", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "_ESAbstract.OrdinaryToPrimitive")
8  * - _ESAbstract.Get, License: CC0 (required by "Array.from", "es6", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "Object.assign", "RegExp.prototype.flags", "WeakMap", "WeakSet", "_ESAbstract.IteratorValue", "Map", "Set", "_ESAbstract.IteratorComplete", "_ESAbstract.IteratorStep", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_ESAbstract.IsRegExp", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.startsWith", "Array.prototype.filter", "Array.prototype.map", "_ESAbstract.GetPrototypeFromConstructor", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "Object.defineProperties", "Object.create", "_ESAbstract.GetIterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_Iterator", "_StringIterator", "_ESAbstract.ArraySpeciesCreate", "_ESAbstract.OrdinaryToPrimitive", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.codePointAt", "String.prototype.repeat")
9  * - _ESAbstract.HasProperty, License: CC0 (required by "Array.prototype.copyWithin", "es6", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map")
10  * - _ESAbstract.IsArray, License: CC0 (required by "String.fromCodePoint", "es6", "WeakMap", "WeakSet", "Array.isArray", "Map", "Array.from", "Set", "_ESAbstract.ArraySpeciesCreate", "Array.prototype.filter", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
11  * - _ESAbstract.IsCallable, License: CC0 (required by "Array.from", "es6", "Array.prototype.find", "Array.prototype.findIndex", "Map", "Set", "WeakMap", "WeakSet", "_ESAbstract.GetMethod", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map", "Function.prototype.bind", "_ESAbstract.Construct", "Array.of", "Object.getOwnPropertyDescriptor", "Object.assign", "_ESAbstract.OrdinaryToPrimitive", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "Array.prototype.fill", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith")
12  * - _ESAbstract.RequireObjectCoercible, License: CC0 (required by "String.prototype.@@iterator", "es6", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith")
13  * - _ESAbstract.SameValueNonNumber, License: CC0 (required by "_ESAbstract.SameValueZero", "Map", "es6", "Array.from", "Set", "WeakSet", "_ESAbstract.SameValue", "Object.is", "String.fromCodePoint", "WeakMap")
14  * - _ESAbstract.ToBoolean, License: CC0 (required by "Array.prototype.find", "es6", "Array.prototype.findIndex", "RegExp.prototype.flags", "_ESAbstract.IteratorComplete", "Map", "Array.from", "Set", "_ESAbstract.IteratorStep", "WeakMap", "WeakSet", "_ESAbstract.IsRegExp", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.startsWith", "Array.prototype.filter", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
15  * - _ESAbstract.ToInteger, License: CC0 (required by "Array.prototype.copyWithin", "es6", "Array.prototype.fill", "Number.isInteger", "Number.isSafeInteger", "String.fromCodePoint", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "_ESAbstract.ToLength", "Array.from", "Array.prototype.find", "Array.prototype.findIndex")
16  * - _ESAbstract.ToLength, License: CC0 (required by "Array.from", "es6", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map")
17  * - _ESAbstract.ToNumber, License: CC0 (required by "String.fromCodePoint", "es6")
18  * - _ESAbstract.ToObject, License: CC0 (required by "Array.from", "es6", "Array.prototype.entries", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "Object.assign", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map", "_ESAbstract.GetV", "_ESAbstract.GetMethod", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "Object.defineProperties", "Object.create", "_ArrayIterator", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "_Iterator", "_StringIterator")
19  * - _ESAbstract.GetV, License: CC0 (required by "_ESAbstract.GetMethod", "Array.from", "es6", "Map", "Set", "_ESAbstract.GetIterator", "WeakMap", "WeakSet")
20  * - _ESAbstract.GetMethod, License: CC0 (required by "Array.from", "es6", "Map", "Set", "_ESAbstract.IsConstructor", "Array.of", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_ESAbstract.IteratorClose", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith")
21  * - _ESAbstract.ToUint32, License: CC0 (required by "Math.clz32", "es6", "Math.imul")
22  * - _ESAbstract.Type, License: CC0 (required by "Map", "es6", "Array.from", "Number.isFinite", "Number.isInteger", "Number.isNaN", "Number.isSafeInteger", "Object.seal", "RegExp.prototype.flags", "WeakMap", "WeakSet", "_ESAbstract.IsConstructor", "Array.of", "_ESAbstract.GetIterator", "Set", "_ESAbstract.IteratorClose", "_ESAbstract.ToString", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "_ESAbstract.IteratorValue", "_ESAbstract.CreateIterResultObject", "_ESAbstract.IteratorComplete", "_ESAbstract.IteratorStep", "_ESAbstract.IteratorNext", "_ESAbstract.SameValueZero", "Object.create", "Object.setPrototypeOf", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "_ESAbstract.SameValue", "Object.is", "String.fromCodePoint", "_ESAbstract.IsRegExp", "_ESAbstract.ToPrimitive", "_ESAbstract.GetPrototypeFromConstructor", "Object.defineProperties", "_Iterator", "_StringIterator", "_ESAbstract.ArraySpeciesCreate", "Array.prototype.filter", "Array.prototype.map", "_ESAbstract.OrdinaryToPrimitive")
23  * - _ESAbstract.GetPrototypeFromConstructor, License: CC0 (required by "_ESAbstract.OrdinaryCreateFromConstructor", "Map", "es6", "Array.from", "Set", "WeakMap", "WeakSet", "_ESAbstract.Construct", "Array.of")
24  * - _ESAbstract.IsConstructor, License: CC0 (required by "Array.from", "es6", "Array.of", "_ESAbstract.Construct", "_ESAbstract.ArraySpeciesCreate", "Array.prototype.filter", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
25  * - _ESAbstract.IsRegExp, License: CC0 (required by "String.prototype.endsWith", "es6", "String.prototype.includes", "String.prototype.startsWith")
26  * - _ESAbstract.IteratorClose, License: CC0 (required by "Array.from", "es6", "Map", "Set", "WeakMap", "WeakSet")
27  * - _ESAbstract.IteratorComplete, License: CC0 (required by "Map", "es6", "Array.from", "Set", "_ESAbstract.IteratorStep", "WeakMap", "WeakSet")
28  * - _ESAbstract.IteratorNext, License: CC0 (required by "Map", "es6", "Array.from", "Set", "_ESAbstract.IteratorStep", "WeakMap", "WeakSet")
29  * - _ESAbstract.IteratorStep, License: CC0 (required by "Array.from", "es6", "Map", "Set", "WeakMap", "WeakSet")
30  * - _ESAbstract.IteratorValue, License: CC0 (required by "Array.from", "es6", "Map", "Set", "WeakMap", "WeakSet")
31  * - _ESAbstract.OrdinaryToPrimitive, License: CC0 (required by "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "Array.from", "es6", "Array.of", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith")
32  * - _ESAbstract.SameValue, License: CC0 (required by "Object.is", "es6", "String.fromCodePoint", "WeakMap")
33  * - _ESAbstract.SameValueZero, License: CC0 (required by "Map", "es6", "Array.from", "Set", "WeakSet")
34  * - _ESAbstract.ToPrimitive, License: CC0 (required by "_ESAbstract.ToString", "Array.from", "es6", "Array.of", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith")
35  * - _ESAbstract.ToString, License: CC0 (required by "Array.from", "es6", "Array.of", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "Array.prototype.forEach", "Object.setPrototypeOf", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.filter", "Array.prototype.map")
36  * - _ESAbstract.UTF16Decode, License: CC0 (required by "String.prototype.codePointAt", "es6")
37  * - _ESAbstract.UTF16Encoding, License: CC0 (required by "String.fromCodePoint", "es6")
38  * - _TypedArray, License: MIT (required by "Math.fround", "es6")
39  * - Object.defineProperty, License: CC0 (required by "Function.prototype.name", "es6", "Map", "Array.from", "Number.Epsilon", "Number.MAX_SAFE_INTEGER", "Number.MIN_SAFE_INTEGER", "Object.setPrototypeOf", "RegExp.prototype.flags", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Symbol", "WeakMap", "WeakSet", "_ESAbstract.CreateMethodProperty", "Array.of", "Array.prototype.copyWithin", "Array.prototype.entries", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "Array.prototype.keys", "Array.prototype.values", "Math.acosh", "Math.asinh", "Math.atanh", "Math.cbrt", "Math.clz32", "Math.cosh", "Math.expm1", "Math.fround", "Math.hypot", "Math.imul", "Math.log10", "Math.log1p", "Math.log2", "Math.sign", "Math.sinh", "Math.tanh", "Math.trunc", "Number.isFinite", "Number.isInteger", "Number.isNaN", "Number.isSafeInteger", "Number.parseFloat", "Number.parseInt", "Object.assign", "Object.is", "Object.seal", "String.fromCodePoint", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "_ArrayIterator", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "_StringIterator", "_ESAbstract.CreateDataProperty", "_ESAbstract.CreateDataPropertyOrThrow", "_ESAbstract.CreateIterResultObject", "_Iterator", "Object.defineProperties", "Object.create", "_ESAbstract.GetIterator")
40  * - _ESAbstract.CreateDataProperty, License: CC0 (required by "_ESAbstract.CreateDataPropertyOrThrow", "Array.from", "es6", "Array.of", "_ESAbstract.CreateIterResultObject", "Map", "Set")
41  * - _ESAbstract.CreateDataPropertyOrThrow, License: CC0 (required by "Array.from", "es6", "Array.of", "Array.prototype.filter", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
42  * - _ESAbstract.CreateIterResultObject, License: CC0 (required by "Map", "es6", "Array.from", "Set")
43  * - _ESAbstract.CreateMethodProperty, License: CC0 (required by "Array.from", "es6", "Array.of", "Array.prototype.@@iterator", "Array.prototype.copyWithin", "Array.prototype.entries", "Array.prototype.fill", "Array.prototype.find", "Array.prototype.findIndex", "Array.prototype.keys", "Array.prototype.values", "Map", "Math.acosh", "Math.asinh", "Math.atanh", "Math.cbrt", "Math.clz32", "Math.cosh", "Math.expm1", "Math.fround", "Math.hypot", "Math.imul", "Math.log10", "Math.log1p", "Math.log2", "Math.sign", "Math.sinh", "Math.tanh", "Math.trunc", "Number.isFinite", "Number.isInteger", "Number.isNaN", "Number.isSafeInteger", "Number.parseFloat", "Number.parseInt", "Object.assign", "Object.is", "Object.seal", "Object.setPrototypeOf", "Set", "String.fromCodePoint", "String.prototype.@@iterator", "String.prototype.codePointAt", "String.prototype.endsWith", "String.prototype.includes", "String.prototype.repeat", "String.prototype.startsWith", "WeakMap", "WeakSet", "Array.isArray", "Object.create", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_ESAbstract.GetIterator", "_ArrayIterator", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Object.getOwnPropertyDescriptor", "Object.keys", "Array.prototype.forEach", "Object.getPrototypeOf", "Object.getOwnPropertyNames", "Array.prototype.filter", "Array.prototype.map", "Object.freeze", "Function.prototype.bind", "Object.defineProperties", "_Iterator", "_StringIterator")
44  * - Array.isArray, License: CC0 (required by "Map", "es6", "Array.from", "Set", "WeakMap")
45  * - Array.prototype.copyWithin, License: MIT (required by "es6")
46  * - Array.prototype.fill, License: CC0 (required by "es6")
47  * - Array.prototype.find, License: CC0 (required by "es6")
48  * - Array.prototype.findIndex, License: CC0 (required by "es6")
49  * - Array.prototype.forEach, License: CC0 (required by "Object.setPrototypeOf", "es6", "Symbol", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
50  * - Function.prototype.bind, License: MIT (required by "_ESAbstract.Construct", "Array.from", "es6", "Array.of", "Object.getOwnPropertyDescriptor", "Object.assign", "Object.setPrototypeOf", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_StringIterator")
51  * - Math.acosh, License: CC0 (required by "es6")
52  * - Math.asinh, License: CC0 (required by "es6")
53  * - Math.atanh, License: CC0 (required by "es6")
54  * - Math.cbrt, License: CC0 (required by "es6")
55  * - Math.clz32, License: CC0 (required by "es6")
56  * - Math.cosh, License: CC0 (required by "es6")
57  * - Math.expm1, License: CC0 (required by "es6")
58  * - Math.fround, License: CC0 (required by "es6")
59  * - Math.hypot, License: CC0 (required by "es6")
60  * - Math.imul, License: CC0 (required by "es6")
61  * - Math.log10, License: CC0 (required by "es6")
62  * - Math.log1p, License: CC0 (required by "es6")
63  * - Math.log2, License: CC0 (required by "es6")
64  * - Math.sign, License: CC0 (required by "es6")
65  * - Math.sinh, License: CC0 (required by "es6")
66  * - Math.tanh, License: CC0 (required by "es6")
67  * - Math.trunc, License: CC0 (required by "es6")
68  * - Number.isFinite, License: MIT (required by "es6")
69  * - Number.isInteger, License: MIT (required by "es6")
70  * - Number.isNaN, License: MIT (required by "es6")
71  * - Number.isSafeInteger, License: MIT (required by "es6")
72  * - Number.parseFloat, License: MIT (required by "es6")
73  * - Number.parseInt, License: MIT (required by "es6")
74  * - Function.prototype.name, License: MIT (required by "es6")
75  * - Number.Epsilon, License: MIT (required by "es6")
76  * - Number.MAX_SAFE_INTEGER, License: MIT (required by "es6")
77  * - Number.MIN_SAFE_INTEGER, License: MIT (required by "es6")
78  * - Object.freeze, License: CC0 (required by "Symbol", "es6", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
79  * - Object.getOwnPropertyDescriptor, License: CC0 (required by "Object.assign", "es6", "Object.setPrototypeOf", "Symbol", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Object.defineProperties", "Object.create", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "_Iterator", "_StringIterator")
80  * - Object.getOwnPropertyNames, License: CC0 (required by "Object.setPrototypeOf", "es6", "Symbol", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
81  * - Object.getPrototypeOf, License: CC0 (required by "Object.setPrototypeOf", "es6", "_ESAbstract.OrdinaryCreateFromConstructor", "Map", "Array.from", "Set", "WeakMap", "WeakSet", "_ESAbstract.Construct", "Array.of")
82  * - Object.is, License: CC0 (required by "es6")
83  * - Object.keys, License: MIT (required by "Object.assign", "es6", "Symbol", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Object.defineProperties", "Object.create", "Object.setPrototypeOf", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "_Iterator", "_StringIterator")
84  * - Object.assign, License: CC0 (required by "es6", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "_StringIterator", "String.prototype.@@iterator")
85  * - Object.defineProperties, License: CC0 (required by "Object.create", "Map", "es6", "Array.from", "Object.setPrototypeOf", "Set", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "_Iterator", "_StringIterator")
86  * - Object.create, License: CC0 (required by "Map", "es6", "Array.from", "Object.setPrototypeOf", "Set", "Symbol", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_ESAbstract.OrdinaryCreateFromConstructor", "_ESAbstract.Construct", "Array.of", "_StringIterator")
87  * - _ESAbstract.GetIterator, License: CC0 (required by "Array.from", "es6", "Map", "Set", "WeakMap", "WeakSet")
88  * - _ESAbstract.OrdinaryCreateFromConstructor, License: CC0 (required by "Map", "es6", "Array.from", "Set", "WeakMap", "WeakSet", "_ESAbstract.Construct", "Array.of")
89  * - _ESAbstract.Construct, License: CC0 (required by "Array.from", "es6", "Array.of", "_ESAbstract.ArraySpeciesCreate", "Array.prototype.filter", "Symbol", "Map", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
90  * - _ESAbstract.ArraySpeciesCreate, License: CC0 (required by "Array.prototype.filter", "Symbol", "es6", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "Array.prototype.map")
91  * - Array.prototype.filter, License: CC0 (required by "Symbol", "es6", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
92  * - Array.prototype.map, License: CC0 (required by "Symbol", "es6", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables")
93  * - Array.of, License: CC0 (required by "es6")
94  * - Object.seal, License: MIT (required by "es6")
95  * - Object.setPrototypeOf, License: MIT (required by "es6", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "_StringIterator", "String.prototype.@@iterator")
96  * - Promise, License: MIT (required by "es6")
97  * - RegExp.prototype.flags, License: MIT (required by "es6")
98  * - String.fromCodePoint, License: MIT (required by "es6")
99  * - String.prototype.codePointAt, License: MIT (required by "es6")
100  * - String.prototype.endsWith, License: CC0 (required by "es6")
101  * - String.prototype.includes, License: CC0 (required by "es6", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator")
102  * - String.prototype.repeat, License: CC0 (required by "es6")
103  * - String.prototype.startsWith, License: CC0 (required by "es6")
104  * - Symbol, License: MIT (required by "es6", "Map", "Array.from", "Set", "Symbol.hasInstance", "Symbol.isConcatSpreadable", "Symbol.iterator", "Array.prototype.@@iterator", "String.prototype.@@iterator", "Symbol.match", "Symbol.replace", "Symbol.search", "Symbol.species", "Symbol.split", "Symbol.toPrimitive", "Symbol.toStringTag", "Symbol.unscopables", "WeakMap", "WeakSet", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_StringIterator")
105  * - Symbol.hasInstance, License: MIT (required by "es6")
106  * - Symbol.isConcatSpreadable, License: MIT (required by "es6")
107  * - Symbol.iterator, License: MIT (required by "es6", "Array.from", "Array.prototype.@@iterator", "Map", "Set", "String.prototype.@@iterator", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_StringIterator")
108  * - Symbol.match, License: MIT (required by "es6")
109  * - Symbol.replace, License: MIT (required by "es6")
110  * - Symbol.search, License: MIT (required by "es6")
111  * - Symbol.species, License: MIT (required by "es6", "Map", "Array.from", "Set")
112  * - Map, License: CC0 (required by "es6", "Array.from")
113  * - Set, License: CC0 (required by "es6", "Array.from")
114  * - Array.from, License: CC0 (required by "es6")
115  * - Symbol.split, License: MIT (required by "es6")
116  * - Symbol.toPrimitive, License: MIT (required by "es6")
117  * - Symbol.toStringTag, License: MIT (required by "es6", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "_StringIterator", "String.prototype.@@iterator")
118  * - _Iterator, License: MIT (required by "_ArrayIterator", "Array.prototype.entries", "es6", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "_StringIterator", "String.prototype.@@iterator")
119  * - _ArrayIterator, License: MIT (required by "Array.prototype.entries", "es6", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator")
120  * - Array.prototype.entries, License: CC0 (required by "es6")
121  * - Array.prototype.keys, License: CC0 (required by "es6")
122  * - Array.prototype.values, License: MIT (required by "es6", "Array.prototype.@@iterator")
123  * - Array.prototype.@@iterator, License: CC0 (required by "es6")
124  * - _StringIterator, License: MIT (required by "String.prototype.@@iterator", "es6")
125  * - String.prototype.@@iterator, License: CC0 (required by "es6")
126  * - Symbol.unscopables, License: MIT (required by "es6")
127  * - WeakMap, License: MIT (required by "es6")
128  * - WeakSet, License: MIT (required by "es6") */
129
130 (function(undefined) {
131
132 // _ESAbstract.ArrayCreate
133 // 9.4.2.2. ArrayCreate ( length [ , proto ] )
134 function ArrayCreate(length /* [, proto] */) { // eslint-disable-line no-unused-vars
135         // 1. Assert: length is an integer Number ≥ 0.
136         // 2. If length is -0, set length to +0.
137         if (1 / length === -Infinity) {
138                 length = 0;
139         }
140         // 3. If length>2^32-1, throw a RangeError exception.
141         if (length > (Math.pow(2, 32) - 1)) {
142                 throw new RangeError('Invalid array length');
143         }
144         // 4. If proto is not present, set proto to the intrinsic object %ArrayPrototype%.
145         // 5. Let A be a newly created Array exotic object.
146         var A = [];
147         // 6. Set A's essential internal methods except for [[DefineOwnProperty]] to the default ordinary object definitions specified in 9.1.
148         // 7. Set A.[[DefineOwnProperty]] as specified in 9.4.2.1.
149         // 8. Set A.[[Prototype]] to proto.
150         // 9. Set A.[[Extensible]] to true.
151         // 10. Perform ! OrdinaryDefineOwnProperty(A, "length", PropertyDescriptor{[[Value]]: length, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).
152         A.length = length;
153         // 11. Return A.
154         return A;
155 }
156
157 // _ESAbstract.Call
158 /* global IsCallable */
159 // 7.3.12. Call ( F, V [ , argumentsList ] )
160 function Call(F, V /* [, argumentsList] */) { // eslint-disable-line no-unused-vars
161         // 1. If argumentsList is not present, set argumentsList to a new empty List.
162         var argumentsList = arguments.length > 2 ? arguments[2] : [];
163         // 2. If IsCallable(F) is false, throw a TypeError exception.
164         if (IsCallable(F) === false) {
165                 throw new TypeError(Object.prototype.toString.call(F) + 'is not a function.');
166         }
167         // 3. Return ? F.[[Call]](V, argumentsList).
168         return F.apply(V, argumentsList);
169 }
170
171 // _ESAbstract.Get
172 // 7.3.1. Get ( O, P )
173 function Get(O, P) { // eslint-disable-line no-unused-vars
174         // 1. Assert: Type(O) is Object.
175         // 2. Assert: IsPropertyKey(P) is true.
176         // 3. Return ? O.[[Get]](P, O).
177         return O[P];
178 }
179
180 // _ESAbstract.HasProperty
181 // 7.3.10. HasProperty ( O, P )
182 function HasProperty(O, P) { // eslint-disable-line no-unused-vars
183         // Assert: Type(O) is Object.
184         // Assert: IsPropertyKey(P) is true.
185         // Return ? O.[[HasProperty]](P).
186         return P in O;
187 }
188
189 // _ESAbstract.IsArray
190 // 7.2.2. IsArray ( argument )
191 function IsArray(argument) { // eslint-disable-line no-unused-vars
192         // 1. If Type(argument) is not Object, return false.
193         // 2. If argument is an Array exotic object, return true.
194         // 3. If argument is a Proxy exotic object, then
195                 // a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
196                 // b. Let target be argument.[[ProxyTarget]].
197                 // c. Return ? IsArray(target).
198         // 4. Return false.
199
200         // Polyfill.io - We can skip all the above steps and check the string returned from Object.prototype.toString().
201         return Object.prototype.toString.call(argument) === '[object Array]';
202 }
203
204 // _ESAbstract.IsCallable
205 // 7.2.3. IsCallable ( argument )
206 function IsCallable(argument) { // eslint-disable-line no-unused-vars
207         // 1. If Type(argument) is not Object, return false.
208         // 2. If argument has a [[Call]] internal method, return true.
209         // 3. Return false.
210
211         // Polyfill.io - Only function objects have a [[Call]] internal method. This means we can simplify this function to check that the argument has a type of function.
212         return typeof argument === 'function';
213 }
214
215 // _ESAbstract.RequireObjectCoercible
216 // 7.2.1. RequireObjectCoercible ( argument )
217 // The abstract operation ToObject converts argument to a value of type Object according to Table 12:
218 // Table 12: ToObject Conversions
219 /*
220 |----------------------------------------------------------------------------------------------------------------------------------------------------|
221 | Argument Type | Result                                                                                                                             |
222 |----------------------------------------------------------------------------------------------------------------------------------------------------|
223 | Undefined     | Throw a TypeError exception.                                                                                                       |
224 | Null          | Throw a TypeError exception.                                                                                                       |
225 | Boolean       | Return argument.                                                                                                                   |
226 | Number        | Return argument.                                                                                                                   |
227 | String        | Return argument.                                                                                                                   |
228 | Symbol        | Return argument.                                                                                                                   |
229 | Object        | Return argument.                                                                                                                   |
230 |----------------------------------------------------------------------------------------------------------------------------------------------------|
231 */
232 function RequireObjectCoercible(argument) { // eslint-disable-line no-unused-vars
233         if (argument === null || argument === undefined) {
234                 throw TypeError();
235         }
236   return argument;
237 }
238
239 // _ESAbstract.SameValueNonNumber
240 // 7.2.12. SameValueNonNumber ( x, y )
241 function SameValueNonNumber(x, y) { // eslint-disable-line no-unused-vars
242         // 1. Assert: Type(x) is not Number.
243         // 2. Assert: Type(x) is the same as Type(y).
244         // 3. If Type(x) is Undefined, return true.
245         // 4. If Type(x) is Null, return true.
246         // 5. If Type(x) is String, then
247                 // a. If x and y are exactly the same sequence of code units (same length and same code units at corresponding indices), return true; otherwise, return false.
248         // 6. If Type(x) is Boolean, then
249                 // a. If x and y are both true or both false, return true; otherwise, return false.
250         // 7. If Type(x) is Symbol, then
251                 // a. If x and y are both the same Symbol value, return true; otherwise, return false.
252         // 8. If x and y are the same Object value, return true. Otherwise, return false.
253
254         // Polyfill.io - We can skip all above steps because the === operator does it all for us.
255         return x === y;
256 }
257
258 // _ESAbstract.ToBoolean
259 // 7.1.2. ToBoolean ( argument )
260 // The abstract operation ToBoolean converts argument to a value of type Boolean according to Table 9:
261 /*
262 --------------------------------------------------------------------------------------------------------------
263 | Argument Type | Result                                                                                     |
264 --------------------------------------------------------------------------------------------------------------
265 | Undefined     | Return false.                                                                              |
266 | Null          | Return false.                                                                              |
267 | Boolean       | Return argument.                                                                           |
268 | Number        | If argument is +0, -0, or NaN, return false; otherwise return true.                        |
269 | String        | If argument is the empty String (its length is zero), return false; otherwise return true. |
270 | Symbol        | Return true.                                                                               |
271 | Object        | Return true.                                                                               |
272 --------------------------------------------------------------------------------------------------------------
273 */
274 function ToBoolean(argument) { // eslint-disable-line no-unused-vars
275         return Boolean(argument);
276 }
277
278 // _ESAbstract.ToInteger
279 // 7.1.4. ToInteger ( argument )
280 function ToInteger(argument) { // eslint-disable-line no-unused-vars
281         // 1. Let number be ? ToNumber(argument).
282         var number = Number(argument);
283         // 2. If number is NaN, return +0.
284         if (isNaN(number)) {
285                 return 0;
286         }
287         // 3. If number is +0, -0, +∞, or -∞, return number.
288         if (1/number === Infinity || 1/number === -Infinity || number === Infinity || number === -Infinity) {
289                 return number;
290         }
291         // 4. Return the number value that is the same sign as number and whose magnitude is floor(abs(number)).
292         return ((number < 0) ? -1 : 1) * Math.floor(Math.abs(number));
293 }
294
295 // _ESAbstract.ToLength
296 /* global ToInteger */
297 // 7.1.15. ToLength ( argument )
298 function ToLength(argument) { // eslint-disable-line no-unused-vars
299         // 1. Let len be ? ToInteger(argument).
300         var len = ToInteger(argument);
301         // 2. If len ≤ +0, return +0.
302         if (len <= 0) {
303                 return 0;
304         }
305         // 3. Return min(len, 253-1).
306         return Math.min(len, Math.pow(2, 53) -1);
307 }
308
309 // _ESAbstract.ToNumber
310 // 7.1.3. ToNumber ( argument )
311 function ToNumber(argument) { // eslint-disable-line no-unused-vars
312         return Number(argument);
313 }
314
315 // _ESAbstract.ToObject
316 // 7.1.13 ToObject ( argument )
317 // The abstract operation ToObject converts argument to a value of type Object according to Table 12:
318 // Table 12: ToObject Conversions
319 /*
320 |----------------------------------------------------------------------------------------------------------------------------------------------------|
321 | Argument Type | Result                                                                                                                             |
322 |----------------------------------------------------------------------------------------------------------------------------------------------------|
323 | Undefined     | Throw a TypeError exception.                                                                                                       |
324 | Null          | Throw a TypeError exception.                                                                                                       |
325 | Boolean       | Return a new Boolean object whose [[BooleanData]] internal slot is set to argument. See 19.3 for a description of Boolean objects. |
326 | Number        | Return a new Number object whose [[NumberData]] internal slot is set to argument. See 20.1 for a description of Number objects.    |
327 | String        | Return a new String object whose [[StringData]] internal slot is set to argument. See 21.1 for a description of String objects.    |
328 | Symbol        | Return a new Symbol object whose [[SymbolData]] internal slot is set to argument. See 19.4 for a description of Symbol objects.    |
329 | Object        | Return argument.                                                                                                                   |
330 |----------------------------------------------------------------------------------------------------------------------------------------------------|
331 */
332 function ToObject(argument) { // eslint-disable-line no-unused-vars
333         if (argument === null || argument === undefined) {
334                 throw TypeError();
335         }
336   return Object(argument);
337 }
338
339 // _ESAbstract.GetV
340 /* global ToObject */
341 // 7.3.2 GetV (V, P)
342 function GetV(v, p) { // eslint-disable-line no-unused-vars
343         // 1. Assert: IsPropertyKey(P) is true.
344         // 2. Let O be ? ToObject(V).
345         var o = ToObject(v);
346         // 3. Return ? O.[[Get]](P, V).
347         return o[p];
348 }
349
350 // _ESAbstract.GetMethod
351 /* global GetV, IsCallable */
352 // 7.3.9. GetMethod ( V, P )
353 function GetMethod(V, P) { // eslint-disable-line no-unused-vars
354         // 1. Assert: IsPropertyKey(P) is true.
355         // 2. Let func be ? GetV(V, P).
356         var func = GetV(V, P);
357         // 3. If func is either undefined or null, return undefined.
358         if (func === null || func === undefined) {
359                 return undefined;
360         }
361         // 4. If IsCallable(func) is false, throw a TypeError exception.
362         if (IsCallable(func) === false) {
363                 throw new TypeError('Method not callable: ' + P);
364         }
365         // 5. Return func.
366         return func;
367 }
368
369 // _ESAbstract.ToUint32
370 // 7.1.6. ToUint32 ( argument )
371 function ToUint32(argument) { // eslint-disable-line no-unused-vars
372         // 1. Let number be ? ToNumber(argument).
373         var number = Number(argument);
374         // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.
375         if (isNaN(number) || 1/number === Infinity || 1/number === -Infinity || number === Infinity || number === -Infinity) {
376                 return 0;
377         }
378         // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).
379         var int = ((number < 0) ? -1 : 1) * Math.floor(Math.abs(number));
380         // 4. Let int32bit be int modulo 2^32.
381         var int32bit = int >>> 0;
382         // 5. Return int32bit.
383         return int32bit;
384 }
385
386 // _ESAbstract.Type
387 // "Type(x)" is used as shorthand for "the type of x"...
388 function Type(x) { // eslint-disable-line no-unused-vars
389         switch (typeof x) {
390                 case 'undefined':
391                         return 'undefined';
392                 case 'boolean':
393                         return 'boolean';
394                 case 'number':
395                         return 'number';
396                 case 'string':
397                         return 'string';
398                 case 'symbol':
399                         return 'symbol';
400                 default:
401                         // typeof null is 'object'
402                         if (x === null) return 'null';
403                         // Polyfill.io - This is here because a Symbol polyfill will have a typeof `object`.
404                         if ('Symbol' in this && x instanceof this.Symbol) return 'symbol';
405                         return 'object';
406         }
407 }
408
409 // _ESAbstract.GetPrototypeFromConstructor
410 /* global Get, Type */
411 // 9.1.14. GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
412 function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars
413         // 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object.
414         // 2. Assert: IsCallable(constructor) is true.
415         // 3. Let proto be ? Get(constructor, "prototype").
416         var proto = Get(constructor, "prototype");
417         // 4. If Type(proto) is not Object, then
418         if (Type(proto) !== 'object') {
419                 // a. Let realm be ? GetFunctionRealm(constructor).
420                 // b. Set proto to realm's intrinsic object named intrinsicDefaultProto.
421                 proto = intrinsicDefaultProto;
422         }
423         // 5. Return proto.
424         return proto;
425 }
426
427 // _ESAbstract.IsConstructor
428 /* global Type */
429 // 7.2.4. IsConstructor ( argument )
430 function IsConstructor(argument) { // eslint-disable-line no-unused-vars
431         // 1. If Type(argument) is not Object, return false.
432         if (Type(argument) !== 'object') {
433                 return false;
434         }
435         // 2. If argument has a [[Construct]] internal method, return true.
436         // 3. Return false.
437
438         // Polyfill.io - `new argument` is the only way  to truly test if a function is a constructor.
439         // We choose to not use`new argument` because the argument could have side effects when called.
440         // Instead we check to see if the argument is a function and if it has a prototype.
441         // Arrow functions do not have a [[Construct]] internal method, nor do they have a prototype.
442         return typeof argument === 'function' && !!argument.prototype;
443 }
444
445 // _ESAbstract.IsRegExp
446 /* global Type, Get, ToBoolean */
447 // 7.2.8. IsRegExp ( argument )
448 function IsRegExp(argument) { // eslint-disable-line no-unused-vars
449         // 1. If Type(argument) is not Object, return false.
450         if (Type(argument) !== 'object') {
451                 return false;
452         }
453         // 2. Let matcher be ? Get(argument, @@match).
454         var matcher = 'Symbol' in this && 'match' in this.Symbol ? Get(argument, this.Symbol.match) : undefined;
455         // 3. If matcher is not undefined, return ToBoolean(matcher).
456         if (matcher !== undefined) {
457                 return ToBoolean(matcher);
458         }
459         // 4. If argument has a [[RegExpMatcher]] internal slot, return true.
460         try {
461                 var lastIndex = argument.lastIndex;
462                 argument.lastIndex = 0;
463                 RegExp.prototype.exec.call(argument);
464                 return true;
465         } catch (e) {} finally {
466                 argument.lastIndex = lastIndex;
467         }
468         // 5. Return false.
469         return false;
470 }
471
472 // _ESAbstract.IteratorClose
473 /* global GetMethod, Type, Call */
474 // 7.4.6. IteratorClose ( iteratorRecord, completion )
475 function IteratorClose(iteratorRecord, completion) { // eslint-disable-line no-unused-vars
476         // 1. Assert: Type(iteratorRecord.[[Iterator]]) is Object.
477         if (Type(iteratorRecord['[[Iterator]]']) !== 'object') {
478                 throw new Error(Object.prototype.toString.call(iteratorRecord['[[Iterator]]']) + 'is not an Object.');
479         }
480         // 2. Assert: completion is a Completion Record.
481         // Polyfill.io - Ignoring this step as there is no way to check if something is a Completion Record in userland JavaScript.
482
483         // 3. Let iterator be iteratorRecord.[[Iterator]].
484         var iterator = iteratorRecord['[[Iterator]]'];
485         // 4. Let return be ? GetMethod(iterator, "return").
486         // Polyfill.io - We name it  returnMethod because return is a keyword and can not be used as an identifier (E.G. variable name, function name etc).
487         var returnMethod = GetMethod(iterator, "return");
488         // 5. If return is undefined, return Completion(completion).
489         if (returnMethod === undefined) {
490                 return completion;
491         }
492         // 6. Let innerResult be Call(return, iterator, « »).
493         try {
494                 var innerResult = Call(returnMethod, iterator);
495         } catch (error) {
496                 var innerException = error;
497         }
498         // 7. If completion.[[Type]] is throw, return Completion(completion).
499         if (completion) {
500                 return completion;
501         }
502         // 8. If innerResult.[[Type]] is throw, return Completion(innerResult).
503         if (innerException) {
504                 throw innerException;
505         }
506         // 9. If Type(innerResult.[[Value]]) is not Object, throw a TypeError exception.
507         if (Type(innerResult) !== 'object') {
508                 throw new TypeError("Iterator's return method returned a non-object.");
509         }
510         // 10. Return Completion(completion).
511         return completion;
512 }
513
514 // _ESAbstract.IteratorComplete
515 /* global Type, ToBoolean, Get */
516 // 7.4.3 IteratorComplete ( iterResult )
517 function IteratorComplete(iterResult) { // eslint-disable-line no-unused-vars
518         // 1. Assert: Type(iterResult) is Object.
519         if (Type(iterResult) !== 'object') {
520                 throw new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.');
521         }
522         // 2. Return ToBoolean(? Get(iterResult, "done")).
523         return ToBoolean(Get(iterResult, "done"));
524 }
525
526 // _ESAbstract.IteratorNext
527 /* global Call, Type */
528 // 7.4.2. IteratorNext ( iteratorRecord [ , value ] )
529 function IteratorNext(iteratorRecord /* [, value] */) { // eslint-disable-line no-unused-vars
530         // 1. If value is not present, then
531         if (arguments.length < 2) {
532                 // a. Let result be ? Call(iteratorRecord.[[NextMethod]], iteratorRecord.[[Iterator]], « »).
533                 var result = Call(iteratorRecord['[[NextMethod]]'], iteratorRecord['[[Iterator]]']);
534         // 2. Else,
535         } else {
536                 // a. Let result be ? Call(iteratorRecord.[[NextMethod]], iteratorRecord.[[Iterator]], « value »).
537                 result = Call(iteratorRecord['[[NextMethod]]'], iteratorRecord['[[Iterator]]'], [arguments[1]]);
538         }
539         // 3. If Type(result) is not Object, throw a TypeError exception.
540         if (Type(result) !== 'object') {
541                 throw new TypeError('bad iterator');
542         }
543         // 4. Return result.
544         return result;
545 }
546
547 // _ESAbstract.IteratorStep
548 /* global IteratorNext, IteratorComplete */
549 // 7.4.5. IteratorStep ( iteratorRecord )
550 function IteratorStep(iteratorRecord) { // eslint-disable-line no-unused-vars
551         // 1. Let result be ? IteratorNext(iteratorRecord).
552         var result = IteratorNext(iteratorRecord);
553         // 2. Let done be ? IteratorComplete(result).
554         var done = IteratorComplete(result);
555         // 3. If done is true, return false.
556         if (done === true) {
557                 return false;
558         }
559         // 4. Return result.
560         return result;
561 }
562
563 // _ESAbstract.IteratorValue
564 /* global Type, Get */
565 // 7.4.4 IteratorValue ( iterResult )
566 function IteratorValue(iterResult) { // eslint-disable-line no-unused-vars
567         // Assert: Type(iterResult) is Object.
568         if (Type(iterResult) !== 'object') {
569                 throw new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.');
570         }
571         // Return ? Get(iterResult, "value").
572         return Get(iterResult, "value");
573 }
574
575 // _ESAbstract.OrdinaryToPrimitive
576 /* global Get, IsCallable, Call, Type */
577 // 7.1.1.1. OrdinaryToPrimitive ( O, hint )
578 function OrdinaryToPrimitive(O, hint) { // eslint-disable-line no-unused-vars
579         // 1. Assert: Type(O) is Object.
580         // 2. Assert: Type(hint) is String and its value is either "string" or "number".
581         // 3. If hint is "string", then
582         if (hint === 'string') {
583                 // a. Let methodNames be « "toString", "valueOf" ».
584                 var methodNames = ['toString', 'valueOf'];
585                 // 4. Else,
586         } else {
587                 // a. Let methodNames be « "valueOf", "toString" ».
588                 methodNames = ['valueOf', 'toString'];
589         }
590         // 5. For each name in methodNames in List order, do
591         for (var i = 0; i < methodNames.length; ++i) {
592                 var name = methodNames[i];
593                 // a. Let method be ? Get(O, name).
594                 var method = Get(O, name);
595                 // b. If IsCallable(method) is true, then
596                 if (IsCallable(method)) {
597                         // i. Let result be ? Call(method, O).
598                         var result = Call(method, O);
599                         // ii. If Type(result) is not Object, return result.
600                         if (Type(result) !== 'object') {
601                                 return result;
602                         }
603                 }
604         }
605         // 6. Throw a TypeError exception.
606         throw new TypeError('Cannot convert to primitive.');
607 }
608
609 // _ESAbstract.SameValue
610 /* global Type, SameValueNonNumber */
611 // 7.2.10. SameValue ( x, y )
612 function SameValue(x, y) { // eslint-disable-line no-unused-vars
613         // 1. If Type(x) is different from Type(y), return false.
614         if (Type(x) !== Type(y)) {
615                 return false;
616         }
617         // 2. If Type(x) is Number, then
618         if (Type(x) === 'number') {
619                 // a. If x is NaN and y is NaN, return true.
620                 if (isNaN(x) && isNaN(y)) {
621                         return true;
622                 }
623                 // Polyfill.io - 0 === -0 is true, but they are not the same value.
624                 // b. If x is +0 and y is -0, return false.
625                 // c. If x is -0 and y is +0, return false.
626                 if (x === 0 && y === 0 && 1/x !== 1/y) {
627                         return false;
628                 }
629                 // d. If x is the same Number value as y, return true.
630                 if (x === y) {
631                         return true;
632                 }
633                 // e. Return false.
634                 return false;
635         }
636         // 3. Return SameValueNonNumber(x, y).
637         return SameValueNonNumber(x, y);
638 }
639
640 // _ESAbstract.SameValueZero
641 /* global Type, SameValueNonNumber */
642 // 7.2.11. SameValueZero ( x, y )
643 function SameValueZero (x, y) { // eslint-disable-line no-unused-vars
644         // 1. If Type(x) is different from Type(y), return false.
645         if (Type(x) !== Type(y)) {
646                 return false;
647         }
648         // 2. If Type(x) is Number, then
649         if (Type(x) === 'number') {
650                 // a. If x is NaN and y is NaN, return true.
651                 if (isNaN(x) && isNaN(y)) {
652                         return true;
653                 }
654                 // b. If x is +0 and y is -0, return true.
655                 if (1/x === Infinity && 1/y === -Infinity) {
656                         return true;
657                 }
658                 // c. If x is -0 and y is +0, return true.
659                 if (1/x === -Infinity && 1/y === Infinity) {
660                         return true;
661                 }
662                 // d. If x is the same Number value as y, return true.
663                 if (x === y) {
664                         return true;
665                 }
666                 // e. Return false.
667                 return false;
668         }
669         // 3. Return SameValueNonNumber(x, y).
670         return SameValueNonNumber(x, y);
671 }
672
673 // _ESAbstract.ToPrimitive
674 /* global Type, GetMethod, Call, OrdinaryToPrimitive */
675 // 7.1.1. ToPrimitive ( input [ , PreferredType ] )
676 function ToPrimitive(input /* [, PreferredType] */) { // eslint-disable-line no-unused-vars
677         var PreferredType = arguments.length > 1 ? arguments[1] : undefined;
678         // 1. Assert: input is an ECMAScript language value.
679         // 2. If Type(input) is Object, then
680         if (Type(input) === 'object') {
681                 // a. If PreferredType is not present, let hint be "default".
682                 if (arguments.length < 2) {
683                         var hint = 'default';
684                         // b. Else if PreferredType is hint String, let hint be "string".
685                 } else if (PreferredType === String) {
686                         hint = 'string';
687                         // c. Else PreferredType is hint Number, let hint be "number".
688                 } else if (PreferredType === Number) {
689                         hint = 'number';
690                 }
691                 // d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).
692                 var exoticToPrim = typeof this.Symbol === 'function' && typeof this.Symbol.toPrimitive === 'symbol' ? GetMethod(input, this.Symbol.toPrimitive) : undefined;
693                 // e. If exoticToPrim is not undefined, then
694                 if (exoticToPrim !== undefined) {
695                         // i. Let result be ? Call(exoticToPrim, input, « hint »).
696                         var result = Call(exoticToPrim, input, [hint]);
697                         // ii. If Type(result) is not Object, return result.
698                         if (Type(result) !== 'object') {
699                                 return result;
700                         }
701                         // iii. Throw a TypeError exception.
702                         throw new TypeError('Cannot convert exotic object to primitive.');
703                 }
704                 // f. If hint is "default", set hint to "number".
705                 if (hint === 'default') {
706                         hint = 'number';
707                 }
708                 // g. Return ? OrdinaryToPrimitive(input, hint).
709                 return OrdinaryToPrimitive(input, hint);
710         }
711         // 3. Return input
712         return input;
713 }
714
715 // _ESAbstract.ToString
716 /* global Type, ToPrimitive */
717 // 7.1.12. ToString ( argument )
718 // The abstract operation ToString converts argument to a value of type String according to Table 11:
719 // Table 11: ToString Conversions
720 /*
721 |---------------|--------------------------------------------------------|
722 | Argument Type | Result                                                 |
723 |---------------|--------------------------------------------------------|
724 | Undefined     | Return "undefined".                                    |
725 |---------------|--------------------------------------------------------|
726 | Null          | Return "null".                                         |
727 |---------------|--------------------------------------------------------|
728 | Boolean       | If argument is true, return "true".                    |
729 |               | If argument is false, return "false".                  |
730 |---------------|--------------------------------------------------------|
731 | Number        | Return NumberToString(argument).                       |
732 |---------------|--------------------------------------------------------|
733 | String        | Return argument.                                       |
734 |---------------|--------------------------------------------------------|
735 | Symbol        | Throw a TypeError exception.                           |
736 |---------------|--------------------------------------------------------|
737 | Object        | Apply the following steps:                             |
738 |               | Let primValue be ? ToPrimitive(argument, hint String). |
739 |               | Return ? ToString(primValue).                          |
740 |---------------|--------------------------------------------------------|
741 */
742 function ToString(argument) { // eslint-disable-line no-unused-vars
743         switch(Type(argument)) {
744                 case 'symbol':
745                         throw new TypeError('Cannot convert a Symbol value to a string');
746                         break;
747                 case 'object':
748                         var primValue = ToPrimitive(argument, 'string');
749                         return ToString(primValue);
750                 default:
751                         return String(argument);
752         }
753 }
754
755 // _ESAbstract.UTF16Decode
756 // 10.1.2. Static Semantics: UTF16Decode( lead, trail )
757 function UTF16Decode(lead, trail) { // eslint-disable-line no-unused-vars
758         // 1. Assert: 0xD800 ≤ lead ≤ 0xDBFF and 0xDC00 ≤ trail ≤ 0xDFFF.
759         // 2. Let cp be (lead - 0xD800) × 0x400 + (trail - 0xDC00) + 0x10000.
760         var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
761         // 3. Return the code point cp.
762         return cp;
763 }
764
765 // _ESAbstract.UTF16Encoding
766 // 10.1.1. Static Semantics: UTF16Encoding ( cp )
767 function UTF16Encoding(cp) { // eslint-disable-line no-unused-vars
768         // 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
769         // 2. If cp ≤ 0xFFFF, return cp.
770         if (cp <= 0xFFFF) {
771                 return cp;
772         } else {
773                 // 3. Let cu1 be floor((cp - 0x10000) / 0x400) + 0xD800.
774                 var cu1 = Math.floor((cp - 0x10000) / 0x400) + 0xD800;
775                 // 4. Let cu2 be ((cp - 0x10000) modulo 0x400) + 0xDC00.
776                 var cu2 = ((cp - 0x10000) % 0x400) + 0xDC00;
777                 // 5. Return the code unit sequence consisting of cu1 followed by cu2.
778                 return [cu1, cu2];
779         }
780 }
781
782 // _TypedArray
783 /*
784  Copyright (c) 2010, Linden Research, Inc.
785  Copyright (c) 2014, Joshua Bell
786
787  Permission is hereby granted, free of charge, to any person obtaining a copy
788  of this software and associated documentation files (the "Software"), to deal
789  in the Software without restriction, including without limitation the rights
790  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
791  copies of the Software, and to permit persons to whom the Software is
792  furnished to do so, subject to the following conditions:
793
794  The above copyright notice and this permission notice shall be included in
795  all copies or substantial portions of the Software.
796
797  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
798  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
799  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
800  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
801  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
802  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
803  THE SOFTWARE.
804  $/LicenseInfo$
805  */
806
807 // Original can be found at:
808 //   https://bitbucket.org/lindenlab/llsd
809 // Modifications by Joshua Bell inexorabletash@gmail.com
810 //   https://github.com/inexorabletash/polyfill
811
812 // ES3/ES5 implementation of the Krhonos Typed Array Specification
813 //   Ref: http://www.khronos.org/registry/typedarray/specs/latest/
814 //   Date: 2011-02-01
815 //
816 // Variations:
817 //  * Allows typed_array.get/set() as alias for subscripts (typed_array[])
818 //  * Gradually migrating structure from Khronos spec to ES2015 spec
819 //
820 // Caveats:
821 //  * Beyond 10000 or so entries, polyfilled array accessors (ta[0],
822 //    etc) become memory-prohibitive, so array creation will fail. Set
823 //    self.TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS=true to disable
824 //    creation of accessors. Your code will need to use the
825 //    non-standard get()/set() instead, and will need to add those to
826 //    native arrays for interop.
827 (function(global) {
828   'use strict';
829   var undefined = (void 0); // Paranoia
830
831   // Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to
832   // create, and consume so much memory, that the browser appears frozen.
833   var MAX_ARRAY_LENGTH = 1e5;
834
835   // Approximations of internal ECMAScript conversion functions
836   function Type(v) {
837     switch(typeof v) {
838     case 'undefined': return 'undefined';
839     case 'boolean': return 'boolean';
840     case 'number': return 'number';
841     case 'string': return 'string';
842     default: return v === null ? 'null' : 'object';
843     }
844   }
845
846   // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues:
847   function Class(v) { return Object.prototype.toString.call(v).replace(/^\[object *|\]$/g, ''); }
848   function IsCallable(o) { return typeof o === 'function'; }
849   function ToObject(v) {
850     if (v === null || v === undefined) throw TypeError();
851     return Object(v);
852   }
853   function ToInt32(v) { return v >> 0; }
854   function ToUint32(v) { return v >>> 0; }
855
856   // Snapshot intrinsics
857   var LN2 = Math.LN2,
858       abs = Math.abs,
859       floor = Math.floor,
860       log = Math.log,
861       max = Math.max,
862       min = Math.min,
863       pow = Math.pow,
864       round = Math.round;
865
866   // emulate ES5 getter/setter API using legacy APIs
867   // http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx
868   // (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but
869   // note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless)
870
871   (function() {
872     var orig = Object.defineProperty;
873     var dom_only = !(function(){try{return Object.defineProperty({},'x',{});}catch(_){return false;}}());
874
875     if (!orig || dom_only) {
876       Object.defineProperty = function (o, prop, desc) {
877         // In IE8 try built-in implementation for defining properties on DOM prototypes.
878         if (orig)
879           try { return orig(o, prop, desc); } catch (_) {}
880         if (o !== Object(o))
881           throw TypeError('Object.defineProperty called on non-object');
882         if (Object.prototype.__defineGetter__ && ('get' in desc))
883           Object.prototype.__defineGetter__.call(o, prop, desc.get);
884         if (Object.prototype.__defineSetter__ && ('set' in desc))
885           Object.prototype.__defineSetter__.call(o, prop, desc.set);
886         if ('value' in desc)
887           o[prop] = desc.value;
888         return o;
889       };
890     }
891   }());
892
893   // ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value)
894   // for index in 0 ... obj.length
895   function makeArrayAccessors(obj) {
896     if ('TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS' in global)
897       return;
898
899     if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');
900
901     function makeArrayAccessor(index) {
902       Object.defineProperty(obj, index, {
903         'get': function() { return obj._getter(index); },
904         'set': function(v) { obj._setter(index, v); },
905         enumerable: true,
906         configurable: false
907       });
908     }
909
910     var i;
911     for (i = 0; i < obj.length; i += 1) {
912       makeArrayAccessor(i);
913     }
914   }
915
916   // Internal conversion functions:
917   //    pack<Type>()   - take a number (interpreted as Type), output a byte array
918   //    unpack<Type>() - take a byte array, output a Type-like number
919
920   function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }
921   function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; }
922
923   function packI8(n) { return [n & 0xff]; }
924   function unpackI8(bytes) { return as_signed(bytes[0], 8); }
925
926   function packU8(n) { return [n & 0xff]; }
927   function unpackU8(bytes) { return as_unsigned(bytes[0], 8); }
928
929   function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; }
930
931   function packI16(n) { return [n & 0xff, (n >> 8) & 0xff]; }
932   function unpackI16(bytes) { return as_signed(bytes[1] << 8 | bytes[0], 16); }
933
934   function packU16(n) { return [n & 0xff, (n >> 8) & 0xff]; }
935   function unpackU16(bytes) { return as_unsigned(bytes[1] << 8 | bytes[0], 16); }
936
937   function packI32(n) { return [n & 0xff, (n >> 8) & 0xff, (n >> 16) & 0xff, (n >> 24) & 0xff]; }
938   function unpackI32(bytes) { return as_signed(bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0], 32); }
939
940   function packU32(n) { return [n & 0xff, (n >> 8) & 0xff, (n >> 16) & 0xff, (n >> 24) & 0xff]; }
941   function unpackU32(bytes) { return as_unsigned(bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0], 32); }
942
943   function packIEEE754(v, ebits, fbits) {
944
945     var bias = (1 << (ebits - 1)) - 1;
946
947     function roundToEven(n) {
948       var w = floor(n), f = n - w;
949       if (f < 0.5)
950         return w;
951       if (f > 0.5)
952         return w + 1;
953       return w % 2 ? w + 1 : w;
954     }
955
956     // Compute sign, exponent, fraction
957     var s, e, f;
958     if (v !== v) {
959       // NaN
960       // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping
961       e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0;
962     } else if (v === Infinity || v === -Infinity) {
963       e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0;
964     } else if (v === 0) {
965       e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0;
966     } else {
967       s = v < 0;
968       v = abs(v);
969
970       if (v >= pow(2, 1 - bias)) {
971         // Normalized
972         e = min(floor(log(v) / LN2), 1023);
973         var significand = v / pow(2, e);
974         if (significand < 1) {
975           e -= 1;
976           significand *= 2;
977         }
978         if (significand >= 2) {
979           e += 1;
980           significand /= 2;
981         }
982         var d = pow(2, fbits);
983         f = roundToEven(significand * d) - d;
984         e += bias;
985         if (f / d >= 1) {
986           e += 1;
987           f = 0;
988         }
989         if (e > 2 * bias) {
990           // Overflow
991           e = (1 << ebits) - 1;
992           f = 0;
993         }
994       } else {
995         // Denormalized
996         e = 0;
997         f = roundToEven(v / pow(2, 1 - bias - fbits));
998       }
999     }
1000
1001     // Pack sign, exponent, fraction
1002     var bits = [], i;
1003     for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); }
1004     for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); }
1005     bits.push(s ? 1 : 0);
1006     bits.reverse();
1007     var str = bits.join('');
1008
1009     // Bits to bytes
1010     var bytes = [];
1011     while (str.length) {
1012       bytes.unshift(parseInt(str.substring(0, 8), 2));
1013       str = str.substring(8);
1014     }
1015     return bytes;
1016   }
1017
1018   function unpackIEEE754(bytes, ebits, fbits) {
1019     // Bytes to bits
1020     var bits = [], i, j, b, str,
1021         bias, s, e, f;
1022
1023     for (i = 0; i < bytes.length; ++i) {
1024       b = bytes[i];
1025       for (j = 8; j; j -= 1) {
1026         bits.push(b % 2 ? 1 : 0); b = b >> 1;
1027       }
1028     }
1029     bits.reverse();
1030     str = bits.join('');
1031
1032     // Unpack sign, exponent, fraction
1033     bias = (1 << (ebits - 1)) - 1;
1034     s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
1035     e = parseInt(str.substring(1, 1 + ebits), 2);
1036     f = parseInt(str.substring(1 + ebits), 2);
1037
1038     // Produce number
1039     if (e === (1 << ebits) - 1) {
1040       return f !== 0 ? NaN : s * Infinity;
1041     } else if (e > 0) {
1042       // Normalized
1043       return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
1044     } else if (f !== 0) {
1045       // Denormalized
1046       return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
1047     } else {
1048       return s < 0 ? -0 : 0;
1049     }
1050   }
1051
1052   function unpackF64(b) { return unpackIEEE754(b, 11, 52); }
1053   function packF64(v) { return packIEEE754(v, 11, 52); }
1054   function unpackF32(b) { return unpackIEEE754(b, 8, 23); }
1055   function packF32(v) { return packIEEE754(v, 8, 23); }
1056
1057   //
1058   // 3 The ArrayBuffer Type
1059   //
1060
1061   (function() {
1062
1063     function ArrayBuffer(length) {
1064       length = ToInt32(length);
1065       if (length < 0) throw RangeError('ArrayBuffer size is not a small enough positive integer.');
1066       Object.defineProperty(this, 'byteLength', {value: length});
1067       Object.defineProperty(this, '_bytes', {value: Array(length)});
1068
1069       for (var i = 0; i < length; i += 1)
1070         this._bytes[i] = 0;
1071     }
1072
1073     global.ArrayBuffer = global.ArrayBuffer || ArrayBuffer;
1074
1075     //
1076     // 5 The Typed Array View Types
1077     //
1078
1079     function $TypedArray$() {
1080
1081       // %TypedArray% ( length )
1082       if (!arguments.length || typeof arguments[0] !== 'object') {
1083         return (function(length) {
1084           length = ToInt32(length);
1085           if (length < 0) throw RangeError('length is not a small enough positive integer.');
1086           Object.defineProperty(this, 'length', {value: length});
1087           Object.defineProperty(this, 'byteLength', {value: length * this.BYTES_PER_ELEMENT});
1088           Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(this.byteLength)});
1089           Object.defineProperty(this, 'byteOffset', {value: 0});
1090
1091          }).apply(this, arguments);
1092       }
1093
1094       // %TypedArray% ( typedArray )
1095       if (arguments.length >= 1 &&
1096           Type(arguments[0]) === 'object' &&
1097           arguments[0] instanceof $TypedArray$) {
1098         return (function(typedArray){
1099           if (this.constructor !== typedArray.constructor) throw TypeError();
1100
1101           var byteLength = typedArray.length * this.BYTES_PER_ELEMENT;
1102           Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(byteLength)});
1103           Object.defineProperty(this, 'byteLength', {value: byteLength});
1104           Object.defineProperty(this, 'byteOffset', {value: 0});
1105           Object.defineProperty(this, 'length', {value: typedArray.length});
1106
1107           for (var i = 0; i < this.length; i += 1)
1108             this._setter(i, typedArray._getter(i));
1109
1110         }).apply(this, arguments);
1111       }
1112
1113       // %TypedArray% ( array )
1114       if (arguments.length >= 1 &&
1115           Type(arguments[0]) === 'object' &&
1116           !(arguments[0] instanceof $TypedArray$) &&
1117           !(arguments[0] instanceof ArrayBuffer || Class(arguments[0]) === 'ArrayBuffer')) {
1118         return (function(array) {
1119
1120           var byteLength = array.length * this.BYTES_PER_ELEMENT;
1121           Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(byteLength)});
1122           Object.defineProperty(this, 'byteLength', {value: byteLength});
1123           Object.defineProperty(this, 'byteOffset', {value: 0});
1124           Object.defineProperty(this, 'length', {value: array.length});
1125
1126           for (var i = 0; i < this.length; i += 1) {
1127             var s = array[i];
1128             this._setter(i, Number(s));
1129           }
1130         }).apply(this, arguments);
1131       }
1132
1133       // %TypedArray% ( buffer, byteOffset=0, length=undefined )
1134       if (arguments.length >= 1 &&
1135           Type(arguments[0]) === 'object' &&
1136           (arguments[0] instanceof ArrayBuffer || Class(arguments[0]) === 'ArrayBuffer')) {
1137         return (function(buffer, byteOffset, length) {
1138
1139           byteOffset = ToUint32(byteOffset);
1140           if (byteOffset > buffer.byteLength)
1141             throw RangeError('byteOffset out of range');
1142
1143           // The given byteOffset must be a multiple of the element
1144           // size of the specific type, otherwise an exception is raised.
1145           if (byteOffset % this.BYTES_PER_ELEMENT)
1146             throw RangeError('buffer length minus the byteOffset is not a multiple of the element size.');
1147
1148           if (length === undefined) {
1149             var byteLength = buffer.byteLength - byteOffset;
1150             if (byteLength % this.BYTES_PER_ELEMENT)
1151               throw RangeError('length of buffer minus byteOffset not a multiple of the element size');
1152             length = byteLength / this.BYTES_PER_ELEMENT;
1153
1154           } else {
1155             length = ToUint32(length);
1156             byteLength = length * this.BYTES_PER_ELEMENT;
1157           }
1158
1159           if ((byteOffset + byteLength) > buffer.byteLength)
1160             throw RangeError('byteOffset and length reference an area beyond the end of the buffer');
1161
1162           Object.defineProperty(this, 'buffer', {value: buffer});
1163           Object.defineProperty(this, 'byteLength', {value: byteLength});
1164           Object.defineProperty(this, 'byteOffset', {value: byteOffset});
1165           Object.defineProperty(this, 'length', {value: length});
1166
1167         }).apply(this, arguments);
1168       }
1169
1170       // %TypedArray% ( all other argument combinations )
1171       throw TypeError();
1172     }
1173
1174     // Properties of the %TypedArray Instrinsic Object
1175
1176     // %TypedArray%.from ( source , mapfn=undefined, thisArg=undefined )
1177     Object.defineProperty($TypedArray$, 'from', {value: function(iterable) {
1178       return new this(iterable);
1179     }});
1180
1181     // %TypedArray%.of ( ...items )
1182     Object.defineProperty($TypedArray$, 'of', {value: function(/*...items*/) {
1183       return new this(arguments);
1184     }});
1185
1186     // %TypedArray%.prototype
1187     var $TypedArrayPrototype$ = {};
1188     $TypedArray$.prototype = $TypedArrayPrototype$;
1189
1190     // WebIDL: getter type (unsigned long index);
1191     Object.defineProperty($TypedArray$.prototype, '_getter', {value: function(index) {
1192       if (arguments.length < 1) throw SyntaxError('Not enough arguments');
1193
1194       index = ToUint32(index);
1195       if (index >= this.length)
1196         return undefined;
1197
1198       var bytes = [], i, o;
1199       for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
1200            i < this.BYTES_PER_ELEMENT;
1201            i += 1, o += 1) {
1202         bytes.push(this.buffer._bytes[o]);
1203       }
1204       return this._unpack(bytes);
1205     }});
1206
1207     // NONSTANDARD: convenience alias for getter: type get(unsigned long index);
1208     Object.defineProperty($TypedArray$.prototype, 'get', {value: $TypedArray$.prototype._getter});
1209
1210     // WebIDL: setter void (unsigned long index, type value);
1211     Object.defineProperty($TypedArray$.prototype, '_setter', {value: function(index, value) {
1212       if (arguments.length < 2) throw SyntaxError('Not enough arguments');
1213
1214       index = ToUint32(index);
1215       if (index >= this.length)
1216         return;
1217
1218       var bytes = this._pack(value), i, o;
1219       for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
1220            i < this.BYTES_PER_ELEMENT;
1221            i += 1, o += 1) {
1222         this.buffer._bytes[o] = bytes[i];
1223       }
1224     }});
1225
1226     // get %TypedArray%.prototype.buffer
1227     // get %TypedArray%.prototype.byteLength
1228     // get %TypedArray%.prototype.byteOffset
1229     // -- applied directly to the object in the constructor
1230
1231     // %TypedArray%.prototype.constructor
1232     Object.defineProperty($TypedArray$.prototype, 'constructor', {value: $TypedArray$});
1233
1234     // %TypedArray%.prototype.copyWithin (target, start, end = this.length )
1235     Object.defineProperty($TypedArray$.prototype, 'copyWithin', {value: function(target, start) {
1236       var end = arguments[2];
1237
1238       var o = ToObject(this);
1239       var lenVal = o.length;
1240       var len = ToUint32(lenVal);
1241       len = max(len, 0);
1242       var relativeTarget = ToInt32(target);
1243       var to;
1244       if (relativeTarget < 0)
1245         to = max(len + relativeTarget, 0);
1246       else
1247         to = min(relativeTarget, len);
1248       var relativeStart = ToInt32(start);
1249       var from;
1250       if (relativeStart < 0)
1251         from = max(len + relativeStart, 0);
1252       else
1253         from = min(relativeStart, len);
1254       var relativeEnd;
1255       if (end === undefined)
1256         relativeEnd = len;
1257       else
1258         relativeEnd = ToInt32(end);
1259       var final;
1260       if (relativeEnd < 0)
1261         final = max(len + relativeEnd, 0);
1262       else
1263         final = min(relativeEnd, len);
1264       var count = min(final - from, len - to);
1265       var direction;
1266       if (from < to && to < from + count) {
1267         direction = -1;
1268         from = from + count - 1;
1269         to = to + count - 1;
1270       } else {
1271         direction = 1;
1272       }
1273       while (count > 0) {
1274         o._setter(to, o._getter(from));
1275         from = from + direction;
1276         to = to + direction;
1277         count = count - 1;
1278       }
1279       return o;
1280     }});
1281
1282     // %TypedArray%.prototype.entries ( )
1283     // -- defined in es6.js to shim browsers w/ native TypedArrays
1284
1285     // %TypedArray%.prototype.every ( callbackfn, thisArg = undefined )
1286     Object.defineProperty($TypedArray$.prototype, 'every', {value: function(callbackfn) {
1287       if (this === undefined || this === null) throw TypeError();
1288       var t = Object(this);
1289       var len = ToUint32(t.length);
1290       if (!IsCallable(callbackfn)) throw TypeError();
1291       var thisArg = arguments[1];
1292       for (var i = 0; i < len; i++) {
1293         if (!callbackfn.call(thisArg, t._getter(i), i, t))
1294           return false;
1295       }
1296       return true;
1297     }});
1298
1299     // %TypedArray%.prototype.fill (value, start = 0, end = this.length )
1300     Object.defineProperty($TypedArray$.prototype, 'fill', {value: function(value) {
1301       var start = arguments[1],
1302           end = arguments[2];
1303
1304       var o = ToObject(this);
1305       var lenVal = o.length;
1306       var len = ToUint32(lenVal);
1307       len = max(len, 0);
1308       var relativeStart = ToInt32(start);
1309       var k;
1310       if (relativeStart < 0)
1311         k = max((len + relativeStart), 0);
1312       else
1313         k = min(relativeStart, len);
1314       var relativeEnd;
1315       if (end === undefined)
1316         relativeEnd = len;
1317       else
1318         relativeEnd = ToInt32(end);
1319       var final;
1320       if (relativeEnd < 0)
1321         final = max((len + relativeEnd), 0);
1322       else
1323         final = min(relativeEnd, len);
1324       while (k < final) {
1325         o._setter(k, value);
1326         k += 1;
1327       }
1328       return o;
1329     }});
1330
1331     // %TypedArray%.prototype.filter ( callbackfn, thisArg = undefined )
1332     Object.defineProperty($TypedArray$.prototype, 'filter', {value: function(callbackfn) {
1333       if (this === undefined || this === null) throw TypeError();
1334       var t = Object(this);
1335       var len = ToUint32(t.length);
1336       if (!IsCallable(callbackfn)) throw TypeError();
1337       var res = [];
1338       var thisp = arguments[1];
1339       for (var i = 0; i < len; i++) {
1340         var val = t._getter(i); // in case fun mutates this
1341         if (callbackfn.call(thisp, val, i, t))
1342           res.push(val);
1343       }
1344       return new this.constructor(res);
1345     }});
1346
1347     // %TypedArray%.prototype.find (predicate, thisArg = undefined)
1348     Object.defineProperty($TypedArray$.prototype, 'find', {value: function(predicate) {
1349       var o = ToObject(this);
1350       var lenValue = o.length;
1351       var len = ToUint32(lenValue);
1352       if (!IsCallable(predicate)) throw TypeError();
1353       var t = arguments.length > 1 ? arguments[1] : undefined;
1354       var k = 0;
1355       while (k < len) {
1356         var kValue = o._getter(k);
1357         var testResult = predicate.call(t, kValue, k, o);
1358         if (Boolean(testResult))
1359           return kValue;
1360         ++k;
1361       }
1362       return undefined;
1363     }});
1364
1365     // %TypedArray%.prototype.findIndex ( predicate, thisArg = undefined )
1366     Object.defineProperty($TypedArray$.prototype, 'findIndex', {value: function(predicate) {
1367       var o = ToObject(this);
1368       var lenValue = o.length;
1369       var len = ToUint32(lenValue);
1370       if (!IsCallable(predicate)) throw TypeError();
1371       var t = arguments.length > 1 ? arguments[1] : undefined;
1372       var k = 0;
1373       while (k < len) {
1374         var kValue = o._getter(k);
1375         var testResult = predicate.call(t, kValue, k, o);
1376         if (Boolean(testResult))
1377           return k;
1378         ++k;
1379       }
1380       return -1;
1381     }});
1382
1383     // %TypedArray%.prototype.forEach ( callbackfn, thisArg = undefined )
1384     Object.defineProperty($TypedArray$.prototype, 'forEach', {value: function(callbackfn) {
1385       if (this === undefined || this === null) throw TypeError();
1386       var t = Object(this);
1387       var len = ToUint32(t.length);
1388       if (!IsCallable(callbackfn)) throw TypeError();
1389       var thisp = arguments[1];
1390       for (var i = 0; i < len; i++)
1391         callbackfn.call(thisp, t._getter(i), i, t);
1392     }});
1393
1394     // %TypedArray%.prototype.indexOf (searchElement, fromIndex = 0 )
1395     Object.defineProperty($TypedArray$.prototype, 'indexOf', {value: function(searchElement) {
1396       if (this === undefined || this === null) throw TypeError();
1397       var t = Object(this);
1398       var len = ToUint32(t.length);
1399       if (len === 0) return -1;
1400       var n = 0;
1401       if (arguments.length > 0) {
1402         n = Number(arguments[1]);
1403         if (n !== n) {
1404           n = 0;
1405         } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
1406           n = (n > 0 || -1) * floor(abs(n));
1407         }
1408       }
1409       if (n >= len) return -1;
1410       var k = n >= 0 ? n : max(len - abs(n), 0);
1411       for (; k < len; k++) {
1412         if (t._getter(k) === searchElement) {
1413           return k;
1414         }
1415       }
1416       return -1;
1417     }});
1418
1419     // %TypedArray%.prototype.join ( separator )
1420     Object.defineProperty($TypedArray$.prototype, 'join', {value: function(separator) {
1421       if (this === undefined || this === null) throw TypeError();
1422       var t = Object(this);
1423       var len = ToUint32(t.length);
1424       var tmp = Array(len);
1425       for (var i = 0; i < len; ++i)
1426         tmp[i] = t._getter(i);
1427       return tmp.join(separator === undefined ? ',' : separator); // Hack for IE7
1428     }});
1429
1430     // %TypedArray%.prototype.keys ( )
1431     // -- defined in es6.js to shim browsers w/ native TypedArrays
1432
1433     // %TypedArray%.prototype.lastIndexOf ( searchElement, fromIndex = this.length-1 )
1434     Object.defineProperty($TypedArray$.prototype, 'lastIndexOf', {value: function(searchElement) {
1435       if (this === undefined || this === null) throw TypeError();
1436       var t = Object(this);
1437       var len = ToUint32(t.length);
1438       if (len === 0) return -1;
1439       var n = len;
1440       if (arguments.length > 1) {
1441         n = Number(arguments[1]);
1442         if (n !== n) {
1443           n = 0;
1444         } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
1445           n = (n > 0 || -1) * floor(abs(n));
1446         }
1447       }
1448       var k = n >= 0 ? min(n, len - 1) : len - abs(n);
1449       for (; k >= 0; k--) {
1450         if (t._getter(k) === searchElement)
1451           return k;
1452       }
1453       return -1;
1454     }});
1455
1456     // get %TypedArray%.prototype.length
1457     // -- applied directly to the object in the constructor
1458
1459     // %TypedArray%.prototype.map ( callbackfn, thisArg = undefined )
1460     Object.defineProperty($TypedArray$.prototype, 'map', {value: function(callbackfn) {
1461       if (this === undefined || this === null) throw TypeError();
1462       var t = Object(this);
1463       var len = ToUint32(t.length);
1464       if (!IsCallable(callbackfn)) throw TypeError();
1465       var res = []; res.length = len;
1466       var thisp = arguments[1];
1467       for (var i = 0; i < len; i++)
1468         res[i] = callbackfn.call(thisp, t._getter(i), i, t);
1469       return new this.constructor(res);
1470     }});
1471
1472     // %TypedArray%.prototype.reduce ( callbackfn [, initialValue] )
1473     Object.defineProperty($TypedArray$.prototype, 'reduce', {value: function(callbackfn) {
1474       if (this === undefined || this === null) throw TypeError();
1475       var t = Object(this);
1476       var len = ToUint32(t.length);
1477       if (!IsCallable(callbackfn)) throw TypeError();
1478       // no value to return if no initial value and an empty array
1479       if (len === 0 && arguments.length === 1) throw TypeError();
1480       var k = 0;
1481       var accumulator;
1482       if (arguments.length >= 2) {
1483         accumulator = arguments[1];
1484       } else {
1485         accumulator = t._getter(k++);
1486       }
1487       while (k < len) {
1488         accumulator = callbackfn.call(undefined, accumulator, t._getter(k), k, t);
1489         k++;
1490       }
1491       return accumulator;
1492     }});
1493
1494     // %TypedArray%.prototype.reduceRight ( callbackfn [, initialValue] )
1495     Object.defineProperty($TypedArray$.prototype, 'reduceRight', {value: function(callbackfn) {
1496       if (this === undefined || this === null) throw TypeError();
1497       var t = Object(this);
1498       var len = ToUint32(t.length);
1499       if (!IsCallable(callbackfn)) throw TypeError();
1500       // no value to return if no initial value, empty array
1501       if (len === 0 && arguments.length === 1) throw TypeError();
1502       var k = len - 1;
1503       var accumulator;
1504       if (arguments.length >= 2) {
1505         accumulator = arguments[1];
1506       } else {
1507         accumulator = t._getter(k--);
1508       }
1509       while (k >= 0) {
1510         accumulator = callbackfn.call(undefined, accumulator, t._getter(k), k, t);
1511         k--;
1512       }
1513       return accumulator;
1514     }});
1515
1516     // %TypedArray%.prototype.reverse ( )
1517     Object.defineProperty($TypedArray$.prototype, 'reverse', {value: function() {
1518       if (this === undefined || this === null) throw TypeError();
1519       var t = Object(this);
1520       var len = ToUint32(t.length);
1521       var half = floor(len / 2);
1522       for (var i = 0, j = len - 1; i < half; ++i, --j) {
1523         var tmp = t._getter(i);
1524         t._setter(i, t._getter(j));
1525         t._setter(j, tmp);
1526       }
1527       return t;
1528     }});
1529
1530     // %TypedArray%.prototype.set(array, offset = 0 )
1531     // %TypedArray%.prototype.set(typedArray, offset = 0 )
1532     // WebIDL: void set(TypedArray array, optional unsigned long offset);
1533     // WebIDL: void set(sequence<type> array, optional unsigned long offset);
1534     Object.defineProperty($TypedArray$.prototype, 'set', {value: function(index, value) {
1535       if (arguments.length < 1) throw SyntaxError('Not enough arguments');
1536       var array, sequence, offset, len,
1537           i, s, d,
1538           byteOffset, byteLength, tmp;
1539
1540       if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) {
1541         // void set(TypedArray array, optional unsigned long offset);
1542         array = arguments[0];
1543         offset = ToUint32(arguments[1]);
1544
1545         if (offset + array.length > this.length) {
1546           throw RangeError('Offset plus length of array is out of range');
1547         }
1548
1549         byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
1550         byteLength = array.length * this.BYTES_PER_ELEMENT;
1551
1552         if (array.buffer === this.buffer) {
1553           tmp = [];
1554           for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
1555             tmp[i] = array.buffer._bytes[s];
1556           }
1557           for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
1558             this.buffer._bytes[d] = tmp[i];
1559           }
1560         } else {
1561           for (i = 0, s = array.byteOffset, d = byteOffset;
1562                i < byteLength; i += 1, s += 1, d += 1) {
1563             this.buffer._bytes[d] = array.buffer._bytes[s];
1564           }
1565         }
1566       } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') {
1567         // void set(sequence<type> array, optional unsigned long offset);
1568         sequence = arguments[0];
1569         len = ToUint32(sequence.length);
1570         offset = ToUint32(arguments[1]);
1571
1572         if (offset + len > this.length) {
1573           throw RangeError('Offset plus length of array is out of range');
1574         }
1575
1576         for (i = 0; i < len; i += 1) {
1577           s = sequence[i];
1578           this._setter(offset + i, Number(s));
1579         }
1580       } else {
1581         throw TypeError('Unexpected argument type(s)');
1582       }
1583     }});
1584
1585     // %TypedArray%.prototype.slice ( start, end )
1586     Object.defineProperty($TypedArray$.prototype, 'slice', {value: function(start, end) {
1587       var o = ToObject(this);
1588       var lenVal = o.length;
1589       var len = ToUint32(lenVal);
1590       var relativeStart = ToInt32(start);
1591       var k = (relativeStart < 0) ? max(len + relativeStart, 0) : min(relativeStart, len);
1592       var relativeEnd = (end === undefined) ? len : ToInt32(end);
1593       var final = (relativeEnd < 0) ? max(len + relativeEnd, 0) : min(relativeEnd, len);
1594       var count = final - k;
1595       var c = o.constructor;
1596       var a = new c(count);
1597       var n = 0;
1598       while (k < final) {
1599         var kValue = o._getter(k);
1600         a._setter(n, kValue);
1601         ++k;
1602         ++n;
1603       }
1604       return a;
1605     }});
1606
1607     // %TypedArray%.prototype.some ( callbackfn, thisArg = undefined )
1608     Object.defineProperty($TypedArray$.prototype, 'some', {value: function(callbackfn) {
1609       if (this === undefined || this === null) throw TypeError();
1610       var t = Object(this);
1611       var len = ToUint32(t.length);
1612       if (!IsCallable(callbackfn)) throw TypeError();
1613       var thisp = arguments[1];
1614       for (var i = 0; i < len; i++) {
1615         if (callbackfn.call(thisp, t._getter(i), i, t)) {
1616           return true;
1617         }
1618       }
1619       return false;
1620     }});
1621
1622     // %TypedArray%.prototype.sort ( comparefn )
1623     Object.defineProperty($TypedArray$.prototype, 'sort', {value: function(comparefn) {
1624       if (this === undefined || this === null) throw TypeError();
1625       var t = Object(this);
1626       var len = ToUint32(t.length);
1627       var tmp = Array(len);
1628       for (var i = 0; i < len; ++i)
1629         tmp[i] = t._getter(i);
1630       function sortCompare(x, y) {
1631         if (x !== x && y !== y) return +0;
1632         if (x !== x) return 1;
1633         if (y !== y) return -1;
1634         if (comparefn !== undefined) {
1635           return comparefn(x, y);
1636         }
1637         if (x < y) return -1;
1638         if (x > y) return 1;
1639         return +0;
1640       }
1641       tmp.sort(sortCompare);
1642       for (i = 0; i < len; ++i)
1643         t._setter(i, tmp[i]);
1644       return t;
1645     }});
1646
1647     // %TypedArray%.prototype.subarray(begin = 0, end = this.length )
1648     // WebIDL: TypedArray subarray(long begin, optional long end);
1649     Object.defineProperty($TypedArray$.prototype, 'subarray', {value: function(start, end) {
1650       function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
1651
1652       start = ToInt32(start);
1653       end = ToInt32(end);
1654
1655       if (arguments.length < 1) { start = 0; }
1656       if (arguments.length < 2) { end = this.length; }
1657
1658       if (start < 0) { start = this.length + start; }
1659       if (end < 0) { end = this.length + end; }
1660
1661       start = clamp(start, 0, this.length);
1662       end = clamp(end, 0, this.length);
1663
1664       var len = end - start;
1665       if (len < 0) {
1666         len = 0;
1667       }
1668
1669       return new this.constructor(
1670         this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
1671     }});
1672
1673     // %TypedArray%.prototype.toLocaleString ( )
1674     // %TypedArray%.prototype.toString ( )
1675     // %TypedArray%.prototype.values ( )
1676     // %TypedArray%.prototype [ @@iterator ] ( )
1677     // get %TypedArray%.prototype [ @@toStringTag ]
1678     // -- defined in es6.js to shim browsers w/ native TypedArrays
1679
1680     function makeTypedArray(elementSize, pack, unpack) {
1681       // Each TypedArray type requires a distinct constructor instance with
1682       // identical logic, which this produces.
1683       var TypedArray = function() {
1684         Object.defineProperty(this, 'constructor', {value: TypedArray});
1685         $TypedArray$.apply(this, arguments);
1686         makeArrayAccessors(this);
1687       };
1688       if ('__proto__' in TypedArray) {
1689         TypedArray.__proto__ = $TypedArray$;
1690       } else {
1691         TypedArray.from = $TypedArray$.from;
1692         TypedArray.of = $TypedArray$.of;
1693       }
1694
1695       TypedArray.BYTES_PER_ELEMENT = elementSize;
1696
1697       var TypedArrayPrototype = function() {};
1698       TypedArrayPrototype.prototype = $TypedArrayPrototype$;
1699
1700       TypedArray.prototype = new TypedArrayPrototype();
1701
1702       Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});
1703       Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});
1704       Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});
1705
1706       return TypedArray;
1707     }
1708
1709     var Int8Array = makeTypedArray(1, packI8, unpackI8);
1710     var Uint8Array = makeTypedArray(1, packU8, unpackU8);
1711     var Uint8ClampedArray = makeTypedArray(1, packU8Clamped, unpackU8);
1712     var Int16Array = makeTypedArray(2, packI16, unpackI16);
1713     var Uint16Array = makeTypedArray(2, packU16, unpackU16);
1714     var Int32Array = makeTypedArray(4, packI32, unpackI32);
1715     var Uint32Array = makeTypedArray(4, packU32, unpackU32);
1716     var Float32Array = makeTypedArray(4, packF32, unpackF32);
1717     var Float64Array = makeTypedArray(8, packF64, unpackF64);
1718
1719     global.Int8Array = global.Int8Array || Int8Array;
1720     global.Uint8Array = global.Uint8Array || Uint8Array;
1721     global.Uint8ClampedArray = global.Uint8ClampedArray || Uint8ClampedArray;
1722     global.Int16Array = global.Int16Array || Int16Array;
1723     global.Uint16Array = global.Uint16Array || Uint16Array;
1724     global.Int32Array = global.Int32Array || Int32Array;
1725     global.Uint32Array = global.Uint32Array || Uint32Array;
1726     global.Float32Array = global.Float32Array || Float32Array;
1727     global.Float64Array = global.Float64Array || Float64Array;
1728   }());
1729
1730   //
1731   // 6 The DataView View Type
1732   //
1733
1734   (function() {
1735     function r(array, index) {
1736       return IsCallable(array.get) ? array.get(index) : array[index];
1737     }
1738
1739     var IS_BIG_ENDIAN = (function() {
1740       var u16array = new Uint16Array([0x1234]),
1741           u8array = new Uint8Array(u16array.buffer);
1742       return r(u8array, 0) === 0x12;
1743     }());
1744
1745     // DataView(buffer, byteOffset=0, byteLength=undefined)
1746     // WebIDL: Constructor(ArrayBuffer buffer,
1747     //                     optional unsigned long byteOffset,
1748     //                     optional unsigned long byteLength)
1749     function DataView(buffer, byteOffset, byteLength) {
1750       if (!(buffer instanceof ArrayBuffer || Class(buffer) === 'ArrayBuffer')) throw TypeError();
1751
1752       byteOffset = ToUint32(byteOffset);
1753       if (byteOffset > buffer.byteLength)
1754         throw RangeError('byteOffset out of range');
1755
1756       if (byteLength === undefined)
1757         byteLength = buffer.byteLength - byteOffset;
1758       else
1759         byteLength = ToUint32(byteLength);
1760
1761       if ((byteOffset + byteLength) > buffer.byteLength)
1762         throw RangeError('byteOffset and length reference an area beyond the end of the buffer');
1763
1764       Object.defineProperty(this, 'buffer', {value: buffer});
1765       Object.defineProperty(this, 'byteLength', {value: byteLength});
1766       Object.defineProperty(this, 'byteOffset', {value: byteOffset});
1767     };
1768
1769     // get DataView.prototype.buffer
1770     // get DataView.prototype.byteLength
1771     // get DataView.prototype.byteOffset
1772     // -- applied directly to instances by the constructor
1773
1774     function makeGetter(arrayType) {
1775       return function GetViewValue(byteOffset, littleEndian) {
1776         byteOffset = ToUint32(byteOffset);
1777
1778         if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength)
1779           throw RangeError('Array index out of range');
1780
1781         byteOffset += this.byteOffset;
1782
1783         var uint8Array = new Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT),
1784             bytes = [];
1785         for (var i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1)
1786           bytes.push(r(uint8Array, i));
1787
1788         if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN))
1789           bytes.reverse();
1790
1791         return r(new arrayType(new Uint8Array(bytes).buffer), 0);
1792       };
1793     }
1794
1795     Object.defineProperty(DataView.prototype, 'getUint8', {value: makeGetter(Uint8Array)});
1796     Object.defineProperty(DataView.prototype, 'getInt8', {value: makeGetter(Int8Array)});
1797     Object.defineProperty(DataView.prototype, 'getUint16', {value: makeGetter(Uint16Array)});
1798     Object.defineProperty(DataView.prototype, 'getInt16', {value: makeGetter(Int16Array)});
1799     Object.defineProperty(DataView.prototype, 'getUint32', {value: makeGetter(Uint32Array)});
1800     Object.defineProperty(DataView.prototype, 'getInt32', {value: makeGetter(Int32Array)});
1801     Object.defineProperty(DataView.prototype, 'getFloat32', {value: makeGetter(Float32Array)});
1802     Object.defineProperty(DataView.prototype, 'getFloat64', {value: makeGetter(Float64Array)});
1803
1804     function makeSetter(arrayType) {
1805       return function SetViewValue(byteOffset, value, littleEndian) {
1806         byteOffset = ToUint32(byteOffset);
1807         if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength)
1808           throw RangeError('Array index out of range');
1809
1810         // Get bytes
1811         var typeArray = new arrayType([value]),
1812             byteArray = new Uint8Array(typeArray.buffer),
1813             bytes = [], i, byteView;
1814
1815         for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1)
1816           bytes.push(r(byteArray, i));
1817
1818         // Flip if necessary
1819         if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN))
1820           bytes.reverse();
1821
1822         // Write them
1823         byteView = new Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
1824         byteView.set(bytes);
1825       };
1826     }
1827
1828     Object.defineProperty(DataView.prototype, 'setUint8', {value: makeSetter(Uint8Array)});
1829     Object.defineProperty(DataView.prototype, 'setInt8', {value: makeSetter(Int8Array)});
1830     Object.defineProperty(DataView.prototype, 'setUint16', {value: makeSetter(Uint16Array)});
1831     Object.defineProperty(DataView.prototype, 'setInt16', {value: makeSetter(Int16Array)});
1832     Object.defineProperty(DataView.prototype, 'setUint32', {value: makeSetter(Uint32Array)});
1833     Object.defineProperty(DataView.prototype, 'setInt32', {value: makeSetter(Int32Array)});
1834     Object.defineProperty(DataView.prototype, 'setFloat32', {value: makeSetter(Float32Array)});
1835     Object.defineProperty(DataView.prototype, 'setFloat64', {value: makeSetter(Float64Array)});
1836
1837     global.DataView = global.DataView || DataView;
1838
1839   }());
1840
1841 }(self));
1842 if (!("defineProperty"in Object&&function(){try{var e={}
1843 return Object.defineProperty(e,"test",{value:42}),!0}catch(t){return!1}}()
1844 )) {
1845
1846 // Object.defineProperty
1847 (function (nativeDefineProperty) {
1848
1849         var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__');
1850         var ERR_ACCESSORS_NOT_SUPPORTED = 'Getters & setters cannot be defined on this javascript engine';
1851         var ERR_VALUE_ACCESSORS = 'A property cannot both have accessors and be writable or have a value';
1852
1853         // Polyfill.io - This does not use CreateMethodProperty because our CreateMethodProperty function uses Object.defineProperty.
1854         Object['defineProperty'] = function defineProperty(object, property, descriptor) {
1855
1856                 // Where native support exists, assume it
1857                 if (nativeDefineProperty && (object === window || object === document || object === Element.prototype || object instanceof Element)) {
1858                         return nativeDefineProperty(object, property, descriptor);
1859                 }
1860
1861                 if (object === null || !(object instanceof Object || typeof object === 'object')) {
1862                         throw new TypeError('Object.defineProperty called on non-object');
1863                 }
1864
1865                 if (!(descriptor instanceof Object)) {
1866                         throw new TypeError('Property description must be an object');
1867                 }
1868
1869                 var propertyString = String(property);
1870                 var hasValueOrWritable = 'value' in descriptor || 'writable' in descriptor;
1871                 var getterType = 'get' in descriptor && typeof descriptor.get;
1872                 var setterType = 'set' in descriptor && typeof descriptor.set;
1873
1874                 // handle descriptor.get
1875                 if (getterType) {
1876                         if (getterType !== 'function') {
1877                                 throw new TypeError('Getter must be a function');
1878                         }
1879                         if (!supportsAccessors) {
1880                                 throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
1881                         }
1882                         if (hasValueOrWritable) {
1883                                 throw new TypeError(ERR_VALUE_ACCESSORS);
1884                         }
1885                         Object.__defineGetter__.call(object, propertyString, descriptor.get);
1886                 } else {
1887                         object[propertyString] = descriptor.value;
1888                 }
1889
1890                 // handle descriptor.set
1891                 if (setterType) {
1892                         if (setterType !== 'function') {
1893                                 throw new TypeError('Setter must be a function');
1894                         }
1895                         if (!supportsAccessors) {
1896                                 throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
1897                         }
1898                         if (hasValueOrWritable) {
1899                                 throw new TypeError(ERR_VALUE_ACCESSORS);
1900                         }
1901                         Object.__defineSetter__.call(object, propertyString, descriptor.set);
1902                 }
1903
1904                 // OK to define value unconditionally - if a getter has been specified as well, an error would be thrown above
1905                 if ('value' in descriptor) {
1906                         object[propertyString] = descriptor.value;
1907                 }
1908
1909                 return object;
1910         };
1911 }(Object.defineProperty));
1912
1913 }
1914
1915
1916 // _ESAbstract.CreateDataProperty
1917 // 7.3.4. CreateDataProperty ( O, P, V )
1918 // NOTE
1919 // This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator.
1920 // Normally, the property will not already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return false.
1921 function CreateDataProperty(O, P, V) { // eslint-disable-line no-unused-vars
1922         // 1. Assert: Type(O) is Object.
1923         // 2. Assert: IsPropertyKey(P) is true.
1924         // 3. Let newDesc be the PropertyDescriptor{ [[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }.
1925         var newDesc = {
1926                 value: V,
1927                 writable: true,
1928                 enumerable: true,
1929                 configurable: true
1930         };
1931         // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).
1932         try {
1933                 Object.defineProperty(O, P, newDesc);
1934                 return true;
1935         } catch (e) {
1936                 return false;
1937         }
1938 }
1939
1940 // _ESAbstract.CreateDataPropertyOrThrow
1941 /* global CreateDataProperty */
1942 // 7.3.6. CreateDataPropertyOrThrow ( O, P, V )
1943 function CreateDataPropertyOrThrow(O, P, V) { // eslint-disable-line no-unused-vars
1944         // 1. Assert: Type(O) is Object.
1945         // 2. Assert: IsPropertyKey(P) is true.
1946         // 3. Let success be ? CreateDataProperty(O, P, V).
1947         var success = CreateDataProperty(O, P, V);
1948         // 4. If success is false, throw a TypeError exception.
1949         if (!success) {
1950                 throw new TypeError('Cannot assign value `' + Object.prototype.toString.call(V) + '` to property `' + Object.prototype.toString.call(P) + '` on object `' + Object.prototype.toString.call(O) + '`');
1951         }
1952         // 5. Return success.
1953         return success;
1954 }
1955
1956 // _ESAbstract.CreateIterResultObject
1957 /* global Type, CreateDataProperty */
1958 // 7.4.7. CreateIterResultObject ( value, done )
1959 function CreateIterResultObject(value, done) { // eslint-disable-line no-unused-vars
1960         // 1. Assert: Type(done) is Boolean.
1961         if (Type(done) !== 'boolean') {
1962                 throw new Error();
1963         }
1964         // 2. Let obj be ObjectCreate(%ObjectPrototype%).
1965         var obj = {};
1966         // 3. Perform CreateDataProperty(obj, "value", value).
1967         CreateDataProperty(obj, "value", value);
1968         // 4. Perform CreateDataProperty(obj, "done", done).
1969         CreateDataProperty(obj, "done", done);
1970         // 5. Return obj.
1971         return obj;
1972 }
1973
1974 // _ESAbstract.CreateMethodProperty
1975 // 7.3.5. CreateMethodProperty ( O, P, V )
1976 function CreateMethodProperty(O, P, V) { // eslint-disable-line no-unused-vars
1977         // 1. Assert: Type(O) is Object.
1978         // 2. Assert: IsPropertyKey(P) is true.
1979         // 3. Let newDesc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}.
1980         var newDesc = {
1981                 value: V,
1982                 writable: true,
1983                 enumerable: false,
1984                 configurable: true
1985         };
1986         // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).
1987         Object.defineProperty(O, P, newDesc);
1988 }
1989 if (!("isArray"in Array
1990 )) {
1991
1992 // Array.isArray
1993 /* global CreateMethodProperty, IsArray */
1994 // 22.1.2.2. Array.isArray ( arg )
1995 CreateMethodProperty(Array, 'isArray', function isArray(arg) {
1996         // 1. Return ? IsArray(arg).
1997         return IsArray(arg);
1998 });
1999
2000 }
2001
2002 if (!("copyWithin"in Array.prototype&&function(){try{var t=function n(){}
2003 t.prototype[0]="foo"
2004 var o=new t
2005 o[1]=1,o[2]=2,o.length=3
2006 var r=Array.prototype.copyWithin.call(o,1,0)
2007 return!(!r[0]||Object.prototype.hasOwnProperty.call(r,"0")||!Object.prototype.hasOwnProperty.call(r,"1")||"foo"!==r[0]||"foo"!==r[1]||1!==r[2]||3!==r.length)}catch(e){return!1}}()
2008 )) {
2009
2010 // Array.prototype.copyWithin
2011 /* global CreateMethodProperty, HasProperty, ToInteger */
2012 // 22.1.3.3 Array.prototype.copyWithin ( target, start [ , end ] )
2013 CreateMethodProperty(Array.prototype, 'copyWithin', function copyWithin(target, start /* [ , end ] */ ) {
2014         'use strict';
2015         var end = arguments[2];
2016
2017         // 22.1.3.3.1 Let O be ? ToObject(this value).
2018         if (this === null || this === undefined) {
2019                 throw new TypeError('Cannot call method on ' + this);
2020         }
2021
2022         var o = Object(this);
2023
2024         // 22.1.3.3.2 Let len be ? ToLength(? Get(O, "length")).
2025         var len = ToInteger(o.length);
2026         if (len <= 0) {
2027                 len = 0;
2028         }
2029         if (len === Infinity) {
2030                 len = Math.pow(2, 53) - 1;
2031         } else {
2032                 len = Math.min(len, Math.pow(2, 53) - 1);
2033         }
2034         len = Math.max(len, 0);
2035
2036         // 22.1.3.3.3 Let relativeTarget be ? ToInteger(target).
2037         var relativeTarget = ToInteger(target);
2038
2039         // 22.1.3.3.4 If relativeTarget < 0, let to be max((len + relativeTarget), 0); else let to be min(relativeTarget, len).
2040         var to;
2041         if (relativeTarget < 0) {
2042                 to = Math.max(len + relativeTarget, 0);
2043         } else {
2044                 to = Math.min(relativeTarget, len);
2045         }
2046
2047         // 22.1.3.3.5 Let relativeStart be ? ToInteger(start).
2048         var relativeStart = ToInteger(start);
2049
2050         // 22.1.3.3.6 If relativeStart < 0, let from be max((len + relativeStart), 0); else let from be min(relativeStart, len).
2051         var from;
2052         if (relativeStart < 0) {
2053                 from = Math.max(len + relativeStart, 0);
2054         } else {
2055                 from = Math.min(relativeStart, len);
2056         }
2057
2058         // 22.1.3.3.7 If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).
2059         var relativeEnd;
2060         if (end === undefined) {
2061                 relativeEnd = len;
2062         } else {
2063                 relativeEnd = ToInteger(end);
2064         }
2065
2066         // 22.1.3.3.8 If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).
2067         var final;
2068         if (relativeEnd < 0) {
2069                 final = Math.max(len + relativeEnd, 0);
2070         } else {
2071                 final = Math.min(relativeEnd, len);
2072         }
2073
2074         // 22.1.3.3.9 Let count be min(final-from, len-to).
2075         var count = Math.min(final - from, len - to);
2076
2077         // 22.1.3.3.10 If from<to and to<from+count, then
2078         var direction;
2079         if (from < to && to < from + count) {
2080                 // 22.1.3.3.10.a Let direction be -1.
2081                 direction = -1;
2082
2083                 // 22.1.3.3.10.b Let from be from + count - 1.
2084                 from = from + count - 1;
2085
2086                 // 22.1.3.3.10.c Let to be to + count - 1.
2087                 to = to + count - 1;
2088         } else {
2089                 // 22.1.3.3.11 Else,
2090                 // 22.1.3.3.11.a Let direction be 1.
2091                 direction = 1;
2092         }
2093
2094         // 22.1.3.3.12 Repeat, while count > 0
2095         while (count > 0) {
2096                 // 22.1.3.3.12.a Let fromKey be ! ToString(from).
2097                 var fromKey = String(from);
2098                 // 22.1.3.3.12.b Let toKey be ! ToString(to).
2099                 var toKey = String(to);
2100                 // 22.1.3.3.12.c Let fromPresent be ? HasProperty(O, fromKey).
2101                 var fromPresent = HasProperty(o, fromKey);
2102                 // 22.1.3.3.12.d If fromPresent is true, then
2103                 if (fromPresent) {
2104                         // 22.1.3.3.12.d.i Let fromVal be ? Get(O, fromKey).
2105                         var fromVal = o[fromKey];
2106                         // 22.1.3.3.12.d.ii Perform ? Set(O, toKey, fromVal, true).
2107                         o[toKey] = fromVal;
2108                 } else {
2109                         // 22.1.3.3.12.e Else fromPresent is false,
2110                         // 22.1.3.3.12.e.i Perform ? DeletePropertyOrThrow(O, toKey).
2111                         delete o[toKey];
2112                 }
2113                 // 22.1.3.3.12.f Let from be from + direction.
2114                 from = from + direction;
2115                 // 22.1.3.3.12.g Let to be to + direction.
2116                 to = to + direction;
2117                 // 22.1.3.3.12.h Let count be count - 1.
2118                 count = count - 1;
2119         }
2120         // 22.1.3.3.13 Return O.
2121         return o;
2122 });
2123
2124 }
2125
2126 if (!("fill"in Array.prototype
2127 )) {
2128
2129 // Array.prototype.fill
2130 /* global CreateMethodProperty, Get, ToInteger, ToLength, ToObject, ToString */
2131 // 22.1.3.6. Array.prototype.fill ( value [ , start [ , end ] ] )
2132 CreateMethodProperty(Array.prototype, 'fill', function fill(value /* [ , start [ , end ] ] */) {
2133         var start = arguments[1];
2134         var end = arguments[2];
2135         // 1. Let O be ? ToObject(this value).
2136         var O = ToObject(this);
2137         // 2. Let len be ? ToLength(? Get(O, "length")).
2138         var len = ToLength(Get(O, "length"));
2139         // 3. Let relativeStart be ? ToInteger(start).
2140         var relativeStart = ToInteger(start);
2141         // 4. If relativeStart < 0, let k be max((len + relativeStart), 0); else let k be min(relativeStart, len)
2142         var k = relativeStart < 0 ? Math.max((len + relativeStart), 0) : Math.min(relativeStart, len);
2143         // 5. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).
2144         var relativeEnd = end === undefined ? len : ToInteger(end);
2145         // 6. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).
2146         var final = relativeEnd < 0 ? Math.max((len + relativeEnd), 0) : Math.min(relativeEnd, len);
2147         // 7. Repeat, while k < final
2148         while (k < final) {
2149                 // a. Let Pk be ! ToString(k).
2150                 var Pk = ToString(k);
2151                 // b. Perform ? Set(O, Pk, value, true).
2152                 O[Pk] = value;
2153                 // c. Increase k by 1.
2154                 k = k + 1;
2155         }
2156         // 8. Return O.
2157         return O;
2158 });
2159
2160 }
2161
2162 if (!("find"in Array.prototype
2163 )) {
2164
2165 // Array.prototype.find
2166 /* global Call, CreateMethodProperty, Get, IsCallable, ToBoolean, ToLength, ToObject, ToString */
2167 // 22.1.3.8 Array.prototype.find ( predicate [ , thisArg ] )
2168 CreateMethodProperty(Array.prototype, 'find', function find( predicate /* [ , thisArg ] */) {
2169         // 1. Let O be ? ToObject(this value).
2170         var O = ToObject(this);
2171         // 2. Let len be ? ToLength(? Get(O, "length")).
2172         var len = ToLength(Get(O, "length"));
2173         // 3. If IsCallable(predicate) is false, throw a TypeError exception.
2174         if (IsCallable(predicate) === false) {
2175                 throw new TypeError(predicate + ' is not a function');
2176         }
2177         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
2178         var T = arguments.length > 1 ? arguments[1] : undefined;
2179         // 5. Let k be 0.
2180         var k = 0;
2181         // 6. Repeat, while k < len
2182         while (k < len) {
2183                 // a. Let Pk be ! ToString(k).
2184                 var Pk = ToString(k);
2185                 // b. Let kValue be ? Get(O, Pk).
2186                 var kValue = Get(O, Pk);
2187                 // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
2188                 var testResult = ToBoolean(Call(predicate, T, [kValue, k, O ]));
2189                 // d. If testResult is true, return kValue.
2190                 if (testResult) {
2191                         return kValue;
2192                 }
2193                 // e. Increase k by 1.
2194                 var k = k + 1;
2195         }
2196         // 7. Return undefined.
2197         return undefined;
2198 });
2199
2200 }
2201
2202 if (!("findIndex"in Array.prototype
2203 )) {
2204
2205 // Array.prototype.findIndex
2206 /* global Call, CreateMethodProperty, Get, IsCallable, ToBoolean, ToLength, ToObject, ToString */
2207 // 22.1.3.9. Array.prototype.findIndex ( predicate [ , thisArg ] )
2208 CreateMethodProperty(Array.prototype, 'findIndex', function findIndex(predicate /* [ , thisArg ] */) {
2209         // 1. Let O be ? ToObject(this value).
2210         var O = ToObject(this);
2211         // 2. Let len be ? ToLength(? Get(O, "length")).
2212         var len = ToLength(Get(O, "length"));
2213         // 3. If IsCallable(predicate) is false, throw a TypeError exception.
2214         if (IsCallable(predicate) === false) {
2215                 throw new TypeError(predicate + ' is not a function');
2216         }
2217         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
2218         var T = arguments.length > 1 ? arguments[1] : undefined;
2219         // 5. Let k be 0.
2220         var k = 0;
2221         // 6. Repeat, while k < len
2222         while (k < len) {
2223                 // a. Let Pk be ! ToString(k).
2224                 var Pk = ToString(k);
2225                 // b. Let kValue be ? Get(O, Pk).
2226                 var kValue = Get(O, Pk);
2227                 // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
2228                 var testResult = ToBoolean(Call(predicate, T, [kValue, k, O]));
2229                 // d. If testResult is true, return k.
2230                 if (testResult) {
2231                         return k;
2232                 }
2233                 // e. Increase k by 1.
2234                 k = k + 1;
2235         }
2236         // 7. Return -1.
2237         return -1;
2238 });
2239
2240 }
2241
2242 if (!("forEach"in Array.prototype
2243 )) {
2244
2245 // Array.prototype.forEach
2246 /* global Call, CreateMethodProperty, Get, HasProperty, IsCallable, ToLength, ToObject, ToString */
2247 // 22.1.3.10. Array.prototype.forEach ( callbackfn [ , thisArg ] )
2248 CreateMethodProperty(Array.prototype, 'forEach', function forEach(callbackfn /* [ , thisArg ] */) {
2249         // 1. Let O be ? ToObject(this value).
2250         var O = ToObject(this);
2251         // Polyfill.io - If O is a String object, split it into an array in order to iterate correctly.
2252         // We will use arrayLike in place of O when we are iterating through the list.
2253         var arraylike = O instanceof String ? O.split('') : O;
2254         // 2. Let len be ? ToLength(? Get(O, "length")).
2255         var len = ToLength(Get(O, "length"));
2256         // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
2257         if (IsCallable(callbackfn) === false) {
2258                 throw new TypeError(callbackfn + ' is not a function');
2259         }
2260         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
2261         var T = arguments.length > 1 ? arguments[1] : undefined;
2262         // 5. Let k be 0.
2263         var k = 0;
2264         // 6. Repeat, while k < len
2265         while (k < len) {
2266                 // a. Let Pk be ! ToString(k).
2267                 var Pk = ToString(k);
2268                 // b. Let kPresent be ? HasProperty(O, Pk).
2269                 var kPresent = HasProperty(arraylike, Pk);
2270                 // c. If kPresent is true, then
2271                 if (kPresent) {
2272                         // i. Let kValue be ? Get(O, Pk).
2273                         var kValue = Get(arraylike, Pk);
2274                         // ii. Perform ? Call(callbackfn, T, « kValue, k, O »).
2275                         Call(callbackfn, T, [kValue, k, O]);
2276                 }
2277                 // d. Increase k by 1.
2278                 k = k + 1;
2279         }
2280         // 7. Return undefined.
2281         return undefined;
2282 });
2283
2284 }
2285
2286 if (!("bind"in Function.prototype
2287 )) {
2288
2289 // Function.prototype.bind
2290 /* global CreateMethodProperty, IsCallable */
2291 // 19.2.3.2. Function.prototype.bind ( thisArg, ...args )
2292 // https://github.com/es-shims/es5-shim/blob/d6d7ff1b131c7ba14c798cafc598bb6780d37d3b/es5-shim.js#L182
2293 CreateMethodProperty(Function.prototype, 'bind', function bind(that) { // .length is 1
2294         // add necessary es5-shim utilities
2295         var $Array = Array;
2296         var $Object = Object;
2297         var ArrayPrototype = $Array.prototype;
2298         var Empty = function Empty() { };
2299         var array_slice = ArrayPrototype.slice;
2300         var array_concat = ArrayPrototype.concat;
2301         var array_push = ArrayPrototype.push;
2302         var max = Math.max;
2303         // /add necessary es5-shim utilities
2304
2305         // 1. Let Target be the this value.
2306         var target = this;
2307         // 2. If IsCallable(Target) is false, throw a TypeError exception.
2308         if (!IsCallable(target)) {
2309                 throw new TypeError('Function.prototype.bind called on incompatible ' + target);
2310         }
2311         // 3. Let A be a new (possibly empty) internal list of all of the
2312         //   argument values provided after thisArg (arg1, arg2 etc), in order.
2313         // XXX slicedArgs will stand in for "A" if used
2314         var args = array_slice.call(arguments, 1); // for normal call
2315         // 4. Let F be a new native ECMAScript object.
2316         // 11. Set the [[Prototype]] internal property of F to the standard
2317         //   built-in Function prototype object as specified in 15.3.3.1.
2318         // 12. Set the [[Call]] internal property of F as described in
2319         //   15.3.4.5.1.
2320         // 13. Set the [[Construct]] internal property of F as described in
2321         //   15.3.4.5.2.
2322         // 14. Set the [[HasInstance]] internal property of F as described in
2323         //   15.3.4.5.3.
2324         var bound;
2325         var binder = function () {
2326
2327                 if (this instanceof bound) {
2328                         // 15.3.4.5.2 [[Construct]]
2329                         // When the [[Construct]] internal method of a function object,
2330                         // F that was created using the bind function is called with a
2331                         // list of arguments ExtraArgs, the following steps are taken:
2332                         // 1. Let target be the value of F's [[TargetFunction]]
2333                         //   internal property.
2334                         // 2. If target has no [[Construct]] internal method, a
2335                         //   TypeError exception is thrown.
2336                         // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
2337                         //   property.
2338                         // 4. Let args be a new list containing the same values as the
2339                         //   list boundArgs in the same order followed by the same
2340                         //   values as the list ExtraArgs in the same order.
2341                         // 5. Return the result of calling the [[Construct]] internal
2342                         //   method of target providing args as the arguments.
2343
2344                         var result = target.apply(
2345                                 this,
2346                                 array_concat.call(args, array_slice.call(arguments))
2347                         );
2348                         if ($Object(result) === result) {
2349                                 return result;
2350                         }
2351                         return this;
2352
2353                 } else {
2354                         // 15.3.4.5.1 [[Call]]
2355                         // When the [[Call]] internal method of a function object, F,
2356                         // which was created using the bind function is called with a
2357                         // this value and a list of arguments ExtraArgs, the following
2358                         // steps are taken:
2359                         // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
2360                         //   property.
2361                         // 2. Let boundThis be the value of F's [[BoundThis]] internal
2362                         //   property.
2363                         // 3. Let target be the value of F's [[TargetFunction]] internal
2364                         //   property.
2365                         // 4. Let args be a new list containing the same values as the
2366                         //   list boundArgs in the same order followed by the same
2367                         //   values as the list ExtraArgs in the same order.
2368                         // 5. Return the result of calling the [[Call]] internal method
2369                         //   of target providing boundThis as the this value and
2370                         //   providing args as the arguments.
2371
2372                         // equiv: target.call(this, ...boundArgs, ...args)
2373                         return target.apply(
2374                                 that,
2375                                 array_concat.call(args, array_slice.call(arguments))
2376                         );
2377
2378                 }
2379
2380         };
2381
2382         // 15. If the [[Class]] internal property of Target is "Function", then
2383         //     a. Let L be the length property of Target minus the length of A.
2384         //     b. Set the length own property of F to either 0 or L, whichever is
2385         //       larger.
2386         // 16. Else set the length own property of F to 0.
2387
2388         var boundLength = max(0, target.length - args.length);
2389
2390         // 17. Set the attributes of the length own property of F to the values
2391         //   specified in 15.3.5.1.
2392         var boundArgs = [];
2393         for (var i = 0; i < boundLength; i++) {
2394                 array_push.call(boundArgs, '$' + i);
2395         }
2396
2397         // XXX Build a dynamic function with desired amount of arguments is the only
2398         // way to set the length property of a function.
2399         // In environments where Content Security Policies enabled (Chrome extensions,
2400         // for ex.) all use of eval or Function costructor throws an exception.
2401         // However in all of these environments Function.prototype.bind exists
2402         // and so this code will never be executed.
2403         bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
2404
2405         if (target.prototype) {
2406                 Empty.prototype = target.prototype;
2407                 bound.prototype = new Empty();
2408                 // Clean up dangling references.
2409                 Empty.prototype = null;
2410         }
2411
2412         // TODO
2413         // 18. Set the [[Extensible]] internal property of F to true.
2414
2415         // TODO
2416         // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
2417         // 20. Call the [[DefineOwnProperty]] internal method of F with
2418         //   arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
2419         //   thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
2420         //   false.
2421         // 21. Call the [[DefineOwnProperty]] internal method of F with
2422         //   arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
2423         //   [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
2424         //   and false.
2425
2426         // TODO
2427         // NOTE Function objects created using Function.prototype.bind do not
2428         // have a prototype property or the [[Code]], [[FormalParameters]], and
2429         // [[Scope]] internal properties.
2430         // XXX can't delete prototype in pure-js.
2431
2432         // 22. Return F.
2433         return bound;
2434 });
2435
2436 }
2437
2438 if (!("acosh"in Math
2439 )) {
2440
2441 // Math.acosh
2442 /* global CreateMethodProperty */
2443 // 20.2.2.3. Math.acosh ( x )
2444 CreateMethodProperty(Math, 'acosh', function acosh(x) {
2445         // If x is NaN, the result is NaN.
2446         if (isNaN(x)) {
2447                 return NaN;
2448         }
2449         // If x is less than 1, the result is NaN.
2450         if (x < 1) {
2451                 return NaN;
2452         }
2453         // If x is 1, the result is +0.
2454         if (x === 1) {
2455                 return 0;
2456         }
2457         // If x is +∞, the result is +∞.
2458         if (x === Infinity) {
2459                 return Infinity;
2460         }
2461         return Math.log(x + Math.sqrt(x * x - 1));
2462 });
2463
2464 }
2465
2466 if (!("asinh"in Math
2467 )) {
2468
2469 // Math.asinh
2470 /* global CreateMethodProperty */
2471 // 20.2.2.5. Math.asinh ( x )
2472 CreateMethodProperty(Math, 'asinh', function asinh(x) {
2473         // If x is NaN, the result is NaN.
2474         if (isNaN(x)) {
2475                 return NaN;
2476         }
2477         // If x is +0, the result is +0.
2478         if (x === 0 && 1/x === Infinity) {
2479                 return 0;
2480         }
2481         // If x is -0, the result is -0.
2482         if (x === 0 && 1/x === -Infinity) {
2483                 return -0;
2484         }
2485         // If x is +∞, the result is +∞.
2486         if (x === Infinity) {
2487                 return Infinity;
2488         }
2489         // If x is -∞, the result is -∞.
2490         if (x === -Infinity) {
2491                 return -Infinity;
2492         }
2493         return Math.log(x + Math.sqrt(x * x + 1));
2494 });
2495
2496 }
2497
2498 if (!("atanh"in Math
2499 )) {
2500
2501 // Math.atanh
2502 /* global CreateMethodProperty */
2503 // 20.2.2.7. Math.atanh ( x )
2504 CreateMethodProperty(Math, 'atanh', function atanh(x) {
2505         // If x is NaN, the result is NaN.
2506         if (isNaN(x)) {
2507                 return NaN;
2508         }
2509         // If x is less than -1, the result is NaN.
2510         if (x < -1) {
2511                 return NaN;
2512         }
2513         // If x is greater than 1, the result is NaN.
2514         if (x > 1) {
2515                 return NaN;
2516         }
2517         // If x is -1, the result is -∞.
2518         if (x === -1) {
2519                 return -Infinity;
2520         }
2521         // If x is +1, the result is +∞.
2522         if (x === 1) {
2523                 return Infinity;
2524         }
2525         // If x is +0, the result is +0.
2526         if (x === 0 && 1/x === Infinity) {
2527                 return 0;
2528         }
2529         // If x is -0, the result is -0.
2530         if (x === 0 && 1/x === -Infinity) {
2531                 return -0;
2532         }
2533         return Math.log((1 + x) / (1 - x)) / 2;
2534 });
2535
2536 }
2537
2538 if (!("cbrt"in Math
2539 )) {
2540
2541 // Math.cbrt
2542 /* global CreateMethodProperty */
2543 // 20.2.2.9. Math.cbrt ( x )
2544 CreateMethodProperty(Math, 'cbrt', function cbrt(x) {
2545         // If x is NaN, the result is NaN.
2546         if (isNaN(x)) {
2547                 return NaN;
2548         }
2549         // If x is +0, the result is +0.
2550         if (x === 0 && 1/x === Infinity) {
2551                 return 0;
2552         }
2553         // If x is -0, the result is -0.
2554         if (x === 0 && 1/x === -Infinity) {
2555                 return -0;
2556         }
2557         // If x is +∞, the result is +∞.
2558         if (x === Infinity) {
2559                 return Infinity;
2560         }
2561         // If x is -∞, the result is -∞.
2562         if (x === -Infinity) {
2563                 return -Infinity;
2564         }
2565         var y = Math.pow(Math.abs(x), 1 / 3);
2566         return x < 0 ? -y : y;
2567 });
2568
2569 }
2570
2571 if (!("clz32"in Math
2572 )) {
2573
2574 // Math.clz32
2575 /* global CreateMethodProperty, ToUint32 */
2576 // 20.2.2.11. Math.clz32 ( x )
2577 CreateMethodProperty(Math, 'clz32', function clz32(x) {
2578         // 1. Let n be ToUint32(x).
2579         var n = ToUint32(x);
2580         // 2. Let p be the number of leading zero bits in the 32-bit binary representation of n.
2581         var p = n ? 32 - n.toString(2).length : 32;
2582         // 3. Return p.
2583         return p;
2584 });
2585
2586 }
2587
2588 if (!("cosh"in Math
2589 )) {
2590
2591 // Math.cosh
2592 /* global CreateMethodProperty */
2593 // 20.2.2.1. 3Math.cosh ( x )
2594 CreateMethodProperty(Math, 'cosh', function cosh(x) {
2595         // If x is NaN, the result is NaN.
2596         if (isNaN(x)) {
2597                 return NaN;
2598         }
2599         // If x is +0, the result is 1.
2600         if (x === 0 && 1/x === Infinity) {
2601                 return 1;
2602         }
2603         // If x is -0, the result is 1.
2604         if (x === 0 && 1/x === -Infinity) {
2605                 return 1;
2606         }
2607         // If x is +∞, the result is +∞.
2608         if (x === Infinity) {
2609                 return Infinity;
2610         }
2611         // If x is -∞, the result is +∞.
2612         if (x === -Infinity) {
2613                 return Infinity;
2614         }
2615         x = Math.abs(x);
2616         if (x > 709) {
2617                 var y = Math.exp(0.5 * x);
2618                 return y / 2 * y;
2619         }
2620         var y = Math.exp(x);
2621         return (y + 1 / y) / 2;
2622 });
2623
2624 }
2625
2626 if (!("expm1"in Math
2627 )) {
2628
2629 // Math.expm1
2630 /* global CreateMethodProperty */
2631 // 20.2.2.15. Math.expm1 ( x )
2632 CreateMethodProperty(Math, 'expm1', function expm1(x) {
2633         // If x is NaN, the result is NaN.
2634         if (isNaN(x)) {
2635                 return NaN;
2636         }
2637         // If x is +0, the result is +0.
2638         if (x === 0 && 1/x === Infinity) {
2639                 return 0;
2640         }
2641         // If x is -0, the result is -0.
2642         if (x === 0 && 1/x === -Infinity) {
2643                 return -0;
2644         }
2645         // If x is +∞, the result is +∞.
2646         if (x === Infinity) {
2647                 return Infinity;
2648         }
2649         // If x is -∞, the result is -1.
2650         if (x === -Infinity) {
2651                 return -1;
2652         }
2653
2654         if (x > -1e-6 && x < 1e-6) {
2655                 return x + x * x / 2;
2656         } else {
2657                 return Math.exp(x) - 1;
2658         }
2659 });
2660
2661 }
2662
2663 if (!("fround"in Math
2664 )) {
2665
2666 // Math.fround
2667 /* global Float32Array, CreateMethodProperty */
2668 // 20.2.2.17 Math.fround ( x )
2669 CreateMethodProperty(Math, 'fround', function (x) {
2670         // 1. If x is NaN, return NaN.
2671         if (isNaN(x)) {
2672                 return NaN;
2673         }
2674         // 2. If x is one of +0, -0, +∞, -∞, return x.
2675         if (1 / x === +Infinity || 1 / x === -Infinity || x === +Infinity || x === -Infinity) {
2676                 return x;
2677         }
2678         // 3. Let x32 be the result of converting x to a value in IEEE 754-2008 binary32 format using roundTiesToEven.
2679         // 4. Let x64 be the result of converting x32 to a value in IEEE 754-2008 binary64 format.
2680         // 5. Return the ECMAScript Number value corresponding to x64.
2681         return (new Float32Array([x]))[0];
2682 });
2683
2684 }
2685
2686 if (!("hypot"in Math
2687 )) {
2688
2689 // Math.hypot
2690 /* global CreateMethodProperty */
2691 // 20.2.2.18. Math.hypot ( value1, value2, ...values )
2692 CreateMethodProperty(Math, 'hypot', function hypot(value1, value2) { // eslint-disable-line no-unused-vars
2693         // If no arguments are passed, the result is +0.
2694         if (arguments.length === 0) {
2695                 return 0;
2696         }
2697         var y = 0;
2698         var max = 0;
2699         for (var i = 0; i < arguments.length; ++i) {
2700                 // If any argument is +∞, the result is +∞.
2701                 if (arguments[i] === Infinity) {
2702                         return Infinity;
2703                 }
2704
2705                 // If any argument is -∞, the result is +∞.
2706                 if (arguments[i] === -Infinity) {
2707                         return Infinity;
2708                 }
2709
2710                 // If no argument is +∞ or -∞, and any argument is NaN, the result is NaN.
2711                 // If all arguments are either +0 or -0, the result is +0.
2712                 // Polyfill.io - The two conditions above are handled in the math.
2713
2714                 var arg = Math.abs(Number(arguments[i]));
2715                 if (arg > max) {
2716                         y = y * Math.pow(max / arg, 2);
2717                         max = arg;
2718                 }
2719                 if (arg !== 0 || max !== 0) {
2720                         y = y + Math.pow(arg / max, 2);
2721                 }
2722         }
2723
2724   return max * Math.sqrt(y);
2725 });
2726
2727 }
2728
2729 if (!("imul"in Math
2730 )) {
2731
2732 // Math.imul
2733 /* global CreateMethodProperty, ToUint32 */
2734 // 20.2.2.19. Math.imul ( x, y )
2735 CreateMethodProperty(Math, 'imul', function imul(x, y) {
2736         // 1. Let a be ToUint32(x).
2737         var a = ToUint32(x);
2738         // 2. Let b be ToUint32(y).
2739         var b = ToUint32(y);
2740         var UINT16 = 0xffff;
2741         var aHigh = a >>> 16 & UINT16;
2742         var aLow = UINT16 & a;
2743         var bHigh = b >>> 16 & UINT16;
2744         var bLow = UINT16 & b;
2745         // the shift by 0 fixes the sign on the high part
2746         // the final |0 converts the unsigned value into a signed value
2747         return aLow * bLow + (aHigh * bLow + aLow * bHigh << 16 >>> 0) | 0;
2748 });
2749 }
2750
2751 if (!("log10"in Math
2752 )) {
2753
2754 // Math.log10
2755 /* global CreateMethodProperty */
2756 // 20.2.2.22. Math.log10 ( x )
2757 CreateMethodProperty(Math, 'log10', function log10(x) {
2758         return Math.log(x) / Math.LN10;
2759 });
2760
2761 }
2762
2763 if (!("log1p"in Math
2764 )) {
2765
2766 // Math.log1p
2767 /* global CreateMethodProperty */
2768 // 20.2.2.21. Math.log1p ( x )
2769 CreateMethodProperty(Math, 'log1p', function log1p(x) {
2770         x = Number(x);
2771         if (-1 < x && x < 1) {
2772                 // Polyfill.io - For numbers in the range −1 < x < 1
2773                 // Because we are using log, the precision of the result will be identical to log(1).
2774                 // To fix this we avoid using log and use the Taylor Series expansion of log.
2775                 // This series converges when |x| < 1. As we can not sum to infinity,
2776                 // we instead sum the first 300 parts of the series to give a close approximation.
2777                 // |x|<1, log(1+x) = x - x^2/2 + x^3/3 - ... + (-1)^(n-1)*x^n/n + ...
2778                 var y = x;
2779                 for (var i = 2; i <= 300; i++) {
2780                         y += Math.pow((-1), (i - 1)) * Math.pow(x, i) / i;
2781                 }
2782                 return y;
2783         }
2784
2785         return Math.log(1 + x);
2786 });
2787 }
2788
2789 if (!("log2"in Math
2790 )) {
2791
2792 // Math.log2
2793 /* global CreateMethodProperty */
2794 // 20.2.2.23. Math.log2 ( x )
2795 CreateMethodProperty(Math, 'log2', function log2(x) {
2796         return Math.log(x) / Math.LN2;
2797 });
2798
2799 }
2800
2801 if (!("sign"in Math
2802 )) {
2803
2804 // Math.sign
2805 /* global CreateMethodProperty */
2806 // 20.2.2.29. Math.sign ( x )
2807 CreateMethodProperty(Math, 'sign', function sign(x) {
2808         var x = Number(x);
2809         // If x is NaN, the result is NaN.
2810         if (isNaN(x)) {
2811                 return NaN;
2812         }
2813         // If x is -0, the result is -0.
2814         if (1 / x === -Infinity) {
2815                 return -0;
2816         }
2817         // If x is +0, the result is +0.
2818         if (1 / x === Infinity) {
2819                 return 0;
2820         }
2821         // If x is negative and not -0, the result is -1.
2822         if (x < 0) {
2823                 return -1;
2824         }
2825         // If x is positive and not +0, the result is +1.
2826         if (x > 0) {
2827                 return 1;
2828         }
2829 });
2830
2831 }
2832
2833 if (!("sinh"in Math
2834 )) {
2835
2836 // Math.sinh
2837 /* global CreateMethodProperty */
2838 // 20.2.2.31. Math.sinh ( x )
2839 CreateMethodProperty(Math, 'sinh', function sinh(x) {
2840         var s = (x < 0) ? -1 : 1;
2841         var absx = Math.abs(x);
2842         if (absx < 22) {
2843                 if (absx < Math.pow(2, -28)) {
2844                         return x;
2845                 }
2846                 var t = Math.exp(absx) - 1;
2847                 if (absx < 1) {
2848                         return (s * (2 * t - t * t / (t + 1)))/2;
2849                 }
2850                 return (s * (t + t / (t + 1)))/2;
2851         }
2852         if (absx < 709.7822265625) {
2853                 return (s * Math.exp(absx))/2;
2854         }
2855         var w = Math.exp(0.5 * absx);
2856         var t = (s * w)/2;
2857         return t * w;
2858 });
2859
2860 }
2861
2862 if (!("tanh"in Math
2863 )) {
2864
2865 // Math.tanh
2866 /* global CreateMethodProperty */
2867 // 20.2.2.34. Math.tanh ( x )
2868 CreateMethodProperty(Math, 'tanh', function tanh(x) {
2869         var y;
2870
2871         return x === Infinity ? 1 : x === -Infinity ? -1 : (y = Math.exp(2 * x), (y - 1) / (y + 1));
2872 });
2873
2874 }
2875
2876 if (!("trunc"in Math
2877 )) {
2878
2879 // Math.trunc
2880 /* global CreateMethodProperty */
2881 CreateMethodProperty(Math, 'trunc', function trunc(x) {
2882         return x < 0 ? Math.ceil(x) : Math.floor(x);
2883 });
2884
2885 }
2886
2887 if (!("isFinite"in Number
2888 )) {
2889
2890 // Number.isFinite
2891 /* global CreateMethodProperty, Type */
2892 (function () {
2893         var that = this;
2894         // 20.1.2.2. Number.isFinite ( number )
2895         CreateMethodProperty(Number, 'isFinite', function isFinite(number) {
2896                 // 1. If Type(number) is not Number, return false.
2897                 if (Type(number) !== 'number') {
2898                         return false;
2899                 }
2900                 // 2. If number is NaN, +∞, or -∞, return false.
2901                 // 3. Otherwise, return true.
2902                 // Polyfill.io - We use isFinite as it implements steps 2 and 3.
2903                 return that.isFinite(number);
2904         });
2905 }());
2906
2907 }
2908
2909 if (!("isInteger"in Number
2910 )) {
2911
2912 // Number.isInteger
2913 /* global CreateMethodProperty, ToInteger, Type */
2914 // 20.1.2.3. Number.isInteger ( number )
2915 CreateMethodProperty(Number, 'isInteger', function isInteger(number) {
2916         // 1. If Type(number) is not Number, return false.
2917         if (Type(number) !== 'number') {
2918                 return false;
2919         }
2920         // 2. If number is NaN, +∞, or -∞, return false.
2921         if (isNaN(number) || number === Infinity || number === -Infinity) {
2922                 return false;
2923         }
2924         // 3. Let integer be ToInteger(number).
2925         var integer = ToInteger(number);
2926         // 4. If integer is not equal to number, return false.
2927         if (integer !== number) {
2928                 return false;
2929         }
2930         // 5. Otherwise, return true.
2931         return true;
2932 });
2933
2934 }
2935
2936 if (!("isNaN"in Number
2937 )) {
2938
2939 // Number.isNaN
2940 /* global CreateMethodProperty, Type */
2941 (function () {
2942         var that = this;
2943         // 20.1.2.4. Number.isNaN ( number )
2944         CreateMethodProperty(Number, 'isNaN', function isNaN(number) {
2945                 // 1. If Type(number) is not Number, return false.
2946                 if (Type(number) !== 'number') {
2947                         return false;
2948                 }
2949                 // 2. If number is NaN, return true.
2950                 if (that.isNaN(number)) {
2951                         return true;
2952                 }
2953                 // 3. Otherwise, return false.
2954                 return false;
2955         });
2956 }());
2957
2958 }
2959
2960 if (!("isSafeInteger"in Number
2961 )) {
2962
2963 // Number.isSafeInteger
2964 /* global CreateMethodProperty, Type, ToInteger */
2965 // 20.1.2.5. Number.isSafeInteger ( number )
2966 CreateMethodProperty(Number, 'isSafeInteger', function isSafeInteger(number) {
2967         // 1. If Type(number) is not Number, return false.
2968         if (Type(number) !== 'number') {
2969                 return false;
2970         }
2971         // 2. If number is NaN, +∞, or -∞, return false.
2972         if (isNaN(number) || number === Infinity || number === -Infinity) {
2973                 return false;
2974         }
2975         // 3. Let integer be ToInteger(number).
2976         var integer = ToInteger(number);
2977         // 4. If integer is not equal to number, return false.
2978         if (integer !== number) {
2979                 return false;
2980         }
2981         // 5. If abs(integer) ≤ 2^53-1, return true.
2982         if (Math.abs(integer) <= (Math.pow(2, 53) - 1)) {
2983                 return true;
2984         }
2985         // 6. Otherwise, return false.
2986         return false;
2987 });
2988
2989 }
2990
2991 if (!("parseFloat"in Number
2992 )) {
2993
2994 // Number.parseFloat
2995 /* global CreateMethodProperty */
2996 // 20.1.2.12. Number.parseFloat ( string )
2997 // The value of the Number.parseFloat data property is the same built-in function object that is the value of the  parseFloat property of the global object defined in 18.2.4.
2998 CreateMethodProperty(Number, 'parseFloat', parseFloat);
2999
3000 }
3001
3002 if (!("parseInt"in Number
3003 )) {
3004
3005 // Number.parseInt
3006 /* global CreateMethodProperty */
3007 // 20.1.2.13. Number.parseInt ( string, radix )
3008 // The value of the Number.parseInt data property is the same built-in function object that is the value of the  parseInt property of the global object defined in 18.2.5.
3009 CreateMethodProperty(Number, 'parseInt', parseInt);
3010
3011 }
3012
3013 if (!("name"in Function.prototype&&"x"===function n(){}.name
3014 )) {
3015
3016 // Function.prototype.name
3017 (function () {
3018
3019         var
3020         accessorName = 'name',
3021         fnNameMatchRegex = /^\s*function\s+([^\(\s]*)\s*/,
3022         $Function = Function,
3023         FunctionName = 'Function',
3024         FunctionProto = $Function.prototype,
3025         FunctionProtoCtor = FunctionProto.constructor,
3026
3027         getFunctionName = function(fn) {
3028                 var match, name;
3029
3030                 if (fn === $Function || fn === FunctionProtoCtor) {
3031                         name = FunctionName;
3032                 }
3033                 else if (fn !== FunctionProto) {
3034                         match = ('' + fn).match(fnNameMatchRegex);
3035                         name = match && match[1];
3036                 }
3037                 return name || '';
3038         };
3039
3040
3041         Object.defineProperty(FunctionProto, accessorName, {
3042                 get: function Function$name() {
3043                         var
3044                         fn = this,
3045                         fnName = getFunctionName(fn);
3046
3047                         // Since named function definitions have immutable names, also memoize the
3048                         // output by defining the `name` property directly on this Function
3049                         // instance so the accessor function will not need to be invoked again.
3050                         if (fn !== FunctionProto) {
3051                                 Object.defineProperty(fn, accessorName, {
3052                                         value: fnName,
3053                                         configurable: true
3054                                 });
3055                         }
3056
3057                         return fnName;
3058                 },
3059                 configurable: true
3060         });
3061
3062 }());
3063
3064 }
3065
3066 if (!("EPSILON"in Number
3067 )) {
3068
3069 // Number.Epsilon
3070 // 20.1.2.1. Number.EPSILON
3071 // The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
3072 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
3073 Object.defineProperty(Number, 'EPSILON', {
3074         enumerable: false,
3075         configurable: false,
3076         writable: false,
3077         value: Math.pow(2, -52)
3078 });
3079
3080 }
3081
3082 if (!("MAX_SAFE_INTEGER"in Number
3083 )) {
3084
3085 // Number.MAX_SAFE_INTEGER
3086 // 20.1.2.6. Number.MAX_SAFE_INTEGER
3087 // The value of Number.MAX_SAFE_INTEGER is 9007199254740991 (2^53-1).
3088 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
3089 Object.defineProperty(Number, 'MAX_SAFE_INTEGER', {
3090         enumerable: false,
3091         configurable: false,
3092         writable: false,
3093         value: Math.pow(2, 53) - 1
3094 });
3095
3096 }
3097
3098 if (!("MIN_SAFE_INTEGER"in Number
3099 )) {
3100
3101 // Number.MIN_SAFE_INTEGER
3102 // 20.1.2.8. Number.MIN_SAFE_INTEGER
3103 // The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (-(253-1)).
3104 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
3105 Object.defineProperty(Number, 'MIN_SAFE_INTEGER', {
3106         enumerable: false,
3107         configurable: false,
3108         writable: false,
3109         value: -(Math.pow(2, 53) - 1)
3110 });
3111
3112 }
3113
3114 if (!("freeze"in Object
3115 )) {
3116
3117 // Object.freeze
3118 /* global CreateMethodProperty */
3119 // 19.1.2.6. Object.freeze ( O )
3120 CreateMethodProperty(Object, 'freeze', function freeze(O) {
3121         // This feature cannot be implemented fully as a polyfill.
3122         // We choose to silently fail which allows "securable" code
3123         // to "gracefully" degrade to working but insecure code.
3124         return O;
3125 });
3126
3127 }
3128
3129 if (!("getOwnPropertyDescriptor"in Object&&"function"==typeof Object.getOwnPropertyDescriptor&&function(){try{var t={}
3130 return t.test=0,0===Object.getOwnPropertyDescriptor(t,"test").value}catch(e){return!1}}()
3131 )) {
3132
3133 // Object.getOwnPropertyDescriptor
3134 /* global CreateMethodProperty */
3135 (function () {
3136         var call = Function.prototype.call;
3137         var prototypeOfObject = Object.prototype;
3138         var owns = call.bind(prototypeOfObject.hasOwnProperty);
3139
3140         var lookupGetter;
3141         var lookupSetter;
3142         var supportsAccessors;
3143         if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
3144             lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
3145             lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
3146         }
3147         function doesGetOwnPropertyDescriptorWork(object) {
3148             try {
3149                 object.sentinel = 0;
3150                 return Object.getOwnPropertyDescriptor(
3151                     object,
3152                     "sentinel"
3153                 ).value === 0;
3154             } catch (exception) {
3155                 // returns falsy
3156             }
3157         }
3158         // check whether getOwnPropertyDescriptor works if it's given. Otherwise,
3159         // shim partially.
3160         if (Object.defineProperty) {
3161             var getOwnPropertyDescriptorWorksOnObject =
3162                 doesGetOwnPropertyDescriptorWork({});
3163             var getOwnPropertyDescriptorWorksOnDom = typeof document == "undefined" ||
3164                 doesGetOwnPropertyDescriptorWork(document.createElement("div"));
3165             if (!getOwnPropertyDescriptorWorksOnDom ||
3166                 !getOwnPropertyDescriptorWorksOnObject
3167             ) {
3168                 var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
3169             }
3170         }
3171
3172         if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
3173             var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a non-object: ";
3174
3175             CreateMethodProperty(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(object, property) {
3176                 if ((typeof object != "object" && typeof object != "function") || object === null) {
3177                     throw new TypeError(ERR_NON_OBJECT + object);
3178                 }
3179
3180                 // make a valiant attempt to use the real getOwnPropertyDescriptor
3181                 // for I8's DOM elements.
3182                 if (getOwnPropertyDescriptorFallback) {
3183                     try {
3184                         return getOwnPropertyDescriptorFallback.call(Object, object, property);
3185                     } catch (exception) {
3186                         // try the shim if the real one doesn't work
3187                     }
3188                 }
3189
3190                 // If object does not owns property return undefined immediately.
3191                 if (!owns(object, property)) {
3192                     return;
3193                 }
3194
3195                 // If object has a property then it's for sure both `enumerable` and
3196                 // `configurable`.
3197                 var descriptor = { enumerable: true, configurable: true };
3198
3199                 // If JS engine supports accessor properties then property may be a
3200                 // getter or setter.
3201                 if (supportsAccessors) {
3202                     // Unfortunately `__lookupGetter__` will return a getter even
3203                     // if object has own non getter property along with a same named
3204                     // inherited getter. To avoid misbehavior we temporary remove
3205                     // `__proto__` so that `__lookupGetter__` will return getter only
3206                     // if it's owned by an object.
3207                     var prototype = object.__proto__;
3208                     object.__proto__ = prototypeOfObject;
3209
3210                     var getter = lookupGetter(object, property);
3211                     var setter = lookupSetter(object, property);
3212
3213                     // Once we have getter and setter we can put values back.
3214                     object.__proto__ = prototype;
3215
3216                     if (getter || setter) {
3217                         if (getter) {
3218                             descriptor.get = getter;
3219                         }
3220                         if (setter) {
3221                             descriptor.set = setter;
3222                         }
3223                         // If it was accessor property we're done and return here
3224                         // in order to avoid adding `value` to the descriptor.
3225                         return descriptor;
3226                     }
3227                 }
3228
3229                 // If we got this far we know that object has an own property that is
3230                 // not an accessor so we set it as a value and return descriptor.
3231                 descriptor.value = object[property];
3232                         descriptor.writable = true;
3233                 return descriptor;
3234             });
3235         }
3236 }());
3237
3238 }
3239
3240 if (!("getOwnPropertyNames"in Object
3241 )) {
3242
3243 // Object.getOwnPropertyNames
3244 /* global CreateMethodProperty */
3245
3246 var toString = ({}).toString;
3247 var split = ''.split;
3248
3249 CreateMethodProperty(Object, 'getOwnPropertyNames', function getOwnPropertyNames(object) {
3250         var buffer = [];
3251         var key;
3252
3253         // Non-enumerable properties cannot be discovered but can be checked for by name.
3254         // Define those used internally by JS to allow an incomplete solution
3255         var commonProps = ['length', "name", "arguments", "caller", "prototype", "observe", "unobserve"];
3256
3257         if (typeof object === 'undefined' || object === null) {
3258                 throw new TypeError('Cannot convert undefined or null to object');
3259         }
3260
3261         // Polyfill.io fallback for non-array-like strings which exist in some ES3 user-agents (IE 8)
3262         object = toString.call(object) == '[object String]' ? split.call(object, '') : Object(object);
3263
3264         // Enumerable properties only
3265         for (key in object) {
3266                 if (Object.prototype.hasOwnProperty.call(object, key)) {
3267                         buffer.push(key);
3268                 }
3269         }
3270
3271         // Check for and add the common non-enumerable properties
3272         for (var i=0, s=commonProps.length; i<s; i++) {
3273                 if (commonProps[i] in object) buffer.push(commonProps[i]);
3274         }
3275
3276         return buffer;
3277 });
3278
3279 }
3280
3281 if (!("getPrototypeOf"in Object
3282 )) {
3283
3284 // Object.getPrototypeOf
3285 /* global CreateMethodProperty */
3286 // Based on: https://github.com/es-shims/es5-shim/blob/master/es5-sham.js
3287
3288 // https://github.com/es-shims/es5-shim/issues#issue/2
3289 // http://ejohn.org/blog/objectgetprototypeof/
3290 // recommended by fschaefer on github
3291 //
3292 // sure, and webreflection says ^_^
3293 // ... this will nerever possibly return null
3294 // ... Opera Mini breaks here with infinite loops
3295 CreateMethodProperty(Object, 'getPrototypeOf', function getPrototypeOf(object) {
3296         if (object !== Object(object)) {
3297                 throw new TypeError('Object.getPrototypeOf called on non-object');
3298         }
3299         var proto = object.__proto__;
3300         if (proto || proto === null) {
3301                 return proto;
3302         } else if (typeof object.constructor == 'function' && object instanceof object.constructor) {
3303     return object.constructor.prototype;
3304   } else if (object instanceof Object) {
3305                 return Object.prototype;
3306         } else {
3307                 // Correctly return null for Objects created with `Object.create(null)`
3308                 // (shammed or native) or `{ __proto__: null}`.  Also returns null for
3309                 // cross-realm objects on browsers that lack `__proto__` support (like
3310                 // IE <11), but that's the best we can do.
3311                 return null;
3312         }
3313 });
3314
3315 }
3316
3317 if (!("is"in Object
3318 )) {
3319
3320 // Object.is
3321 /* global CreateMethodProperty, SameValue */
3322 // 19.1.2.12. Object.is ( value1, value2 )
3323 CreateMethodProperty(Object, 'is', function is(value1, value2) {
3324         // 1. Return SameValue(value1, value2).
3325         return SameValue(value1, value2);
3326 });
3327
3328 }
3329
3330 if (!("keys"in Object&&function(){return 2===Object.keys(arguments).length}(1,2)&&function(){try{return Object.keys(""),!0}catch(t){return!1}}()
3331 )) {
3332
3333 // Object.keys
3334 /* global CreateMethodProperty */
3335 CreateMethodProperty(Object, "keys", (function() {
3336         'use strict';
3337
3338         // modified from https://github.com/es-shims/object-keys
3339
3340         var has = Object.prototype.hasOwnProperty;
3341         var toStr = Object.prototype.toString;
3342         var isEnumerable = Object.prototype.propertyIsEnumerable;
3343         var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
3344         var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
3345         var dontEnums = [
3346                 'toString',
3347                 'toLocaleString',
3348                 'valueOf',
3349                 'hasOwnProperty',
3350                 'isPrototypeOf',
3351                 'propertyIsEnumerable',
3352                 'constructor'
3353         ];
3354         var equalsConstructorPrototype = function (o) {
3355                 var ctor = o.constructor;
3356                 return ctor && ctor.prototype === o;
3357         };
3358         var excludedKeys = {
3359                 $console: true,
3360                 $external: true,
3361                 $frame: true,
3362                 $frameElement: true,
3363                 $frames: true,
3364                 $innerHeight: true,
3365                 $innerWidth: true,
3366                 $outerHeight: true,
3367                 $outerWidth: true,
3368                 $pageXOffset: true,
3369                 $pageYOffset: true,
3370                 $parent: true,
3371                 $scrollLeft: true,
3372                 $scrollTop: true,
3373                 $scrollX: true,
3374                 $scrollY: true,
3375                 $self: true,
3376                 $webkitIndexedDB: true,
3377                 $webkitStorageInfo: true,
3378                 $window: true
3379         };
3380         var hasAutomationEqualityBug = (function () {
3381                 /* global window */
3382                 if (typeof window === 'undefined') { return false; }
3383                 for (var k in window) {
3384                         try {
3385                                 if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
3386                                         try {
3387                                                 equalsConstructorPrototype(window[k]);
3388                                         } catch (e) {
3389                                                 return true;
3390                                         }
3391                                 }
3392                         } catch (e) {
3393                                 return true;
3394                         }
3395                 }
3396                 return false;
3397         }());
3398         var equalsConstructorPrototypeIfNotBuggy = function (o) {
3399                 /* global window */
3400                 if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
3401                         return equalsConstructorPrototype(o);
3402                 }
3403                 try {
3404                         return equalsConstructorPrototype(o);
3405                 } catch (e) {
3406                         return false;
3407                 }
3408         };
3409
3410         function isArgumentsObject(value) {
3411                 var str = toStr.call(value);
3412                 var isArgs = str === '[object Arguments]';
3413                 if (!isArgs) {
3414                         isArgs = str !== '[object Array]' &&
3415                                 value !== null &&
3416                                 typeof value === 'object' &&
3417                                 typeof value.length === 'number' &&
3418                                 value.length >= 0 &&
3419                                 toStr.call(value.callee) === '[object Function]';
3420                 }
3421                 return isArgs;
3422         }
3423
3424         return function keys(object) {
3425                 var isFunction = toStr.call(object) === '[object Function]';
3426                 var isArguments = isArgumentsObject(object);
3427                 var isString = toStr.call(object) === '[object String]';
3428                 var theKeys = [];
3429
3430                 if (object === undefined || object === null) {
3431                         throw new TypeError('Cannot convert undefined or null to object');
3432                 }
3433
3434                 var skipProto = hasProtoEnumBug && isFunction;
3435                 if (isString && object.length > 0 && !has.call(object, 0)) {
3436                         for (var i = 0; i < object.length; ++i) {
3437                                 theKeys.push(String(i));
3438                         }
3439                 }
3440
3441                 if (isArguments && object.length > 0) {
3442                         for (var j = 0; j < object.length; ++j) {
3443                                 theKeys.push(String(j));
3444                         }
3445                 } else {
3446                         for (var name in object) {
3447                                 if (!(skipProto && name === 'prototype') && has.call(object, name)) {
3448                                         theKeys.push(String(name));
3449                                 }
3450                         }
3451                 }
3452
3453                 if (hasDontEnumBug) {
3454                         var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
3455
3456                         for (var k = 0; k < dontEnums.length; ++k) {
3457                                 if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
3458                                         theKeys.push(dontEnums[k]);
3459                                 }
3460                         }
3461                 }
3462                 return theKeys;
3463         };
3464 }()));
3465
3466 }
3467
3468 if (!("assign"in Object
3469 )) {
3470
3471 // Object.assign
3472 /* global CreateMethodProperty, Get, ToObject */
3473 // 19.1.2.1 Object.assign ( target, ...sources )
3474 CreateMethodProperty(Object, 'assign', function assign(target, source) { // eslint-disable-line no-unused-vars
3475         // 1. Let to be ? ToObject(target).
3476         var to = ToObject(target);
3477
3478         // 2. If only one argument was passed, return to.
3479         if (arguments.length === 1) {
3480                 return to;
3481         }
3482
3483         // 3. Let sources be the List of argument values starting with the second argument
3484         var sources = Array.prototype.slice.call(arguments, 1);
3485
3486         // 4. For each element nextSource of sources, in ascending index order, do
3487         var index1;
3488         var index2;
3489         var keys;
3490         var from;
3491         for (index1 = 0; index1 < sources.length; index1++) {
3492                 var nextSource = sources[index1];
3493                 // a. If nextSource is undefined or null, let keys be a new empty List.
3494                 if (nextSource === undefined || nextSource === null) {
3495                         keys = [];
3496                         // b. Else,
3497                 } else {
3498                         // i. Let from be ! ToObject(nextSource).
3499                         from = ToObject(nextSource);
3500                         // ii. Let keys be ? from.[[OwnPropertyKeys]]().
3501                         /*
3502                                 This step in our polyfill is not complying with the specification.
3503                                 [[OwnPropertyKeys]] is meant to return ALL keys, including non-enumerable and symbols.
3504                                 TODO: When we have Reflect.ownKeys, use that instead as it is the userland equivalent of [[OwnPropertyKeys]].
3505                         */
3506                         keys = Object.keys(from);
3507                 }
3508
3509                 // c. For each element nextKey of keys in List order, do
3510                 for (index2 = 0; index2 < keys.length; index2++) {
3511                         var nextKey = keys[index2];
3512                         var enumerable;
3513                         try {
3514                                 // i. Let desc be ? from.[[GetOwnProperty]](nextKey).
3515                                 var desc = Object.getOwnPropertyDescriptor(from, nextKey);
3516                                 // ii. If desc is not undefined and desc.[[Enumerable]] is true, then
3517                                 enumerable = desc !== undefined && desc.enumerable === true;
3518                         } catch (e) {
3519                                 // Polyfill.io - We use Object.prototype.propertyIsEnumerable as a fallback
3520                                 // because `Object.getOwnPropertyDescriptor(window.location, 'hash')` causes Internet Explorer 11 to crash.
3521                                 enumerable = Object.prototype.propertyIsEnumerable.call(from, nextKey);
3522                         }
3523                         if (enumerable) {
3524                                 // 1. Let propValue be ? Get(from, nextKey).
3525                                 var propValue = Get(from, nextKey);
3526                                 // 2. Perform ? Set(to, nextKey, propValue, true).
3527                                 to[nextKey] = propValue;
3528                         }
3529                 }
3530         }
3531         // 5. Return to.
3532         return to;
3533 });
3534
3535 }
3536
3537 if (!("defineProperties"in Object
3538 )) {
3539
3540 // Object.defineProperties
3541 /* global CreateMethodProperty, Get, ToObject, Type */
3542 // 19.1.2.3. Object.defineProperties ( O, Properties )
3543 CreateMethodProperty(Object, 'defineProperties', function defineProperties(O, Properties) {
3544         // 1. If Type(O) is not Object, throw a TypeError exception.
3545         if (Type(O) !== 'object') {
3546                 throw new TypeError('Object.defineProperties called on non-object');
3547         }
3548         // 2. Let props be ? ToObject(Properties).
3549         var props = ToObject(Properties);
3550         // 3. Let keys be ? props.[[OwnPropertyKeys]]().
3551         /*
3552                 Polyfill.io - This step in our polyfill is not complying with the specification.
3553                 [[OwnPropertyKeys]] is meant to return ALL keys, including non-enumerable and symbols.
3554                 TODO: When we have Reflect.ownKeys, use that instead as it is the userland equivalent of [[OwnPropertyKeys]].
3555         */
3556         var keys = Object.keys(props);
3557         // 4. Let descriptors be a new empty List.
3558         var descriptors = [];
3559         // 5. For each element nextKey of keys in List order, do
3560         for (var i = 0; i < keys.length; i++) {
3561                 var nextKey = keys[i];
3562                 // a. Let propDesc be ? props.[[GetOwnProperty]](nextKey).
3563                 var propDesc = Object.getOwnPropertyDescriptor(props, nextKey);
3564                 // b. If propDesc is not undefined and propDesc.[[Enumerable]] is true, then
3565                 if (propDesc !== undefined && propDesc.enumerable) {
3566                         // i. Let descObj be ? Get(props, nextKey).
3567                         var descObj = Get(props, nextKey);
3568                         // ii. Let desc be ? ToPropertyDescriptor(descObj).
3569                         // Polyfill.io - We skip this step because Object.defineProperty deals with it.
3570                         // TODO: Implement this step?
3571                         var desc = descObj;
3572                         // iii. Append the pair (a two element List) consisting of nextKey and desc to the end of descriptors.
3573                         descriptors.push([nextKey, desc]);
3574                 }
3575         }
3576         // 6. For each pair from descriptors in list order, do
3577         for (var i = 0; i < descriptors.length; i++){
3578                 // a. Let P be the first element of pair.
3579                 var P = descriptors[i][0];
3580                 // b. Let desc be the second element of pair.
3581                 var desc = descriptors[i][1];
3582                 // c. Perform ? DefinePropertyOrThrow(O, P, desc).
3583                 Object.defineProperty(O, P, desc);
3584         }
3585         // 7. Return O.
3586         return O;
3587 });
3588
3589 }
3590
3591 if (!("create"in Object
3592 )) {
3593
3594 // Object.create
3595 /* global CreateMethodProperty, Type */
3596 CreateMethodProperty(Object, 'create', function create(O, properties) {
3597         // 1. If Type(O) is neither Object nor Null, throw a TypeError exception.
3598         if (Type(O) !== 'object' && Type(O) !== 'null') {
3599                 throw new TypeError('Object prototype may only be an Object or null');
3600         }
3601         // 2. Let obj be ObjectCreate(O).
3602         var obj = new Function('e', 'function Object() {}Object.prototype=e;return new Object')(O);
3603
3604         obj.constructor.prototype = O;
3605
3606         // 3. If Properties is not undefined, then
3607         if (1 in arguments) {
3608                 // a. Return ? ObjectDefineProperties(obj, Properties).
3609                 return Object.defineProperties(obj, properties);
3610         }
3611
3612         return obj;
3613 });
3614
3615 }
3616
3617
3618 // _ESAbstract.GetIterator
3619 /* global GetMethod, Symbol, Call, Type, GetV */
3620 // 7.4.1. GetIterator ( obj [ , method ] )
3621 // The abstract operation GetIterator with argument obj and optional argument method performs the following steps:
3622 function GetIterator(obj /*, method */) { // eslint-disable-line no-unused-vars
3623         // 1. If method is not present, then
3624                 // a. Set method to ? GetMethod(obj, @@iterator).
3625         var method = arguments.length > 1 ? arguments[1] : GetMethod(obj, Symbol.iterator);
3626         // 2. Let iterator be ? Call(method, obj).
3627         var iterator = Call(method, obj);
3628         // 3. If Type(iterator) is not Object, throw a TypeError exception.
3629         if (Type(iterator) !== 'object') {
3630                 throw new TypeError('bad iterator');
3631         }
3632         // 4. Let nextMethod be ? GetV(iterator, "next").
3633         var nextMethod = GetV(iterator, "next");
3634         // 5. Let iteratorRecord be Record {[[Iterator]]: iterator, [[NextMethod]]: nextMethod, [[Done]]: false}.
3635         var iteratorRecord = Object.create(null);
3636         iteratorRecord['[[Iterator]]'] = iterator;
3637         iteratorRecord['[[NextMethod]]'] = nextMethod;
3638         iteratorRecord['[[Done]]'] = false;
3639         // 6. Return iteratorRecord.
3640         return iteratorRecord;
3641 }
3642
3643 // _ESAbstract.OrdinaryCreateFromConstructor
3644 /* global GetPrototypeFromConstructor */
3645 // 9.1.13. OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
3646 function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars
3647         var internalSlotsList = arguments[2] || {};
3648         // 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object.
3649         // The corresponding object must be an intrinsic that is intended to be used as the[[Prototype]] value of an object.
3650
3651         // 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).
3652         var proto = GetPrototypeFromConstructor(constructor, intrinsicDefaultProto);
3653
3654         // 3. Return ObjectCreate(proto, internalSlotsList).
3655         // Polyfill.io - We do not pass internalSlotsList to Object.create because Object.create does not use the default ordinary object definitions specified in 9.1.
3656         var obj = Object.create(proto);
3657         for (var name in internalSlotsList) {
3658                 if (Object.prototype.hasOwnProperty.call(internalSlotsList, name)) {
3659                         Object.defineProperty(obj, name, {
3660                                 configurable: true,
3661                                 enumerable: false,
3662                                 writable: true,
3663                                 value: internalSlotsList[name]
3664                         });
3665                 }
3666         }
3667         return obj;
3668 }
3669
3670 // _ESAbstract.Construct
3671 /* global IsConstructor, OrdinaryCreateFromConstructor, Call */
3672 // 7.3.13. Construct ( F [ , argumentsList [ , newTarget ]] )
3673 function Construct(F /* [ , argumentsList [ , newTarget ]] */) { // eslint-disable-line no-unused-vars
3674         // 1. If newTarget is not present, set newTarget to F.
3675         var newTarget = arguments.length > 2 ? arguments[2] : F;
3676
3677         // 2. If argumentsList is not present, set argumentsList to a new empty List.
3678         var argumentsList = arguments.length > 1 ? arguments[1] : [];
3679
3680         // 3. Assert: IsConstructor(F) is true.
3681         if (!IsConstructor(F)) {
3682                 throw new TypeError('F must be a constructor.');
3683         }
3684
3685         // 4. Assert: IsConstructor(newTarget) is true.
3686         if (!IsConstructor(newTarget)) {
3687                 throw new TypeError('newTarget must be a constructor.');
3688         }
3689
3690         // 5. Return ? F.[[Construct]](argumentsList, newTarget).
3691         // Polyfill.io - If newTarget is the same as F, it is equivalent to new F(...argumentsList).
3692         if (newTarget === F) {
3693                 return new (Function.prototype.bind.apply(F, [null].concat(argumentsList)))();
3694         } else {
3695                 // Polyfill.io - This is mimicking section 9.2.2 step 5.a.
3696                 var obj = OrdinaryCreateFromConstructor(newTarget, Object.prototype);
3697                 return Call(F, obj, argumentsList);
3698         }
3699 }
3700
3701 // _ESAbstract.ArraySpeciesCreate
3702 /* global IsArray, ArrayCreate, Get, Type, IsConstructor, Construct */
3703 // 9.4.2.3. ArraySpeciesCreate ( originalArray, length )
3704 function ArraySpeciesCreate(originalArray, length) { // eslint-disable-line no-unused-vars
3705         // 1. Assert: length is an integer Number ≥ 0.
3706         // 2. If length is -0, set length to +0.
3707         if (1/length === -Infinity) {
3708                 length = 0;
3709         }
3710
3711         // 3. Let isArray be ? IsArray(originalArray).
3712         var isArray = IsArray(originalArray);
3713
3714         // 4. If isArray is false, return ? ArrayCreate(length).
3715         if (isArray === false) {
3716                 return ArrayCreate(length);
3717         }
3718
3719         // 5. Let C be ? Get(originalArray, "constructor").
3720         var C = Get(originalArray, 'constructor');
3721
3722         // Polyfill.io - We skip this section as not sure how to make a cross-realm normal Array, a same-realm Array.
3723         // 6. If IsConstructor(C) is true, then
3724         // if (IsConstructor(C)) {
3725                 // a. Let thisRealm be the current Realm Record.
3726                 // b. Let realmC be ? GetFunctionRealm(C).
3727                 // c. If thisRealm and realmC are not the same Realm Record, then
3728                         // i. If SameValue(C, realmC.[[Intrinsics]].[[%Array%]]) is true, set C to undefined.
3729         // }
3730         // 7. If Type(C) is Object, then
3731         if (Type(C) === 'object') {
3732                 // a. Set C to ? Get(C, @@species).
3733                 C = 'Symbol' in this && 'species' in this.Symbol ? Get(C, this.Symbol.species) : undefined;
3734                 // b. If C is null, set C to undefined.
3735                 if (C === null) {
3736                         C = undefined;
3737                 }
3738         }
3739         // 8. If C is undefined, return ? ArrayCreate(length).
3740         if (C === undefined) {
3741                 return ArrayCreate(length);
3742         }
3743         // 9. If IsConstructor(C) is false, throw a TypeError exception.
3744         if (!IsConstructor(C)) {
3745                 throw new TypeError('C must be a constructor');
3746         }
3747         // 10. Return ? Construct(C, « length »).
3748         return Construct(C, [length]);
3749 }
3750 if (!("filter"in Array.prototype
3751 )) {
3752
3753 // Array.prototype.filter
3754 /* global CreateMethodProperty, ToObject, ToLength, Get, IsCallable, ArraySpeciesCreate, ToString, HasProperty, ToBoolean, Call, CreateDataPropertyOrThrow */
3755 // 22.1.3.7. Array.prototype.filter ( callbackfn [ , thisArg ] )
3756 CreateMethodProperty(Array.prototype, 'filter', function filter(callbackfn /* [ , thisArg ] */) {
3757         // 1. Let O be ? ToObject(this value).
3758         var O = ToObject(this);
3759         // 2. Let len be ? ToLength(? Get(O, "length")).
3760         var len = ToLength(Get(O, "length"));
3761         // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
3762         if (IsCallable(callbackfn) === false) {
3763                 throw new TypeError(callbackfn + ' is not a function');
3764         }
3765         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
3766         var T = arguments.length > 1 ? arguments[1] : undefined;
3767         // 5. Let A be ? ArraySpeciesCreate(O, 0).
3768         var A = ArraySpeciesCreate(O, 0);
3769         // 6. Let k be 0.
3770         var k = 0;
3771         // 7. Let to be 0.
3772         var to = 0;
3773         // 8. Repeat, while k < len
3774         while (k < len) {
3775                 // a. Let Pk be ! ToString(k).
3776                 var Pk = ToString(k);
3777                 // b. Let kPresent be ? HasProperty(O, Pk).
3778                 var kPresent = HasProperty(O, Pk);
3779                 // c. If kPresent is true, then
3780                 if (kPresent) {
3781                         // i. Let kValue be ? Get(O, Pk).
3782                         var kValue = Get(O, Pk);
3783                         // ii. Let selected be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).
3784                         var selected = ToBoolean(Call(callbackfn, T, [kValue, k, O]));
3785                         // iii. If selected is true, then
3786                         if (selected) {
3787                                 // 1. Perform ? CreateDataPropertyOrThrow(A, ! ToString(to), kValue)
3788                                 CreateDataPropertyOrThrow(A, ToString(to), kValue);
3789                                 // 2. Increase to by 1.
3790                                 to = to + 1;
3791                         }
3792
3793                 }
3794                 // d. Increase k by 1.
3795                 k = k + 1;
3796         }
3797         // 9. Return A.
3798         return A;
3799 });
3800
3801 }
3802
3803 if (!("map"in Array.prototype
3804 )) {
3805
3806 // Array.prototype.map
3807 /* global ArraySpeciesCreate, Call, CreateDataPropertyOrThrow, CreateMethodProperty, Get, HasProperty, IsCallable, ToLength, ToObject, ToString */
3808 /* global CreateMethodProperty, ToObject, ToLength, Get, ArraySpeciesCreate, ToString, HasProperty, Call, CreateDataPropertyOrThrow */
3809 // 22.1.3.16. Array.prototype.map ( callbackfn [ , thisArg ] )
3810 CreateMethodProperty(Array.prototype, 'map', function map(callbackfn /* [ , thisArg ] */) {
3811         // 1. Let O be ? ToObject(this value).
3812         var O = ToObject(this);
3813         // 2. Let len be ? ToLength(? Get(O, "length")).
3814         var len = ToLength(Get(O, "length"));
3815         // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
3816         if (IsCallable(callbackfn) === false) {
3817                 throw new TypeError(callbackfn + ' is not a function');
3818         }
3819         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
3820         var T = arguments.length > 1 ? arguments[1] : undefined;
3821         // 5. Let A be ? ArraySpeciesCreate(O, len).
3822         var A = ArraySpeciesCreate(O, len);
3823         // 6. Let k be 0.
3824         var k = 0;
3825         // 7. Repeat, while k < len
3826         while (k < len) {
3827                 // a. Let Pk be ! ToString(k).
3828                 var Pk = ToString(k);
3829                 // b. Let kPresent be ? HasProperty(O, Pk).
3830                 var kPresent = HasProperty(O, Pk);
3831                 // c. If kPresent is true, then
3832                 if (kPresent) {
3833                         // i. Let kValue be ? Get(O, Pk).
3834                         var kValue = Get(O, Pk);
3835                         // ii. Let mappedValue be ? Call(callbackfn, T, « kValue, k, O »).
3836                         var mappedValue = Call(callbackfn, T, [kValue, k, O]);
3837                         // iii. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
3838                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
3839                 }
3840                 // d. Increase k by 1.
3841                 k = k + 1;
3842         }
3843         // 8. Return A.
3844         return A;
3845 });
3846
3847 }
3848
3849 if (!("of"in Array
3850 )) {
3851
3852 // Array.of
3853 /* global ArrayCreate, Construct, CreateDataPropertyOrThrow, CreateMethodProperty, IsConstructor, ToString */
3854 // 22.1.2.3. Array.of ( ...items )
3855 CreateMethodProperty(Array, 'of', function of() {
3856         // 1. Let len be the actual number of arguments passed to this function.
3857         var len = arguments.length;
3858         // 2. Let items be the List of arguments passed to this function.
3859         var items = arguments;
3860         // 3. Let C be the this value.
3861         var C = this;
3862         // 4. If IsConstructor(C) is true, then
3863         if (IsConstructor(C)) {
3864                 // a. Let A be ? Construct(C, « len »).
3865                 var A = Construct(C, [len]);
3866                 // 5. Else,
3867         } else {
3868                 // a. Let A be ? ArrayCreate(len).
3869                 var A = ArrayCreate(len);
3870         }
3871         // 6. Let k be 0.
3872         var k = 0;
3873         // 7. Repeat, while k < len
3874         while (k < len) {
3875                 // a. Let kValue be items[k].
3876                 var kValue = items[k];
3877                 // b. Let Pk be ! ToString(k).
3878                 var Pk = ToString(k);
3879                 // c. Perform ? CreateDataPropertyOrThrow(A, Pk, kValue).
3880                 CreateDataPropertyOrThrow(A, Pk, kValue);
3881                 // d. Increase k by 1.
3882                 var k = k + 1;
3883
3884         }
3885         // 8. Perform ? Set(A, "length", len, true)
3886         A["length"] = len;
3887         // 9. Return A.
3888         return A;
3889 });
3890
3891 }
3892
3893 if (!("seal"in Object&&function(){try{return Object.seal("1"),!0}catch(t){return!1}}
3894 )) {
3895
3896 // Object.seal
3897 /* global CreateMethodProperty, Type */
3898 // 19.1.2.19 Object.seal ( O )
3899 (function(originalObjectSeal) {
3900     CreateMethodProperty(Object, 'seal', function seal(O) {
3901         // 1. If Type(O) is not Object, return O.
3902         if (Type(O) === 'object') {
3903             return O;
3904         }
3905         // 2. Let status be ? SetIntegrityLevel(O, "sealed").
3906         // 3. If status is false, throw a TypeError exception.
3907         // 4. Return O.
3908         return originalObjectSeal ? originalObjectSeal(O) : O;
3909     });
3910 }(Object.seal));
3911
3912
3913 }
3914
3915
3916 // Object.setPrototypeOf
3917 /* global CreateMethodProperty */
3918 // ES6-shim 0.16.0 (c) 2013-2014 Paul Miller (http://paulmillr.com)
3919 // ES6-shim may be freely distributed under the MIT license.
3920 // For more details and documentation:
3921 // https://github.com/paulmillr/es6-shim/
3922
3923  // NOTE:  This versions needs object ownership
3924   //        because every promoted object needs to be reassigned
3925   //        otherwise uncompatible browsers cannot work as expected
3926   //
3927   // NOTE:  This might need es5-shim or polyfills upfront
3928   //        because it's based on ES5 API.
3929   //        (probably just an IE <= 8 problem)
3930   //
3931   // NOTE:  nodejs is fine in version 0.8, 0.10, and future versions.
3932 (function () {
3933         if (Object.setPrototypeOf) { return; }
3934
3935         /*jshint proto: true */
3936         // @author    Andrea Giammarchi - @WebReflection
3937
3938         var getOwnPropertyNames = Object.getOwnPropertyNames;
3939         var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3940         var create = Object.create;
3941         var defineProperty = Object.defineProperty;
3942         var getPrototypeOf = Object.getPrototypeOf;
3943         var objProto = Object.prototype;
3944
3945         var copyDescriptors = function (target, source) {
3946                 // define into target descriptors from source
3947                 getOwnPropertyNames(source).forEach(function (key) {
3948                         defineProperty(
3949                                 target,
3950                                 key,
3951                                 getOwnPropertyDescriptor(source, key)
3952                         );
3953                 });
3954                 return target;
3955         };
3956         // used as fallback when no promotion is possible
3957         var createAndCopy = function setPrototypeOf(origin, proto) {
3958                 return copyDescriptors(create(proto), origin);
3959         };
3960         var set, sPOf;
3961         try {
3962                 // this might fail for various reasons
3963                 // ignore if Chrome cought it at runtime
3964                 set = getOwnPropertyDescriptor(objProto, '__proto__').set;
3965                 set.call({}, null);
3966                 // setter not poisoned, it can promote
3967                 // Firefox, Chrome
3968                 sPOf = function setPrototypeOf(origin, proto) {
3969                         set.call(origin, proto);
3970                         return origin;
3971                 };
3972         } catch (e) {
3973                 // do one or more feature detections
3974                 set = { __proto__: null };
3975                 // if proto does not work, needs to fallback
3976                 // some Opera, Rhino, ducktape
3977                 if (set instanceof Object) {
3978                         sPOf = createAndCopy;
3979                 } else {
3980                         // verify if null objects are buggy
3981                         /* eslint-disable no-proto */
3982                         set.__proto__ = objProto;
3983                         /* eslint-enable no-proto */
3984                         // if null objects are buggy
3985                         // nodejs 0.8 to 0.10
3986                         if (set instanceof Object) {
3987                                 sPOf = function setPrototypeOf(origin, proto) {
3988                                         // use such bug to promote
3989                                         /* eslint-disable no-proto */
3990                                         origin.__proto__ = proto;
3991                                         /* eslint-enable no-proto */
3992                                         return origin;
3993                                 };
3994                         } else {
3995                                 // try to use proto or fallback
3996                                 // Safari, old Firefox, many others
3997                                 sPOf = function setPrototypeOf(origin, proto) {
3998                                         // if proto is not null
3999                                         if (getPrototypeOf(origin)) {
4000                                                 // use __proto__ to promote
4001                                                 /* eslint-disable no-proto */
4002                                                 origin.__proto__ = proto;
4003                                                 /* eslint-enable no-proto */
4004                                                 return origin;
4005                                         } else {
4006                                                 // otherwise unable to promote: fallback
4007                                                 return createAndCopy(origin, proto);
4008                                         }
4009                                 };
4010                         }
4011                 }
4012         }
4013         CreateMethodProperty(Object, 'setPrototypeOf', sPOf);
4014 }());
4015 if (!("Promise"in this
4016 )) {
4017
4018 // Promise
4019 !function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};t.m=n,t.c=e,t.i=function(n){return n},t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=100)}({100:/*!***********************!*\
4020   !*** ./src/global.js ***!
4021   \***********************/
4022 function(n,t,e){(function(n){var t=e(/*! ./yaku */5);try{n.Promise=t,window.Promise=t}catch(r){}}).call(t,e(/*! ./../~/webpack/buildin/global.js */2))},2:/*!***********************************!*\
4023   !*** (webpack)/buildin/global.js ***!
4024   \***********************************/
4025 function(n,t){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(r){"object"==typeof window&&(e=window)}n.exports=e},5:/*!*********************!*\
4026   !*** ./src/yaku.js ***!
4027   \*********************/
4028 function(n,t,e){(function(t){!function(){"use strict";function e(){return rn[q][B]||D}function r(n){return n&&"object"==typeof n}function o(n){return"function"==typeof n}function i(n,t){return n instanceof t}function u(n){return i(n,M)}function c(n,t,e){if(!t(n))throw h(e)}function f(){try{return R.apply(S,arguments)}catch(n){return nn.e=n,nn}}function s(n,t){return R=n,S=t,f}function a(n,t){function e(){for(var e=0;e<o;)t(r[e],r[e+1]),r[e++]=P,r[e++]=P;o=0,r.length>n&&(r.length=n)}var r=A(n),o=0;return function(n,t){r[o++]=n,r[o++]=t,2===o&&rn.nextTick(e)}}function l(n,t){var e,r,u,c,f=0;if(!n)throw h(Q);var a=n[rn[q][z]];if(o(a))r=a.call(n);else{if(!o(n.next)){if(i(n,A)){for(e=n.length;f<e;)t(n[f],f++);return f}throw h(Q)}r=n}for(;!(u=r.next()).done;)if((c=s(t)(u.value,f++))===nn)throw o(r[G])&&r[G](),c.e;return f}function h(n){return new TypeError(n)}function v(n){return(n?"":V)+(new M).stack}function _(n,t){var e="on"+n.toLowerCase(),r=O[e];H&&H.listeners(n).length?n===Z?H.emit(n,t._v,t):H.emit(n,t):r?r({reason:t._v,promise:t}):rn[n](t._v,t)}function p(n){return n&&n._s}function d(n){if(p(n))return new n(tn);var t,e,r;return t=new n(function(n,o){if(t)throw h();e=n,r=o}),c(e,o),c(r,o),t}function w(n,t){var e=!1;return function(r){e||(e=!0,L&&(n[N]=v(!0)),t===Y?k(n,r):x(n,t,r))}}function y(n,t,e,r){return o(e)&&(t._onFulfilled=e),o(r)&&(n[J]&&_(X,n),t._onRejected=r),L&&(t._p=n),n[n._c++]=t,n._s!==$&&on(n,t),t}function m(n){if(n._umark)return!0;n._umark=!0;for(var t,e=0,r=n._c;e<r;)if(t=n[e++],t._onRejected||m(t))return!0}function j(n,t){function e(n){return r.push(n.replace(/^\s+|\s+$/g,""))}var r=[];return L&&(t[N]&&e(t[N]),function o(n){n&&K in n&&(o(n._next),e(n[K]+""),o(n._p))}(t)),(n&&n.stack?n.stack:n)+("\n"+r.join("\n")).replace(en,"")}function g(n,t){return n(t)}function x(n,t,e){var r=0,o=n._c;if(n._s===$)for(n._s=t,n._v=e,t===U&&(L&&u(e)&&(e.longStack=j(e,n)),un(n));r<o;)on(n,n[r++]);return n}function k(n,t){if(t===n&&t)return x(n,U,h(W)),n;if(t!==C&&(o(t)||r(t))){var e=s(b)(t);if(e===nn)return x(n,U,e.e),n;o(e)?(L&&p(t)&&(n._next=t),p(t)?T(n,t,e):rn.nextTick(function(){T(n,t,e)})):x(n,Y,t)}else x(n,Y,t);return n}function b(n){return n.then}function T(n,t,e){var r=s(e,t)(function(e){t&&(t=C,k(n,e))},function(e){t&&(t=C,x(n,U,e))});r===nn&&t&&(x(n,U,r.e),t=C)}var P,R,S,C=null,F="object"==typeof self,O=F?self:t,E=O.Promise,H=O.process,I=O.console,L=!1,A=Array,M=Error,U=1,Y=2,$=3,q="Symbol",z="iterator",B="species",D=q+"("+B+")",G="return",J="_uh",K="_pt",N="_st",Q="Invalid argument",V="\nFrom previous ",W="Chaining cycle detected for promise",X="rejectionHandled",Z="unhandledRejection",nn={e:C},tn=function(){},en=/^.+\/node_modules\/yaku\/.+\n?/gm,rn=function(n){var t,e=this;if(!r(e)||e._s!==P)throw h("Invalid this");if(e._s=$,L&&(e[K]=v()),n!==tn){if(!o(n))throw h(Q);t=s(n)(w(e,Y),w(e,U)),t===nn&&x(e,U,t.e)}};rn["default"]=rn,function(n,t){for(var e in t)n[e]=t[e]}(rn.prototype,{then:function(n,t){if(this._s===undefined)throw h();return y(this,d(rn.speciesConstructor(this,rn)),n,t)},"catch":function(n){return this.then(P,n)},"finally":function(n){return this.then(function(t){return rn.resolve(n()).then(function(){return t})},function(t){return rn.resolve(n()).then(function(){throw t})})},_c:0,_p:C}),rn.resolve=function(n){return p(n)?n:k(d(this),n)},rn.reject=function(n){return x(d(this),U,n)},rn.race=function(n){var t=this,e=d(t),r=function(n){x(e,Y,n)},o=function(n){x(e,U,n)},i=s(l)(n,function(n){t.resolve(n).then(r,o)});return i===nn?t.reject(i.e):e},rn.all=function(n){function t(n){x(o,U,n)}var e,r=this,o=d(r),i=[];return(e=s(l)(n,function(n,u){r.resolve(n).then(function(n){i[u]=n,--e||x(o,Y,i)},t)}))===nn?r.reject(e.e):(e||x(o,Y,[]),o)},rn.Symbol=O[q]||{},s(function(){Object.defineProperty(rn,e(),{get:function(){return this}})})(),rn.speciesConstructor=function(n,t){var r=n.constructor;return r?r[e()]||t:t},rn.unhandledRejection=function(n,t){I&&I.error("Uncaught (in promise)",L?t.longStack:j(n,t))},rn.rejectionHandled=tn,rn.enableLongStackTrace=function(){L=!0},rn.nextTick=F?function(n){E?new E(function(n){n()}).then(n):setTimeout(n)}:H.nextTick,rn._s=1;var on=a(999,function(n,t){var e,r;return(r=n._s!==U?t._onFulfilled:t._onRejected)===P?void x(t,n._s,n._v):(e=s(g)(r,n._v))===nn?void x(t,U,e.e):void k(t,e)}),un=a(9,function(n){m(n)||(n[J]=1,_(Z,n))});try{n.exports=rn}catch(cn){O.Yaku=rn}}()}).call(t,e(/*! ./../~/webpack/buildin/global.js */2))}});
4029 }
4030
4031 if (!("flags"in RegExp.prototype
4032 )) {
4033
4034 // RegExp.prototype.flags
4035 /* global Get, ToBoolean, Type */
4036 Object.defineProperty(RegExp.prototype, 'flags', {
4037         configurable: true,
4038         enumerable: false,
4039         get: function () {
4040                 // 21.2.5.3.1 Let R be the this value.
4041                 var R = this;
4042
4043                 // 21.2.5.3.2 If Type(R) is not Object, throw a TypeError exception.
4044                 if (Type(R) !== 'object') {
4045                         throw new TypeError('Method called on incompatible type: must be an object.');
4046                 }
4047                 // 21.2.5.3.3 Let result be the empty String.
4048                 var result = '';
4049
4050                 // 21.2.5.3.4 Let global be ToBoolean(? Get(R, "global")).
4051                 var global = ToBoolean(Get(R, 'global'));
4052
4053                 // 21.2.5.3.5 If global is true, append the code unit 0x0067 (LATIN SMALL LETTER G) as the last code unit of result.
4054                 if (global) {
4055                         result += 'g';
4056                 }
4057
4058                 // 21.2.5.3.6 Let ignoreCase be ToBoolean(? Get(R, "ignoreCase")).
4059                 var ignoreCase = ToBoolean(Get(R, 'ignoreCase'));
4060
4061                 // 21.2.5.3.7 If ignoreCase is true, append the code unit 0x0069 (LATIN SMALL LETTER I) as the last code unit of result.
4062                 if (ignoreCase) {
4063                         result += 'i';
4064                 }
4065
4066                 // 21.2.5.3.8 Let multiline be ToBoolean(? Get(R, "multiline")).
4067                 var multiline = ToBoolean(Get(R, 'multiline'));
4068
4069                 // 21.2.5.3.9 If multiline is true, append the code unit 0x006D (LATIN SMALL LETTER M) as the last code unit of result.
4070                 if (multiline) {
4071                         result += 'm';
4072                 }
4073
4074                 // 21.2.5.3.10 Let unicode be ToBoolean(? Get(R, "unicode")).
4075                 var unicode = ToBoolean(Get(R, 'unicode'));
4076
4077                 // 21.2.5.3.11 If unicode is true, append the code unit 0x0075 (LATIN SMALL LETTER U) as the last code unit of result.
4078                 if (unicode) {
4079                         result += 'u';
4080                 }
4081
4082                 // 21.2.5.3.12 Let sticky be ToBoolean(? Get(R, "sticky")).
4083                 var sticky = ToBoolean(Get(R, 'sticky'));
4084
4085                 // 21.2.5.3.13 If sticky is true, append the code unit 0x0079 (LATIN SMALL LETTER Y) as the last code unit of result.
4086                 if (sticky) {
4087                         result += 'y';
4088                 }
4089
4090                 // 21.2.5.3.14 Return result.
4091                 return result;
4092         }
4093 });
4094
4095 }
4096
4097 if (!("fromCodePoint"in String&&1===String.fromCodePoint.length
4098 )) {
4099
4100 // String.fromCodePoint
4101 /* global CreateMethodProperty, IsArray, SameValue, ToInteger, ToNumber, UTF16Encoding */
4102
4103 // 21.1.2.2. String.fromCodePoint ( ...codePoints )
4104 CreateMethodProperty(String, 'fromCodePoint', function fromCodePoint(_) { // eslint-disable-line no-unused-vars
4105         // Polyfill.io - List to store the characters whilst iterating over the code points.
4106         var result = [];
4107         // 1. Let codePoints be a List containing the arguments passed to this function.
4108         var codePoints = arguments;
4109         // 2. Let length be the number of elements in codePoints.
4110         var length = arguments.length;
4111         // 3. Let elements be a new empty List.
4112         var elements = [];
4113         // 4. Let nextIndex be 0.
4114         var nextIndex = 0;
4115         // 5. Repeat, while nextIndex < length
4116         while (nextIndex < length) {
4117                 // Polyfill.io - We reset the elements List as we store the partial results in the result List.
4118                 var elements = [];
4119                 // a. Let next be codePoints[nextIndex].
4120                 var next = codePoints[nextIndex];
4121                 // b. Let nextCP be ? ToNumber(next).
4122                 var nextCP = ToNumber(next);
4123                 // c. If SameValue(nextCP, ToInteger(nextCP)) is false, throw a RangeError exception.
4124                 if (SameValue(nextCP, ToInteger(nextCP)) === false) {
4125                         throw new RangeError('Invalid code point ' + Object.prototype.toString.call(nextCP));
4126                 }
4127                 // d. If nextCP < 0 or nextCP > 0x10FFFF, throw a RangeError exception.
4128                 if (nextCP < 0 || nextCP > 0x10FFFF) {
4129                         throw new RangeError('Invalid code point ' + Object.prototype.toString.call(nextCP));
4130                 }
4131                 // e. Append the elements of the UTF16Encoding of nextCP to the end of elements.
4132                 // Polyfill.io - UTF16Encoding can return a single codepoint or a list of multiple codepoints.
4133                 var cp = UTF16Encoding(nextCP);
4134                 if (IsArray(cp)) {
4135                         elements = elements.concat(cp);
4136                 } else {
4137                         elements.push(cp);
4138                 }
4139                 // f. Let nextIndex be nextIndex + 1.
4140                 nextIndex = nextIndex + 1;
4141
4142                 // Polyfill.io - Retrieving the characters whilst iterating enables the function to work in a memory efficient and performant way.
4143                 result.push(String.fromCharCode.apply(null, elements));
4144         }
4145         // 6. Return the String value whose elements are, in order, the elements in the List elements. If length is 0, the empty string is returned.
4146         return length === 0 ? '' : result.join('');
4147 });
4148
4149 }
4150
4151 if (!("codePointAt"in String.prototype
4152 )) {
4153
4154 // String.prototype.codePointAt
4155 /* global CreateMethodProperty, RequireObjectCoercible, ToInteger, ToString, UTF16Decode */
4156 // 21.1.3.3. String.prototype.codePointAt ( pos )
4157 CreateMethodProperty(String.prototype, 'codePointAt', function codePointAt(pos) {
4158         // 1. Let O be ? RequireObjectCoercible(this value).
4159         var O = RequireObjectCoercible(this);
4160         // 2. Let S be ? ToString(O).
4161         var S = ToString(O);
4162         // 3. Let position be ? ToInteger(pos).
4163         var position = ToInteger(pos);
4164         // 4. Let size be the length of S.
4165         var size = S.length;
4166         // 5. If position < 0 or position ≥ size, return undefined.
4167         if (position < 0 || position >= size) {
4168                 return undefined;
4169         }
4170         // 6. Let first be the numeric value of the code unit at index position within the String S.
4171         var first = String.prototype.charCodeAt.call(S, position);
4172         // 7. If first < 0xD800 or first > 0xDBFF or position+1 = size, return first.
4173         if (first < 0xD800 || first > 0xDBFF || position + 1 === size) {
4174                 return first;
4175         }
4176         // 8. Let second be the numeric value of the code unit at index position+1 within the String S.
4177         var second = String.prototype.charCodeAt.call(S, position + 1);
4178         // 9. If second < 0xDC00 or second > 0xDFFF, return first.
4179         if (second < 0xDC00 || second > 0xDFFF) {
4180                 return first;
4181         }
4182         // 10. Return UTF16Decode(first, second).
4183         // 21.1.3.3.10 Return UTF16Decode(first, second).
4184         return UTF16Decode(first, second);
4185 });
4186
4187 }
4188
4189 if (!("endsWith"in String.prototype
4190 )) {
4191
4192 // String.prototype.endsWith
4193 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4194 // 21.1.3.6. String.prototype.endsWith ( searchString [ , endPosition ] )
4195 CreateMethodProperty(String.prototype, 'endsWith', function endsWith(searchString /* [ , endPosition ] */) {
4196         'use strict';
4197         var endPosition = arguments.length > 1 ? arguments[1] : undefined;
4198         // 1. Let O be ? RequireObjectCoercible(this value).
4199         var O = RequireObjectCoercible(this);
4200         // 2. Let S be ? ToString(O).
4201         var S = ToString(O);
4202         // 3. Let isRegExp be ? IsRegExp(searchString).
4203         var isRegExp = IsRegExp(searchString);
4204         // 4. If isRegExp is true, throw a TypeError exception.
4205         if (isRegExp) {
4206                 throw new TypeError('First argument to String.prototype.endsWith must not be a regular expression');
4207         }
4208         // 5. Let searchStr be ? ToString(searchString).
4209         var searchStr = ToString(searchString);
4210         // 6. Let len be the length of S.
4211         var len = S.length;
4212         // 7. If endPosition is undefined, let pos be len, else let pos be ? ToInteger(endPosition).
4213         var pos = endPosition === undefined ? len : ToInteger(endPosition);
4214         // 8. Let end be min(max(pos, 0), len).
4215         var end = Math.min(Math.max(pos, 0), len);
4216         // 9. Let searchLength be the length of searchStr.
4217         var searchLength = searchStr.length;
4218         // 10. Let start be end - searchLength.
4219         var start = end - searchLength;
4220         // 11. If start is less than 0, return false.
4221         if (start < 0) {
4222                 return false;
4223         }
4224         // 12. If the sequence of elements of S starting at start of length searchLength is the same as the full element sequence of searchStr, return true.
4225         if (S.substr(start, searchLength) === searchStr) {
4226                 return true;
4227          }
4228         // 13. Otherwise, return false.
4229         return false;
4230 });
4231
4232 }
4233
4234 if (!("includes"in String.prototype
4235 )) {
4236
4237 // String.prototype.includes
4238 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4239 // 21.1.3.7. String.prototype.includes ( searchString [ , position ] )
4240 CreateMethodProperty(String.prototype, 'includes', function includes(searchString /* [ , position ] */) {
4241         'use strict';
4242         var position = arguments.length > 1 ? arguments[1] : undefined;
4243         // 1. Let O be ? RequireObjectCoercible(this value).
4244         var O = RequireObjectCoercible(this);
4245         // 2. Let S be ? ToString(O).
4246         var S = ToString(O);
4247         // 3. Let isRegExp be ? IsRegExp(searchString).
4248         var isRegExp = IsRegExp(searchString);
4249         // 4. If isRegExp is true, throw a TypeError exception.
4250         if (isRegExp) {
4251                 throw new TypeError('First argument to String.prototype.includes must not be a regular expression');
4252         }
4253         // 5. Let searchStr be ? ToString(searchString).
4254         var searchStr = ToString(searchString);
4255         // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)
4256         var pos = ToInteger(position);
4257         // 7. Let len be the length of S.
4258         var len = S.length;
4259         // 8. Let start be min(max(pos, 0), len).
4260         var start = Math.min(Math.max(pos, 0), len);
4261         // 9. Let searchLen be the length of searchStr.
4262         // var searchLength = searchStr.length;
4263         // 10. If there exists any integer k not smaller than start such that k + searchLen is not greater than len, and for all nonnegative integers j less than searchLen, the code unit at index k+j within S is the same as the code unit at index j within searchStr, return true; but if there is no such integer k, return false.
4264         return String.prototype.indexOf.call(S, searchStr, start) !== -1;
4265 });
4266
4267 }
4268
4269 if (!("repeat"in String.prototype
4270 )) {
4271
4272 // String.prototype.repeat
4273 /* global CreateMethodProperty, RequireObjectCoercible, ToInteger, ToString */
4274 // 21.1.3.15String.prototype.repeat ( count )
4275 CreateMethodProperty(String.prototype, 'repeat', function repeat(count) {
4276         'use strict';
4277         // 1. Let O be ? RequireObjectCoercible(this value).
4278         var O = RequireObjectCoercible(this);
4279         // 2. Let S be ? ToString(O).
4280         var S = ToString(O);
4281         // 3. Let n be ? ToInteger(count).
4282         var n = ToInteger(count);
4283         // 4. If n < 0, throw a RangeError exception.
4284         if (n < 0) {
4285                 throw new RangeError('Invalid count value');
4286         }
4287         // 5. If n is +∞, throw a RangeError exception.
4288         if (n === Infinity) {
4289                 throw new RangeError('Invalid count value');
4290         }
4291         // 6. Let T be the String value that is made from n copies of S appended together. If n is 0, T is the empty String.
4292         var T = n === 0 ? '' : new Array(n + 1).join(S);
4293         // 7. Return T.
4294         return T;
4295 });
4296
4297 }
4298
4299 if (!("startsWith"in String.prototype
4300 )) {
4301
4302 // String.prototype.startsWith
4303 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4304 // 21.1.3.20. String.prototype.startsWith ( searchString [ , position ] )
4305 CreateMethodProperty(String.prototype, 'startsWith', function startsWith(searchString /* [ , position ] */) {
4306         'use strict';
4307         var position = arguments.length > 1 ? arguments[1] : undefined;
4308         // 1. Let O be ? RequireObjectCoercible(this value).
4309         var O = RequireObjectCoercible(this);
4310         // 2. Let S be ? ToString(O).
4311         var S = ToString(O);
4312         // 3. Let isRegExp be ? IsRegExp(searchString).
4313         var isRegExp = IsRegExp(searchString);
4314         // 4. If isRegExp is true, throw a TypeError exception.
4315         if (isRegExp) {
4316                 throw new TypeError('First argument to String.prototype.startsWith must not be a regular expression');
4317         }
4318         // 5. Let searchStr be ? ToString(searchString).
4319         var searchStr = ToString(searchString);
4320         // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)
4321         var pos = ToInteger(position);
4322         // 7. Let len be the length of S.
4323         var len = S.length;
4324         // 8. Let start be min(max(pos, 0), len).
4325         var start = Math.min(Math.max(pos, 0), len);
4326         // 9. Let searchLength be the length of searchStr.
4327         var searchLength = searchStr.length;
4328         // 10. If searchLength+start is greater than len, return false.
4329         if (searchLength + start > len) {
4330                 return false;
4331         }
4332         // 11. If the sequence of elements of S starting at start of length searchLength is the same as the full element sequence of searchStr, return true.
4333         if (S.substr(start).indexOf(searchString) === 0) {
4334                 return true;
4335         }
4336         // 12. Otherwise, return false.
4337         return false;
4338 });
4339
4340 }
4341
4342 if (!("Symbol"in this&&0===this.Symbol.length
4343 )) {
4344
4345 // Symbol
4346 // A modification of https://github.com/WebReflection/get-own-property-symbols
4347 // (C) Andrea Giammarchi - MIT Licensed
4348
4349 (function (Object, GOPS, global) {
4350
4351         var     setDescriptor;
4352         var id = 0;
4353         var random = '' + Math.random();
4354         var prefix = '__\x01symbol:';
4355         var prefixLength = prefix.length;
4356         var internalSymbol = '__\x01symbol@@' + random;
4357         var DP = 'defineProperty';
4358         var DPies = 'defineProperties';
4359         var GOPN = 'getOwnPropertyNames';
4360         var GOPD = 'getOwnPropertyDescriptor';
4361         var PIE = 'propertyIsEnumerable';
4362         var ObjectProto = Object.prototype;
4363         var hOP = ObjectProto.hasOwnProperty;
4364         var pIE = ObjectProto[PIE];
4365         var toString = ObjectProto.toString;
4366         var concat = Array.prototype.concat;
4367         var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : [];
4368         var nGOPN = Object[GOPN];
4369         var gOPN = function getOwnPropertyNames (obj) {
4370                 if (toString.call(obj) === '[object Window]') {
4371                         try {
4372                                 return nGOPN(obj);
4373                         } catch (e) {
4374                                 // IE bug where layout engine calls userland gOPN for cross-domain `window` objects
4375                                 return concat.call([], cachedWindowNames);
4376                         }
4377                 }
4378                 return nGOPN(obj);
4379         };
4380         var gOPD = Object[GOPD];
4381         var create = Object.create;
4382         var keys = Object.keys;
4383         var freeze = Object.freeze || Object;
4384         var defineProperty = Object[DP];
4385         var $defineProperties = Object[DPies];
4386         var descriptor = gOPD(Object, GOPN);
4387         var addInternalIfNeeded = function (o, uid, enumerable) {
4388                 if (!hOP.call(o, internalSymbol)) {
4389                         try {
4390                                 defineProperty(o, internalSymbol, {
4391                                         enumerable: false,
4392                                         configurable: false,
4393                                         writable: false,
4394                                         value: {}
4395                                 });
4396                         } catch (e) {
4397                                 o[internalSymbol] = {};
4398                         }
4399                 }
4400                 o[internalSymbol]['@@' + uid] = enumerable;
4401         };
4402         var createWithSymbols = function (proto, descriptors) {
4403                 var self = create(proto);
4404                 gOPN(descriptors).forEach(function (key) {
4405                         if (propertyIsEnumerable.call(descriptors, key)) {
4406                                 $defineProperty(self, key, descriptors[key]);
4407                         }
4408                 });
4409                 return self;
4410         };
4411         var copyAsNonEnumerable = function (descriptor) {
4412                 var newDescriptor = create(descriptor);
4413                 newDescriptor.enumerable = false;
4414                 return newDescriptor;
4415         };
4416         var get = function get(){};
4417         var onlyNonSymbols = function (name) {
4418                 return name != internalSymbol &&
4419                         !hOP.call(source, name);
4420         };
4421         var onlySymbols = function (name) {
4422                 return name != internalSymbol &&
4423                         hOP.call(source, name);
4424         };
4425         var propertyIsEnumerable = function propertyIsEnumerable(key) {
4426                 var uid = '' + key;
4427                 return onlySymbols(uid) ? (
4428                         hOP.call(this, uid) &&
4429                         this[internalSymbol]['@@' + uid]
4430                 ) : pIE.call(this, key);
4431         };
4432         var setAndGetSymbol = function (uid) {
4433                 var descriptor = {
4434                         enumerable: false,
4435                         configurable: true,
4436                         get: get,
4437                         set: function (value) {
4438                         setDescriptor(this, uid, {
4439                                 enumerable: false,
4440                                 configurable: true,
4441                                 writable: true,
4442                                 value: value
4443                         });
4444                         addInternalIfNeeded(this, uid, true);
4445                         }
4446                 };
4447                 try {
4448                         defineProperty(ObjectProto, uid, descriptor);
4449                 } catch (e) {
4450                         ObjectProto[uid] = descriptor.value;
4451                 }
4452                 return freeze(source[uid] = defineProperty(
4453                         Object(uid),
4454                         'constructor',
4455                         sourceConstructor
4456                 ));
4457         };
4458         var Symbol = function Symbol() {
4459                 var description = arguments[0];
4460                 if (this instanceof Symbol) {
4461                         throw new TypeError('Symbol is not a constructor');
4462                 }
4463                 return setAndGetSymbol(
4464                         prefix.concat(description || '', random, ++id)
4465                 );
4466                 };
4467         var source = create(null);
4468         var sourceConstructor = {value: Symbol};
4469         var sourceMap = function (uid) {
4470                 return source[uid];
4471                 };
4472         var $defineProperty = function defineProp(o, key, descriptor) {
4473                 var uid = '' + key;
4474                 if (onlySymbols(uid)) {
4475                         setDescriptor(o, uid, descriptor.enumerable ?
4476                                 copyAsNonEnumerable(descriptor) : descriptor);
4477                         addInternalIfNeeded(o, uid, !!descriptor.enumerable);
4478                 } else {
4479                         defineProperty(o, key, descriptor);
4480                 }
4481                 return o;
4482         };
4483
4484         var onlyInternalSymbols = function (obj) {
4485                 return function (name) {
4486                         return hOP.call(obj, internalSymbol) && hOP.call(obj[internalSymbol], '@@' + name);
4487                 };
4488         };
4489         var $getOwnPropertySymbols = function getOwnPropertySymbols(o) {
4490                 return gOPN(o).filter(o === ObjectProto ? onlyInternalSymbols(o) : onlySymbols).map(sourceMap);
4491                 }
4492         ;
4493
4494         descriptor.value = $defineProperty;
4495         defineProperty(Object, DP, descriptor);
4496
4497         descriptor.value = $getOwnPropertySymbols;
4498         defineProperty(Object, GOPS, descriptor);
4499
4500         descriptor.value = function getOwnPropertyNames(o) {
4501                 return gOPN(o).filter(onlyNonSymbols);
4502         };
4503         defineProperty(Object, GOPN, descriptor);
4504
4505         descriptor.value = function defineProperties(o, descriptors) {
4506                 var symbols = $getOwnPropertySymbols(descriptors);
4507                 if (symbols.length) {
4508                 keys(descriptors).concat(symbols).forEach(function (uid) {
4509                         if (propertyIsEnumerable.call(descriptors, uid)) {
4510                         $defineProperty(o, uid, descriptors[uid]);
4511                         }
4512                 });
4513                 } else {
4514                 $defineProperties(o, descriptors);
4515                 }
4516                 return o;
4517         };
4518         defineProperty(Object, DPies, descriptor);
4519
4520         descriptor.value = propertyIsEnumerable;
4521         defineProperty(ObjectProto, PIE, descriptor);
4522
4523         descriptor.value = Symbol;
4524         defineProperty(global, 'Symbol', descriptor);
4525
4526         // defining `Symbol.for(key)`
4527         descriptor.value = function (key) {
4528                 var uid = prefix.concat(prefix, key, random);
4529                 return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid);
4530         };
4531         defineProperty(Symbol, 'for', descriptor);
4532
4533         // defining `Symbol.keyFor(symbol)`
4534         descriptor.value = function (symbol) {
4535                 if (onlyNonSymbols(symbol))
4536                 throw new TypeError(symbol + ' is not a symbol');
4537                 return hOP.call(source, symbol) ?
4538                 symbol.slice(prefixLength * 2, -random.length) :
4539                 void 0
4540                 ;
4541         };
4542         defineProperty(Symbol, 'keyFor', descriptor);
4543
4544         descriptor.value = function getOwnPropertyDescriptor(o, key) {
4545                 var descriptor = gOPD(o, key);
4546                 if (descriptor && onlySymbols(key)) {
4547                 descriptor.enumerable = propertyIsEnumerable.call(o, key);
4548                 }
4549                 return descriptor;
4550         };
4551         defineProperty(Object, GOPD, descriptor);
4552
4553         descriptor.value = function (proto, descriptors) {
4554                 return arguments.length === 1 || typeof descriptors === "undefined" ?
4555                 create(proto) :
4556                 createWithSymbols(proto, descriptors);
4557         };
4558         defineProperty(Object, 'create', descriptor);
4559
4560         descriptor.value = function () {
4561                 var str = toString.call(this);
4562                 return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str;
4563         };
4564         defineProperty(ObjectProto, 'toString', descriptor);
4565
4566
4567         setDescriptor = function (o, key, descriptor) {
4568                 var protoDescriptor = gOPD(ObjectProto, key);
4569                 delete ObjectProto[key];
4570                 defineProperty(o, key, descriptor);
4571                 if (o !== ObjectProto) {
4572                         defineProperty(ObjectProto, key, protoDescriptor);
4573                 }
4574         };
4575
4576 }(Object, 'getOwnPropertySymbols', this));
4577
4578 }
4579
4580 if (!("Symbol"in this&&"hasInstance"in this.Symbol
4581 )) {
4582
4583 // Symbol.hasInstance
4584 /* global Symbol */
4585 Object.defineProperty(Symbol, 'hasInstance', { value: Symbol('hasInstance') });
4586
4587 }
4588
4589 if (!("Symbol"in this&&"isConcatSpreadable"in this.Symbol
4590 )) {
4591
4592 // Symbol.isConcatSpreadable
4593 /* global Symbol */
4594 Object.defineProperty(Symbol, 'isConcatSpreadable', { value: Symbol('isConcatSpreadable') });
4595
4596 }
4597
4598 if (!("Symbol"in this&&"iterator"in this.Symbol
4599 )) {
4600
4601 // Symbol.iterator
4602 /* global Symbol */
4603 Object.defineProperty(Symbol, 'iterator', { value: Symbol('iterator') });
4604
4605 }
4606
4607 if (!("Symbol"in this&&"match"in this.Symbol
4608 )) {
4609
4610 // Symbol.match
4611 /* global Symbol */
4612 Object.defineProperty(Symbol, 'match', { value: Symbol('match') });
4613
4614 }
4615
4616 if (!("Symbol"in this&&"replace"in this.Symbol
4617 )) {
4618
4619 // Symbol.replace
4620 /* global Symbol */
4621 Object.defineProperty(Symbol, 'replace', { value: Symbol('replace') });
4622
4623 }
4624
4625 if (!("Symbol"in this&&"search"in this.Symbol
4626 )) {
4627
4628 // Symbol.search
4629 /* global Symbol */
4630 Object.defineProperty(Symbol, 'search', { value: Symbol('search') });
4631
4632 }
4633
4634 if (!("Symbol"in this&&"species"in this.Symbol
4635 )) {
4636
4637 // Symbol.species
4638 /* global Symbol */
4639 Object.defineProperty(Symbol, 'species', { value: Symbol('species') });
4640
4641 }
4642
4643 if (!("Map"in this&&function(){try{var t=new Map([[1,1],[2,2]])
4644 return 0===Map.length&&2===t.size&&"Symbol"in this&&"iterator"in Symbol&&"function"==typeof t[Symbol.iterator]}catch(n){return!1}}()
4645 )) {
4646
4647 // Map
4648 /* global CreateIterResultObject, CreateMethodProperty, GetIterator, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Type, Symbol */
4649 (function (global) {
4650         var supportsGetters = (function () {
4651                 try {
4652                         var a = {};
4653                         Object.defineProperty(a, 't', {
4654                                 configurable: true,
4655                                 enumerable: false,
4656                                 get: function () {
4657                                         return true;
4658                                 },
4659                                 set: undefined
4660                         });
4661                         return !!a.t;
4662                 } catch (e) {
4663                         return false;
4664                 }
4665         }());
4666
4667         // Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
4668         var undefMarker = Symbol('undef');
4669         // 23.1.1.1 Map ( [ iterable ] )
4670         var Map = function Map(/* iterable */) {
4671                 // 1. If NewTarget is undefined, throw a TypeError exception.
4672                 if (!(this instanceof Map)) {
4673                         throw new TypeError('Constructor Map requires "new"');
4674                 }
4675                 // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, "%MapPrototype%", « [[MapData]] »).
4676                 var map = OrdinaryCreateFromConstructor(this, Map.prototype, {
4677                         _keys: [],
4678                         _values: [],
4679                         _size: 0,
4680                         _es6Map: true
4681                 });
4682
4683                 // 3. Set map.[[MapData]] to a new empty List.
4684                 // Polyfill.io - This step was done as part of step two.
4685
4686                 // Some old engines do not support ES5 getters/setters.  Since Map only requires these for the size property, we can fall back to setting the size property statically each time the size of the map changes.
4687                 if (!supportsGetters) {
4688                         Object.defineProperty(map, 'size', {
4689                                 configurable: true,
4690                                 enumerable: false,
4691                                 writable: true,
4692                                 value: 0
4693                         });
4694                 }
4695
4696                 // 4. If iterable is not present, let iterable be undefined.
4697                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
4698
4699                 // 5. If iterable is either undefined or null, return map.
4700                 if (iterable === null || iterable === undefined) {
4701                         return map;
4702                 }
4703
4704                 // 6. Let adder be ? Get(map, "set").
4705                 var adder = map.set;
4706
4707                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
4708                 if (!IsCallable(adder)) {
4709                         throw new TypeError("Map.prototype.set is not a function");
4710                 }
4711
4712                 // 8. Let iteratorRecord be ? GetIterator(iterable).
4713                 try {
4714                         var iteratorRecord = GetIterator(iterable);
4715                         // 9. Repeat,
4716                         while (true) {
4717                                 // a. Let next be ? IteratorStep(iteratorRecord).
4718                                 var next = IteratorStep(iteratorRecord);
4719                                 // b. If next is false, return map.
4720                                 if (next === false) {
4721                                         return map;
4722                                 }
4723                                 // c. Let nextItem be ? IteratorValue(next).
4724                                 var nextItem = IteratorValue(next);
4725                                 // d. If Type(nextItem) is not Object, then
4726                                 if (Type(nextItem) !== 'object') {
4727                                         // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
4728                                         try {
4729                                                 throw new TypeError('Iterator value ' + nextItem + ' is not an entry object');
4730                                         } catch (error) {
4731                                                 // ii. Return ? IteratorClose(iteratorRecord, error).
4732                                                 return IteratorClose(iteratorRecord, error);
4733                                         }
4734                                 }
4735                                 try {
4736                                         // Polyfill.io - The try catch accounts for steps: f, h, and j.
4737
4738                                         // e. Let k be Get(nextItem, "0").
4739                                         var k = nextItem[0];
4740                                         // f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
4741                                         // g. Let v be Get(nextItem, "1").
4742                                         var v = nextItem[1];
4743                                         // h. If v is an abrupt completion, return ? IteratorClose(iteratorRecord, v).
4744                                         // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).
4745                                         adder.call(map, k, v);
4746                                 } catch (e) {
4747                                         // j. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
4748                                         return IteratorClose(iteratorRecord, e);
4749                                 }
4750                         }
4751                 } catch (e) {
4752                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
4753                         if (Array.isArray(iterable) ||
4754                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
4755                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
4756                                 (!!iterable.callee)) {
4757                                 var index;
4758                                 var length = iterable.length;
4759                                 for (index = 0; index < length; index++) {
4760                                         adder.call(map, iterable[index][0], iterable[index][1]);
4761                                 }
4762                         }
4763                 }
4764                 return map;
4765         };
4766
4767         // 23.1.2.1. Map.prototype
4768         // The initial value of Map.prototype is the intrinsic object %MapPrototype%.
4769         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
4770         Object.defineProperty(Map, 'prototype', {
4771                 configurable: false,
4772                 enumerable: false,
4773                 writable: false,
4774                 value: {}
4775         });
4776
4777         // 23.1.2.2 get Map [ @@species ]
4778         if (supportsGetters) {
4779                 Object.defineProperty(Map, Symbol.species, {
4780                         configurable: true,
4781                         enumerable: false,
4782                         get: function () {
4783                                 // 1. Return the this value.
4784                                 return this;
4785                         },
4786                         set: undefined
4787                 });
4788         } else {
4789                 CreateMethodProperty(Map, Symbol.species, Map);
4790         }
4791
4792         // 23.1.3.1 Map.prototype.clear ( )
4793         CreateMethodProperty(Map.prototype, 'clear', function clear() {
4794                         // 1. Let M be the this value.
4795                         var M = this;
4796                         // 2. If Type(M) is not Object, throw a TypeError exception.
4797                         if (Type(M) !== 'object') {
4798                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4799                         }
4800                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4801                         if (M._es6Map !== true) {
4802                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4803                         }
4804                         // 4. Let entries be the List that is M.[[MapData]].
4805                         var entries = M._keys;
4806                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4807                         for (var i = 0; i < entries.length; i++) {
4808                                 // 5.a. Set p.[[Key]] to empty.
4809                                 M._keys[i] = undefMarker;
4810                                 // 5.b. Set p.[[Value]] to empty.
4811                                 M._values[i] = undefMarker;
4812                         }
4813                         this._size = 0;
4814                         if (!supportsGetters) {
4815                                 this.size = this._size;
4816                         }
4817                         // 6. Return undefined.
4818                         return undefined;
4819                 }
4820         );
4821
4822         // 23.1.3.2. Map.prototype.constructor
4823         CreateMethodProperty(Map.prototype, 'constructor', Map);
4824
4825         // 23.1.3.3. Map.prototype.delete ( key )
4826         CreateMethodProperty(Map.prototype, 'delete', function (key) {
4827                         // 1. Let M be the this value.
4828                         var M = this;
4829                         // 2. If Type(M) is not Object, throw a TypeError exception.
4830                         if (Type(M) !== 'object') {
4831                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4832                         }
4833                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4834                         if (M._es6Map !== true) {
4835                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4836                         }
4837                         // 4. Let entries be the List that is M.[[MapData]].
4838                         var entries = M._keys;
4839                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4840                         for (var i = 0; i < entries.length; i++) {
4841                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then
4842                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4843                                         // i. Set p.[[Key]] to empty.
4844                                         this._keys[i] = undefMarker;
4845                                         // ii. Set p.[[Value]] to empty.
4846                                         this._values[i] = undefMarker;
4847                                         this._size = --this._size;
4848                                         if (!supportsGetters) {
4849                                                 this.size = this._size;
4850                                         }
4851                                         // iii. Return true.
4852                                         return true;
4853                                 }
4854                         }
4855                         // 6. Return false.
4856                         return false;
4857                 }
4858         );
4859
4860         // 23.1.3.4. Map.prototype.entries ( )
4861         CreateMethodProperty(Map.prototype, 'entries', function entries () {
4862                         // 1. Let M be the this value.
4863                         var M = this;
4864                         // 2. Return ? CreateMapIterator(M, "key+value").
4865                         return CreateMapIterator(M, 'key+value');
4866                 }
4867         );
4868
4869         // 23.1.3.5. Map.prototype.forEach ( callbackfn [ , thisArg ] )
4870         CreateMethodProperty(Map.prototype, 'forEach', function (callbackFn) {
4871                         // 1. Let M be the this value.
4872                         var M = this;
4873                         // 2. If Type(M) is not Object, throw a TypeError exception.
4874                         if (Type(M) !== 'object') {
4875                                 throw new TypeError('Method Map.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(M));
4876                         }
4877                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4878                         if (M._es6Map !== true) {
4879                                 throw new TypeError('Method Map.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(M));
4880                         }
4881                         // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
4882                         if (!IsCallable(callbackFn)) {
4883                                 throw new TypeError(Object.prototype.toString.call(callbackFn) + ' is not a function.');
4884                         }
4885                         // 5. If thisArg is present, let T be thisArg; else let T be undefined.
4886                         if (arguments[1]) {
4887                                 var T = arguments[1];
4888                         }
4889                         // 6. Let entries be the List that is M.[[MapData]].
4890                         var entries = M._keys;
4891                         // 7. For each Record {[[Key]], [[Value]]} e that is an element of entries, in original key insertion order, do
4892                         for (var i = 0; i < entries.length; i++) {
4893                                 // a. If e.[[Key]] is not empty, then
4894                                 if (M._keys[i] !== undefMarker && M._values[i] !== undefMarker ) {
4895                                         // i. Perform ? Call(callbackfn, T, « e.[[Value]], e.[[Key]], M »).
4896                                         callbackFn.call(T, M._values[i], M._keys[i], M);
4897                                 }
4898                         }
4899                         // 8. Return undefined.
4900                         return undefined;
4901                 }
4902         );
4903
4904         // 23.1.3.6. Map.prototype.get ( key )
4905         CreateMethodProperty(Map.prototype, 'get', function get(key) {
4906                         // 1. Let M be the this value.
4907                         var M = this;
4908                         // 2. If Type(M) is not Object, throw a TypeError exception.
4909                         if (Type(M) !== 'object') {
4910                                 throw new TypeError('Method Map.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
4911                         }
4912                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4913                         if (M._es6Map !== true) {
4914                                 throw new TypeError('Method Map.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
4915                         }
4916                         // 4. Let entries be the List that is M.[[MapData]].
4917                         var entries = M._keys;
4918                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4919                         for (var i = 0; i < entries.length; i++) {
4920                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return p.[[Value]].
4921                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4922                                         return M._values[i];
4923                                 }
4924                         }
4925                         // 6. Return undefined.
4926                         return undefined;
4927                 });
4928
4929         // 23.1.3.7. Map.prototype.has ( key )
4930         CreateMethodProperty(Map.prototype, 'has', function has (key) {
4931                         // 1. Let M be the this value.
4932                         var M = this;
4933                         // 2. If Type(M) is not Object, throw a TypeError exception.
4934                         if (typeof M !== 'object') {
4935                                 throw new TypeError('Method Map.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
4936                         }
4937                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4938                         if (M._es6Map !== true) {
4939                                 throw new TypeError('Method Map.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
4940                         }
4941                         // 4. Let entries be the List that is M.[[MapData]].
4942                         var entries = M._keys;
4943                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4944                         for (var i = 0; i < entries.length; i++) {
4945                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return true.
4946                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4947                                         return true;
4948                                 }
4949                         }
4950                         // 6. Return false.
4951                         return false;
4952                 });
4953
4954         // 23.1.3.8. Map.prototype.keys ( )
4955         CreateMethodProperty(Map.prototype, 'keys', function keys () {
4956                         // 1. Let M be the this value.
4957                         var M = this;
4958                         // 2. Return ? CreateMapIterator(M, "key").
4959                         return CreateMapIterator(M, "key");
4960                 });
4961
4962         // 23.1.3.9. Map.prototype.set ( key, value )
4963         CreateMethodProperty(Map.prototype, 'set', function set(key, value) {
4964                         // 1. Let M be the this value.
4965                         var M = this;
4966                         // 2. If Type(M) is not Object, throw a TypeError exception.
4967                         if (Type(M) !== 'object') {
4968                                 throw new TypeError('Method Map.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
4969                         }
4970                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4971                         if (M._es6Map !== true) {
4972                                 throw new TypeError('Method Map.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
4973                         }
4974                         // 4. Let entries be the List that is M.[[MapData]].
4975                         var entries = M._keys;
4976                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4977                         for (var i = 0; i < entries.length; i++) {
4978                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then
4979                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4980                                         // i. Set p.[[Value]] to value.
4981                                         M._values[i] = value;
4982                                         // Return M.
4983                                         return M;
4984                                 }
4985                         }
4986                         // 6. If key is -0, let key be +0.
4987                         if (key === -0) {
4988                                 key = 0;
4989                         }
4990                         // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.
4991                         var p = {};
4992                         p['[[Key]]'] = key;
4993                         p['[[Value]]'] = value;
4994                         // 8. Append p as the last element of entries.
4995                         M._keys.push(p['[[Key]]']);
4996                         M._values.push(p['[[Value]]']);
4997                         ++M._size;
4998                         if (!supportsGetters) {
4999                                 M.size = M._size;
5000                         }
5001                         // 9. Return M.
5002                         return M;
5003                 });
5004
5005         // 23.1.3.10. get Map.prototype.size
5006         if (supportsGetters) {
5007                 Object.defineProperty(Map.prototype, 'size', {
5008                         configurable: true,
5009                         enumerable: false,
5010                         get: function () {
5011                                 // 1. Let M be the this value.
5012                                 var M = this;
5013                                 // 2. If Type(M) is not Object, throw a TypeError exception.
5014                                 if (Type(M) !== 'object') {
5015                                         throw new TypeError('Method Map.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(M));
5016                                 }
5017                                 // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
5018                                 if (M._es6Map !== true) {
5019                                         throw new TypeError('Method Map.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(M));
5020                                 }
5021                                 // 4. Let entries be the List that is M.[[MapData]].
5022                                 var entries = M._keys;
5023                                 // 5. Let count be 0.
5024                                 var count = 0;
5025                                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
5026                                 for (var i = 0; i < entries.length; i++) {
5027                                         // a. If p.[[Key]] is not empty, set count to count+1.
5028                                         if (M._keys[i] !== undefMarker) {
5029                                                 count = count + 1;
5030                                         }
5031                                 }
5032                                 // 7. Return count.
5033                                 return count;
5034                         },
5035                         set: undefined
5036                 });
5037         }
5038
5039         // 23.1.3.11. Map.prototype.values ( )
5040         CreateMethodProperty(Map.prototype, 'values', function values () {
5041                         // 1. Let M be the this value.
5042                         var M = this;
5043                         // 2. Return ? CreateMapIterator(M, "value").
5044                         return CreateMapIterator(M, 'value');
5045                 }
5046         );
5047
5048         // 23.1.3.12. Map.prototype [ @@iterator ] ( )
5049         // The initial value of the @@iterator property is the same function object as the initial value of the entries property.
5050         CreateMethodProperty(Map.prototype, Symbol.iterator, Map.prototype.entries);
5051
5052         // 23.1.3.13. Map.prototype [ @@toStringTag ]
5053         // The initial value of the @@toStringTag property is the String value "Map".
5054         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5055
5056         // Polyfill.io - Safari 8 implements Map.name but as a non-configurable property, which means it would throw an error if we try and configure it here.
5057         if (!('name' in Map)) {
5058                 // 19.2.4.2 name
5059                 Object.defineProperty(Map, 'name', {
5060                         configurable: true,
5061                         enumerable: false,
5062                         writable: false,
5063                         value: 'Map'
5064                 });
5065         }
5066
5067         // 23.1.5.1. CreateMapIterator ( map, kind )
5068         function CreateMapIterator(map, kind) {
5069                 // 1. If Type(map) is not Object, throw a TypeError exception.
5070                 if (Type(map) !== 'object') {
5071                         throw new TypeError('createMapIterator called on incompatible receiver ' + Object.prototype.toString.call(map));
5072                 }
5073                 // 2. If map does not have a [[MapData]] internal slot, throw a TypeError exception.
5074                 if (map._es6Map !== true) {
5075                         throw new TypeError('createMapIterator called on incompatible receiver ' + Object.prototype.toString.call(map));
5076                 }
5077                 // 3. Let iterator be ObjectCreate(%MapIteratorPrototype%, « [[Map]], [[MapNextIndex]], [[MapIterationKind]] »).
5078                 var iterator = Object.create(MapIteratorPrototype);
5079                 // 4. Set iterator.[[Map]] to map.
5080                 Object.defineProperty(iterator, '[[Map]]', {
5081                         configurable: true,
5082                         enumerable: false,
5083                         writable: true,
5084                         value: map
5085                 });
5086                 // 5. Set iterator.[[MapNextIndex]] to 0.
5087                 Object.defineProperty(iterator, '[[MapNextIndex]]', {
5088                         configurable: true,
5089                         enumerable: false,
5090                         writable: true,
5091                         value: 0
5092                 });
5093                 // 6. Set iterator.[[MapIterationKind]] to kind.
5094                 Object.defineProperty(iterator, '[[MapIterationKind]]', {
5095                         configurable: true,
5096                         enumerable: false,
5097                         writable: true,
5098                         value: kind
5099                 });
5100                 // 7. Return iterator.
5101                 return iterator;
5102         }
5103
5104         // 23.1.5.2. The %MapIteratorPrototype% Object
5105         var MapIteratorPrototype = {};
5106         // Polyfill.io - We use this as a quick way to check if an object is a Map Iterator instance.
5107         Object.defineProperty(MapIteratorPrototype, 'isMapIterator', {
5108                 configurable: false,
5109                 enumerable: false,
5110                 writable: false,
5111                 value: true
5112         });
5113
5114         // 23.1.5.2.1. %MapIteratorPrototype%.next ( )
5115         CreateMethodProperty(MapIteratorPrototype, 'next', function next() {
5116                         // 1. Let O be the this value.
5117                         var O = this;
5118                         // 2. If Type(O) is not Object, throw a TypeError exception.
5119                         if (Type(O) !== 'object') {
5120                                 throw new TypeError('Method %MapIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5121                         }
5122                         // 3. If O does not have all of the internal slots of a Map Iterator Instance (23.1.5.3), throw a TypeError exception.
5123                         if (!O.isMapIterator) {
5124                                 throw new TypeError('Method %MapIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5125                         }
5126                         // 4. Let m be O.[[Map]].
5127                         var m = O['[[Map]]'];
5128                         // 5. Let index be O.[[MapNextIndex]].
5129                         var index = O['[[MapNextIndex]]'];
5130                         // 6. Let itemKind be O.[[MapIterationKind]].
5131                         var itemKind = O['[[MapIterationKind]]'];
5132                         // 7. If m is undefined, return CreateIterResultObject(undefined, true).
5133                         if (m === undefined) {
5134                                 return CreateIterResultObject(undefined, true);
5135                         }
5136                         // 8. Assert: m has a [[MapData]] internal slot.
5137                         if (!m._es6Map) {
5138                                 throw new Error(Object.prototype.toString.call(m) + ' has a [[MapData]] internal slot.');
5139                         }
5140                         // 9. Let entries be the List that is m.[[MapData]].
5141                         var entries = m._keys;
5142                         // 10. Let numEntries be the number of elements of entries.
5143                         var numEntries = entries.length;
5144                         // 11. NOTE: numEntries must be redetermined each time this method is evaluated.
5145                         // 12. Repeat, while index is less than numEntries,
5146                         while (index < numEntries) {
5147                                 // a. Let e be the Record {[[Key]], [[Value]]} that is the value of entries[index].
5148                                 var e = Object.create(null);
5149                                 e['[[Key]]'] = m._keys[index];
5150                                 e['[[Value]]'] = m._values[index];
5151                                 // b. Set index to index+1.
5152                                 index = index + 1;
5153                                 // c. Set O.[[MapNextIndex]] to index.
5154                                 O['[[MapNextIndex]]'] = index;
5155                                 // d. If e.[[Key]] is not empty, then
5156                                 if (e['[[Key]]'] !== undefMarker) {
5157                                         // i. If itemKind is "key", let result be e.[[Key]].
5158                                         if (itemKind === 'key') {
5159                                                 var result = e['[[Key]]'];
5160                                                 // ii. Else if itemKind is "value", let result be e.[[Value]].
5161                                         } else if (itemKind === 'value') {
5162                                                 result = e['[[Value]]'];
5163                                                 // iii. Else,
5164                                         } else {
5165                                                 // 1. Assert: itemKind is "key+value".
5166                                                 if (itemKind !== 'key+value') {
5167                                                         throw new Error();
5168                                                 }
5169                                                 // 2. Let result be CreateArrayFromList(« e.[[Key]], e.[[Value]] »).
5170                                                 result = [
5171                                                         e['[[Key]]'],
5172                                                         e['[[Value]]']
5173                                                 ];
5174                                         }
5175                                         // iv. Return CreateIterResultObject(result, false).
5176                                         return CreateIterResultObject(result, false);
5177                                 }
5178                         }
5179                         // 13. Set O.[[Map]] to undefined.
5180                         O['[[Map]]'] = undefined;
5181                         // 14. Return CreateIterResultObject(undefined, true).
5182                         return CreateIterResultObject(undefined, true);
5183                 }
5184         );
5185
5186         // 23.1.5.2.2 %MapIteratorPrototype% [ @@toStringTag ]
5187         // The initial value of the @@toStringTag property is the String value "Map Iterator".
5188         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5189
5190         CreateMethodProperty(MapIteratorPrototype, Symbol.iterator, function iterator() {
5191                         return this;
5192                 }
5193         );
5194
5195         // Export the object
5196         try {
5197                 CreateMethodProperty(global, 'Map', Map);
5198         } catch (e) {
5199                 // IE8 throws an error here if we set enumerable to false.
5200                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
5201                 global['Map'] = Map;
5202         }
5203 }(this));
5204
5205 }
5206
5207 if (!("Set"in this&&function(){try{var t=new Set([1,2])
5208 return 0===Set.length&&2===t.size&&"Symbol"in this&&"iterator"in Symbol&&"function"==typeof t[Symbol.iterator]}catch(e){return!1}}()
5209 )) {
5210
5211 // Set
5212 /* global CreateIterResultObject, CreateMethodProperty, GetIterator, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Symbol */
5213 (function (global) {
5214         var supportsGetters = (function () {
5215                 try {
5216                         var a = {};
5217                         Object.defineProperty(a, 't', {
5218                                 configurable: true,
5219                                 enumerable: false,
5220                                 get: function () {
5221                                         return true;
5222                                 },
5223                                 set: undefined
5224                         });
5225                         return !!a.t;
5226                 } catch (e) {
5227                         return false;
5228                 }
5229         }());
5230
5231         // Deleted set items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
5232         var undefMarker = Symbol('undef');
5233         // 23.2.1.1. Set ( [ iterable ] )
5234         var Set = function Set(/* iterable */) {
5235                 // 1. If NewTarget is undefined, throw a TypeError exception.
5236                 if (!(this instanceof Set)) {
5237                         throw new TypeError('Constructor Set requires "new"');
5238                 }
5239                 // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, "%SetPrototype%", « [[SetData]] »).
5240                 var set = OrdinaryCreateFromConstructor(this, Set.prototype, {
5241                         _values: [],
5242                         _size: 0,
5243                         _es6Set: true
5244                 });
5245
5246                 // 3. Set set.[[SetData]] to a new empty List.
5247                 // Polyfill.io - This step was done as part of step two.
5248
5249                 // Some old engines do not support ES5 getters/setters.  Since Set only requires these for the size property, we can fall back to setting the size property statically each time the size of the set changes.
5250                 if (!supportsGetters) {
5251                         Object.defineProperty(set, 'size', {
5252                                 configurable: true,
5253                                 enumerable: false,
5254                                 writable: true,
5255                                 value: 0
5256                         });
5257                 }
5258
5259                 // 4. If iterable is not present, let iterable be undefined.
5260                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
5261
5262                 // 5. If iterable is either undefined or null, return set.
5263                 if (iterable === null || iterable === undefined) {
5264                         return set;
5265                 }
5266
5267                 // 6. Let adder be ? Get(set, "add").
5268                 var adder = set.add;
5269                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
5270                 if (!IsCallable(adder)) {
5271                         throw new TypeError("Set.prototype.add is not a function");
5272                 }
5273
5274                 try {
5275                         // 8. Let iteratorRecord be ? GetIterator(iterable).
5276                         var iteratorRecord = GetIterator(iterable);
5277                         // 9. Repeat,
5278                         while (true) {
5279                                 // a. Let next be ? IteratorStep(iteratorRecord).
5280                                 var next = IteratorStep(iteratorRecord);
5281                                 // b. If next is false, return set.
5282                                 if (next === false) {
5283                                         return set;
5284                                 }
5285                                 // c. Let nextValue be ? IteratorValue(next).
5286                                 var nextValue = IteratorValue(next);
5287                                 // d. Let status be Call(adder, set, « nextValue.[[Value]] »).
5288                                 try {
5289                                         adder.call(set, nextValue);
5290                                 } catch (e) {
5291                                         // e. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
5292                                         return IteratorClose(iteratorRecord, e);
5293                                 }
5294                         }
5295                 } catch (e) {
5296                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
5297                         if (Array.isArray(iterable) ||
5298                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
5299                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
5300                                 (!!iterable.callee)) {
5301                                 var index;
5302                                 var length = iterable.length;
5303                                 for (index = 0; index < length; index++) {
5304                                         adder.call(set, iterable[index]);
5305                                 }
5306                         } else {
5307                                 throw (e);
5308                         }
5309                 }
5310                 return set;
5311         };
5312
5313         // 23.2.2.1. Set.prototype
5314         // The initial value of Set.prototype is the intrinsic %SetPrototype% object.
5315         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
5316         Object.defineProperty(Set, 'prototype', {
5317                 configurable: false,
5318                 enumerable: false,
5319                 writable: false,
5320                 value: {}
5321         });
5322
5323         // 23.2.2.2 get Set [ @@species ]
5324         if (supportsGetters) {
5325                 Object.defineProperty(Set, Symbol.species, {
5326                         configurable: true,
5327                         enumerable: false,
5328                         get: function () {
5329                                 // 1. Return the this value.
5330                                 return this;
5331                         },
5332                         set: undefined
5333                 });
5334         } else {
5335                 CreateMethodProperty(Set, Symbol.species, Set);
5336         }
5337
5338         // 23.2.3.1. Set.prototype.add ( value )
5339         CreateMethodProperty(Set.prototype, 'add', function add(value) {
5340                         // 1. Let S be the this value.
5341                         var S = this;
5342                         // 2. If Type(S) is not Object, throw a TypeError exception.
5343                         if (typeof S !== 'object') {
5344                                 throw new TypeError('Method Set.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
5345                         }
5346                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5347                         if (S._es6Set !== true) {
5348                                 throw new TypeError('Method Set.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
5349                         }
5350                         // 4. Let entries be the List that is S.[[SetData]].
5351                         var entries = S._values;
5352                         // 5. For each e that is an element of entries, do
5353                         for (var i = 0; i < entries.length; i++) {
5354                                 var e = entries[i];
5355                                 // a. If e is not empty and SameValueZero(e, value) is true, then
5356                                 if (e !== undefMarker && SameValueZero(e, value)) {
5357                                         // i. Return S.
5358                                         return S;
5359                                 }
5360                         }
5361                         // 6. If value is -0, let value be +0.
5362                         if (1/value === -Infinity) {
5363                                 value = 0;
5364                         }
5365                         // 7. Append value as the last element of entries.
5366                         S._values.push(value);
5367
5368                         this._size = ++this._size;
5369                         if (!supportsGetters) {
5370                                 this.size = this._size;
5371                         }
5372                         // 8. Return S.
5373                         return S;
5374                 });
5375
5376         // 23.2.3.2. Set.prototype.clear ( )
5377         CreateMethodProperty(Set.prototype, 'clear', function clear() {
5378                         // 1. Let S be the this value.
5379                         var S = this;
5380                         // 2. If Type(S) is not Object, throw a TypeError exception.
5381                         if (typeof S !== 'object') {
5382                                 throw new TypeError('Method Set.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(S));
5383                         }
5384                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5385                         if (S._es6Set !== true) {
5386                                 throw new TypeError('Method Set.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(S));
5387                         }
5388                         // 4. Let entries be the List that is S.[[SetData]].
5389                         var entries = S._values;
5390                         // 5. For each e that is an element of entries, do
5391                         for (var i = 0; i < entries.length; i++) {
5392                                 // a. Replace the element of entries whose value is e with an element whose value is empty.
5393                                 entries[i] = undefMarker;
5394                         }
5395                         this._size = 0;
5396                         if (!supportsGetters) {
5397                                 this.size = this._size;
5398                         }
5399                         // 6. Return undefined.
5400                         return undefined;
5401                 });
5402
5403         // 23.2.3.3. Set.prototype.constructor
5404         CreateMethodProperty(Set.prototype, 'constructor', Set);
5405
5406         // 23.2.3.4. Set.prototype.delete ( value )
5407         CreateMethodProperty(Set.prototype, 'delete', function (value) {
5408                         // 1. Let S be the this value.
5409                         var S = this;
5410                         // 2. If Type(S) is not Object, throw a TypeError exception.
5411                         if (typeof S !== 'object') {
5412                                 throw new TypeError('Method Set.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
5413                         }
5414                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5415                         if (S._es6Set !== true) {
5416                                 throw new TypeError('Method Set.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
5417                         }
5418                         // 4. Let entries be the List that is S.[[SetData]].
5419                         var entries = S._values;
5420                         // 5. For each e that is an element of entries, do
5421                         for (var i = 0; i < entries.length; i++) {
5422                                 var e = entries[i];
5423                                 // a. If e is not empty and SameValueZero(e, value) is true, then
5424                                 if (e !== undefMarker && SameValueZero(e, value)) {
5425                                         // i. Replace the element of entries whose value is e with an element whose value is empty.
5426                                         entries[i] = undefMarker;
5427
5428                                         this._size = --this._size;
5429                                         if (!supportsGetters) {
5430                                                 this.size = this._size;
5431                                         }
5432                                         // ii. Return true.
5433                                         return true;
5434                                 }
5435                         }
5436                         // 6. Return false.
5437                         return false;
5438                 }
5439         );
5440
5441         // 23.2.3.5. Set.prototype.entries ( )
5442         CreateMethodProperty(Set.prototype, 'entries', function entries() {
5443                         // 1. Let S be the this value.
5444                         var S = this;
5445                         // 2. Return ? CreateSetIterator(S, "key+value").
5446                         return CreateSetIterator(S, 'key+value');
5447                 }
5448         );
5449
5450         // 23.2.3.6. Set.prototype.forEach ( callbackfn [ , thisArg ] )
5451         CreateMethodProperty(Set.prototype, 'forEach', function forEach(callbackFn /*[ , thisArg ]*/) {
5452                         // 1. Let S be the this value.
5453                         var S = this;
5454                         // 2. If Type(S) is not Object, throw a TypeError exception.
5455                         if (typeof S !== 'object') {
5456                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5457                         }
5458                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5459                         if (S._es6Set !== true) {
5460                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5461                         }
5462                         // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
5463                         if (!IsCallable(callbackFn)) {
5464                                 throw new TypeError(Object.prototype.toString.call(callbackFn) + ' is not a function.');
5465                         }
5466                         // 5. If thisArg is present, let T be thisArg; else let T be undefined.
5467                         if (arguments[1]) {
5468                                 var T = arguments[1];
5469                         }
5470                         // 6. Let entries be the List that is S.[[SetData]].
5471                         var entries = S._values;
5472                         // 7. For each e that is an element of entries, in original insertion order, do
5473                         for (var i = 0; i < entries.length; i++) {
5474                                 var e = entries[i];
5475                                 // a. If e is not empty, then
5476                                 if (e !== undefMarker) {
5477                                         // i. Perform ? Call(callbackfn, T, « e, e, S »).
5478                                         callbackFn.call(T, e, e, S);
5479                                 }
5480                         }
5481                         // 8. Return undefined.
5482                         return undefined;
5483                 }
5484         );
5485
5486         // 23.2.3.7. Set.prototype.has ( value )
5487         CreateMethodProperty(Set.prototype, 'has', function has(value) {
5488                         // 1. Let S be the this value.
5489                         var S = this;
5490                         // 2. If Type(S) is not Object, throw a TypeError exception.
5491                         if (typeof S !== 'object') {
5492                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5493                         }
5494                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5495                         if (S._es6Set !== true) {
5496                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5497                         }
5498                         // 4. Let entries be the List that is S.[[SetData]].
5499                         var entries = S._values;
5500                         // 5. For each e that is an element of entries, do
5501                         for (var i = 0; i < entries.length; i++) {
5502                                 var e = entries[i];
5503                                 // a. If e is not empty and SameValueZero(e, value) is true, return true.
5504                                 if (e !== undefMarker && SameValueZero(e, value)) {
5505                                         return true;
5506                                 }
5507                         }
5508                         // 6. Return false.
5509                         return false;
5510                 }
5511         );
5512
5513         // Polyfill.io - We need to define Set.prototype.values before Set.prototype.keys because keys is a reference to values.
5514         // 23.2.3.10. Set.prototype.values()
5515         var values = function values() {
5516                 // 1. Let S be the this value.
5517                 var S = this;
5518                 // 2. Return ? CreateSetIterator(S, "value").
5519                 return CreateSetIterator(S, "value");
5520         };
5521         CreateMethodProperty(Set.prototype, 'values', values);
5522
5523         // 23.2.3.8 Set.prototype.keys ( )
5524         // The initial value of the keys property is the same function object as the initial value of the values property.
5525         CreateMethodProperty(Set.prototype, 'keys', values);
5526
5527         // 23.2.3.9. get Set.prototype.size
5528         if (supportsGetters) {
5529                 Object.defineProperty(Set.prototype, 'size', {
5530                         configurable: true,
5531                         enumerable: false,
5532                         get: function () {
5533                                 // 1. Let S be the this value.
5534                                 var S = this;
5535                                 // 2. If Type(S) is not Object, throw a TypeError exception.
5536                                 if (typeof S !== 'object') {
5537                                         throw new TypeError('Method Set.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(S));
5538                                 }
5539                                 // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5540                                 if (S._es6Set !== true) {
5541                                         throw new TypeError('Method Set.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(S));
5542                                 }
5543                                 // 4. Let entries be the List that is S.[[SetData]].
5544                                 var entries = S._values;
5545                                 // 5. Let count be 0.
5546                                 var count = 0;
5547                                 // 6. For each e that is an element of entries, do
5548                                 for (var i = 0; i < entries.length; i++) {
5549                                         var e = entries[i];
5550                                         // a. If e is not empty, set count to count+1.
5551                                         if (e !== undefMarker) {
5552                                                 count = count + 1;
5553                                         }
5554                                 }
5555                                 // 7. Return count.
5556                                 return count;
5557                         },
5558                         set: undefined
5559                 });
5560         }
5561
5562         // 23.2.3.11. Set.prototype [ @@iterator ] ( )
5563         // The initial value of the @@iterator property is the same function object as the initial value of the values property.
5564         CreateMethodProperty(Set.prototype, Symbol.iterator, values);
5565
5566         // 23.2.3.12. Set.prototype [ @@toStringTag ]
5567         // The initial value of the @@toStringTag property is the String value "Set".
5568         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5569
5570         // Polyfill.io - Safari 8 implements Set.name but as a non-configurable property, which means it would throw an error if we try and configure it here.
5571         if (!('name' in Set)) {
5572                 // 19.2.4.2 name
5573                 Object.defineProperty(Set, 'name', {
5574                         configurable: true,
5575                         enumerable: false,
5576                         writable: false,
5577                         value: 'Set'
5578                 });
5579         }
5580
5581         // 23.2.5.1. CreateSetIterator ( set, kind )
5582         function CreateSetIterator(set, kind) {
5583                 // 1. If Type(set) is not Object, throw a TypeError exception.
5584                 if (typeof set !== 'object') {
5585                         throw new TypeError('createSetIterator called on incompatible receiver ' + Object.prototype.toString.call(set));
5586                 }
5587                 // 2. If set does not have a [[SetData]] internal slot, throw a TypeError exception.
5588                 if (set._es6Set !== true) {
5589                         throw new TypeError('createSetIterator called on incompatible receiver ' + Object.prototype.toString.call(set));
5590                 }
5591                 // 3. Let iterator be ObjectCreate(%SetIteratorPrototype%, « [[IteratedSet]], [[SetNextIndex]], [[SetIterationKind]] »).
5592                 var iterator = Object.create(SetIteratorPrototype);
5593                 // 4. Set iterator.[[IteratedSet]] to set.
5594                 Object.defineProperty(iterator, '[[IteratedSet]]', {
5595                         configurable: true,
5596                         enumerable: false,
5597                         writable: true,
5598                         value: set
5599                 });
5600                 // 5. Set iterator.[[SetNextIndex]] to 0.
5601                 Object.defineProperty(iterator, '[[SetNextIndex]]', {
5602                         configurable: true,
5603                         enumerable: false,
5604                         writable: true,
5605                         value: 0
5606                 });
5607                 // 6. Set iterator.[[SetIterationKind]] to kind.
5608                 Object.defineProperty(iterator, '[[SetIterationKind]]', {
5609                         configurable: true,
5610                         enumerable: false,
5611                         writable: true,
5612                         value: kind
5613                 });
5614                 // 7. Return iterator.
5615                 return iterator;
5616         }
5617
5618         // 23.2.5.2. The %SetIteratorPrototype% Object
5619         var SetIteratorPrototype = {};
5620         //Polyfill.io - We add this property to help us identify what is a set iterator.
5621         Object.defineProperty(SetIteratorPrototype, 'isSetIterator', {
5622                 configurable: false,
5623                 enumerable: false,
5624                 writable: false,
5625                 value: true
5626         });
5627
5628         // 23.2.5.2.1. %SetIteratorPrototype%.next ( )
5629         CreateMethodProperty(SetIteratorPrototype, 'next', function next() {
5630                 // 1. Let O be the this value.
5631                 var O = this;
5632                 // 2. If Type(O) is not Object, throw a TypeError exception.
5633                 if (typeof O !== 'object') {
5634                         throw new TypeError('Method %SetIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5635                 }
5636                 // 3. If O does not have all of the internal slots of a Set Iterator Instance (23.2.5.3), throw a TypeError exception.
5637                 if (!O.isSetIterator) {
5638                         throw new TypeError('Method %SetIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5639                 }
5640                 // 4. Let s be O.[[IteratedSet]].
5641                 var s = O['[[IteratedSet]]'];
5642                 // 5. Let index be O.[[SetNextIndex]].
5643                 var index = O['[[SetNextIndex]]'];
5644                 // 6. Let itemKind be O.[[SetIterationKind]].
5645                 var itemKind = O['[[SetIterationKind]]'];
5646                 // 7. If s is undefined, return CreateIterResultObject(undefined, true).
5647                 if (s === undefined) {
5648                         return CreateIterResultObject(undefined, true);
5649                 }
5650                 // 8. Assert: s has a [[SetData]] internal slot.
5651                 if (!s._es6Set) {
5652                         throw new Error(Object.prototype.toString.call(s) + ' does not have [[SetData]] internal slot.');
5653                 }
5654                 // 9. Let entries be the List that is s.[[SetData]].
5655                 var entries = s._values;
5656                 // 10. Let numEntries be the number of elements of entries.
5657                 var numEntries = entries.length;
5658                 // 11. NOTE: numEntries must be redetermined each time this method is evaluated.
5659                 // 12. Repeat, while index is less than numEntries,
5660                 while (index < numEntries) {
5661                         // a. Let e be entries[index].
5662                         var e = entries[index];
5663                         // b. Set index to index+1.
5664                         index = index + 1;
5665                         // c. Set O.[[SetNextIndex]] to index.
5666                         O['[[SetNextIndex]]'] = index;
5667                         // d. If e is not empty, then
5668                         if (e !== undefMarker) {
5669                                 // i. If itemKind is "key+value", then
5670                                 if (itemKind === 'key+value') {
5671                                         // 1. Return CreateIterResultObject(CreateArrayFromList(« e, e »), false).
5672                                         return CreateIterResultObject([e, e], false);
5673                                 }
5674                                 // ii. Return CreateIterResultObject(e, false).
5675                                 return CreateIterResultObject(e, false);
5676                         }
5677                 }
5678                 // 13. Set O.[[IteratedSet]] to undefined.
5679                 O['[[IteratedSet]]'] = undefined;
5680                 // 14. Return CreateIterResultObject(undefined, true).
5681                 return CreateIterResultObject(undefined, true);
5682         });
5683
5684         // 23.2.5.2.2. %SetIteratorPrototype% [ @@toStringTag ]
5685         // The initial value of the @@toStringTag property is the String value "Set Iterator".
5686         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5687
5688         CreateMethodProperty(SetIteratorPrototype, Symbol.iterator, function iterator() {
5689                         return this;
5690                 }
5691         );
5692
5693         // Export the object
5694         try {
5695                 CreateMethodProperty(global, 'Set', Set);
5696         } catch (e) {
5697                 // IE8 throws an error here if we set enumerable to false.
5698                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
5699                 global['Set'] = Set;
5700         }
5701
5702 }(this));
5703
5704 }
5705
5706 if (!("from"in Array&&function(){try{return Array.from({length:-Infinity}),!0}catch(r){return!1}}()
5707 )) {
5708
5709 // Array.from
5710 /* globals
5711         IsCallable, GetMethod, Symbol, IsConstructor, Construct, ArrayCreate, GetIterator, IteratorClose,
5712         ToString, IteratorStep, IteratorValue, Call, CreateDataPropertyOrThrow, ToObject, ToLength, Get, CreateMethodProperty
5713 */
5714 (function () {
5715         var toString = Object.prototype.toString;
5716         var stringMatch = String.prototype.match;
5717         // A cross-realm friendly way to detect if a value is a String object or literal.
5718         function isString(value) {
5719                 if (typeof value === 'string') { return true; }
5720                 if (typeof value !== 'object') { return false; }
5721                 return toString.call(value) === '[object String]';
5722         }
5723
5724         // 22.1.2.1. Array.from ( items [ , mapfn [ , thisArg ] ] )
5725         CreateMethodProperty(Array, 'from', function from(items /* [ , mapfn [ , thisArg ] ] */) { // eslint-disable-line no-undef
5726                 // 1. Let C be the this value.
5727                 var C = this;
5728                 // 2. If mapfn is undefined, let mapping be false.
5729                 var mapfn = arguments.length > 1 ? arguments[1] : undefined;
5730                 if (mapfn === undefined) {
5731                         var mapping = false;
5732                         // 3. Else,
5733                 } else {
5734                         // a. If IsCallable(mapfn) is false, throw a TypeError exception.
5735                         if (IsCallable(mapfn) === false) {
5736                                 throw new TypeError(Object.prototype.toString.call(mapfn) + ' is not a function.');
5737                         }
5738                         // b. If thisArg is present, let T be thisArg; else let T be undefined.
5739                         var thisArg = arguments.length > 2 ? arguments[2] : undefined;
5740                         if (thisArg !== undefined) {
5741                                 var T = thisArg;
5742                         } else {
5743                                 T = undefined;
5744                         }
5745                         // c. Let mapping be true.
5746                         mapping = true;
5747
5748                 }
5749                 // 4. Let usingIterator be ? GetMethod(items, @@iterator).
5750                 var usingIterator = GetMethod(items, Symbol.iterator);
5751                 // 5. If usingIterator is not undefined, then
5752                 if (usingIterator !== undefined) {
5753                         // a. If IsConstructor(C) is true, then
5754                         if (IsConstructor(C)) {
5755                                 // i. Let A be ? Construct(C).
5756                                 var A = Construct(C);
5757                                 // b. Else,
5758                         } else {
5759                                 // i. Let A be ! ArrayCreate(0).
5760                                 A = ArrayCreate(0);
5761                         }
5762                         // c. Let iteratorRecord be ? GetIterator(items, usingIterator).
5763                         var iteratorRecord = GetIterator(items, usingIterator);
5764                         // d. Let k be 0.
5765                         var k = 0;
5766                         // e. Repeat,
5767                         while (true) {
5768                                 // i. If k ≥ 2^53-1, then
5769                                 if (k >= (Math.pow(2, 53) - 1)) {
5770                                         // 1. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
5771                                         var error = new TypeError('Iteration count can not be greater than or equal 9007199254740991.');
5772                                         // 2. Return ? IteratorClose(iteratorRecord, error).
5773                                         return IteratorClose(iteratorRecord, error);
5774                                 }
5775                                 // ii. Let Pk be ! ToString(k).
5776                                 var Pk = ToString(k);
5777                                 // iii. Let next be ? IteratorStep(iteratorRecord).
5778                                 var next = IteratorStep(iteratorRecord);
5779                                 // iv. If next is false, then
5780                                 if (next === false) {
5781                                         // 1. Perform ? Set(A, "length", k, true).
5782                                         A["length"] = k;
5783                                         // 2. Return A.
5784                                         return A;
5785                                 }
5786                                 // v. Let nextValue be ? IteratorValue(next).
5787                                 var nextValue = IteratorValue(next);
5788                                 // vi. If mapping is true, then
5789                                 if (mapping) {
5790                                         try {
5791                                                 // Polyfill.io - The try catch accounts for step 2.
5792                                                 // 1. Let mappedValue be Call(mapfn, T, « nextValue, k »).
5793                                                 var mappedValue = Call(mapfn, T, [nextValue, k]);
5794                                                 // 2. If mappedValue is an abrupt completion, return ? IteratorClose(iteratorRecord, mappedValue).
5795                                                 // 3. Let mappedValue be mappedValue.[[Value]].
5796                                         } catch (e) {
5797                                                 return IteratorClose(iteratorRecord, e);
5798                                         }
5799
5800                                         // vii. Else, let mappedValue be nextValue.
5801                                 } else {
5802                                         mappedValue = nextValue;
5803                                 }
5804                                 try {
5805                                         // Polyfill.io - The try catch accounts for step ix.
5806                                         // viii. Let defineStatus be CreateDataPropertyOrThrow(A, Pk, mappedValue).
5807                                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
5808                                         // ix. If defineStatus is an abrupt completion, return ? IteratorClose(iteratorRecord, defineStatus).
5809                                 } catch (e) {
5810                                         return IteratorClose(iteratorRecord, e);
5811                                 }
5812                                 // x. Increase k by 1.
5813                                 k = k + 1;
5814                         }
5815                 }
5816                 // 6. NOTE: items is not an Iterable so assume it is an array-like object.
5817                 // 7. Let arrayLike be ! ToObject(items).
5818                 // Polyfill.io - For Strings we need to split astral symbols into surrogate pairs.
5819                 if (isString(items)) {
5820                         var arrayLike = stringMatch.call(items, /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g) || [];
5821                 } else {
5822                         arrayLike = ToObject(items);
5823                 }
5824                 // 8. Let len be ? ToLength(? Get(arrayLike, "length")).
5825                 var len = ToLength(Get(arrayLike, "length"));
5826                 // 9. If IsConstructor(C) is true, then
5827                 if (IsConstructor(C)) {
5828                         // a. Let A be ? Construct(C, « len »).
5829                         A = Construct(C, [len]);
5830                         // 10. Else,
5831                 } else {
5832                         // a. Let A be ? ArrayCreate(len).
5833                         A = ArrayCreate(len);
5834                 }
5835                 // 11. Let k be 0.
5836                 k = 0;
5837                 // 12. Repeat, while k < len
5838                 while (k < len) {
5839                         // a. Let Pk be ! ToString(k).
5840                         Pk = ToString(k);
5841                         // b. Let kValue be ? Get(arrayLike, Pk).
5842                         var kValue = Get(arrayLike, Pk);
5843                         // c. If mapping is true, then
5844                         if (mapping === true) {
5845                                 // i. Let mappedValue be ? Call(mapfn, T, « kValue, k »).
5846                                 mappedValue = Call(mapfn, T, [kValue, k]);
5847                                 // d. Else, let mappedValue be kValue.
5848                         } else {
5849                                 mappedValue = kValue;
5850                         }
5851                         // e. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
5852                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
5853                         // f. Increase k by 1.
5854                         k = k + 1;
5855                 }
5856                 // 13. Perform ? Set(A, "length", len, true).
5857                 A["length"] = len;
5858                 // 14. Return A.
5859                 return A;
5860         });
5861 }());
5862
5863 }
5864
5865 if (!("Symbol"in this&&"split"in this.Symbol
5866 )) {
5867
5868 // Symbol.split
5869 /* global Symbol */
5870 Object.defineProperty(Symbol, 'split', { value: Symbol('split') });
5871
5872 }
5873
5874 if (!("Symbol"in this&&"toPrimitive"in this.Symbol
5875 )) {
5876
5877 // Symbol.toPrimitive
5878 /* global Symbol */
5879 Object.defineProperty(Symbol, 'toPrimitive', { value: Symbol('toPrimitive') });
5880
5881 }
5882
5883 if (!("Symbol"in this&&"toStringTag"in this.Symbol
5884 )) {
5885
5886 // Symbol.toStringTag
5887 /* global Symbol */
5888 Object.defineProperty(Symbol, 'toStringTag', {
5889         value: Symbol('toStringTag')
5890 });
5891
5892 }
5893
5894
5895 // _Iterator
5896 /* global Symbol */
5897 // A modification of https://github.com/medikoo/es6-iterator
5898 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
5899
5900 var Iterator = (function () { // eslint-disable-line no-unused-vars
5901         var clear = function () {
5902                 this.length = 0;
5903                 return this;
5904         };
5905         var callable = function (fn) {
5906                 if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
5907                 return fn;
5908         };
5909
5910         var Iterator = function (list, context) {
5911                 if (!(this instanceof Iterator)) {
5912                         return new Iterator(list, context);
5913                 }
5914                 Object.defineProperties(this, {
5915                         __list__: {
5916                                 writable: true,
5917                                 value: list
5918                         },
5919                         __context__: {
5920                                 writable: true,
5921                                 value: context
5922                         },
5923                         __nextIndex__: {
5924                                 writable: true,
5925                                 value: 0
5926                         }
5927                 });
5928                 if (!context) return;
5929                 callable(context.on);
5930                 context.on('_add', this._onAdd.bind(this));
5931                 context.on('_delete', this._onDelete.bind(this));
5932                 context.on('_clear', this._onClear.bind(this));
5933         };
5934
5935         Object.defineProperties(Iterator.prototype, Object.assign({
5936                 constructor: {
5937                         value: Iterator,
5938                         configurable: true,
5939                         enumerable: false,
5940                         writable: true
5941                 },
5942                 _next: {
5943                         value: function () {
5944                                 var i;
5945                                 if (!this.__list__) return;
5946                                 if (this.__redo__) {
5947                                         i = this.__redo__.shift();
5948                                         if (i !== undefined) return i;
5949                                 }
5950                                 if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;
5951                                 this._unBind();
5952                         },
5953                         configurable: true,
5954                         enumerable: false,
5955                         writable: true
5956                 },
5957                 next: {
5958                         value: function () {
5959                                 return this._createResult(this._next());
5960                         },
5961                         configurable: true,
5962                         enumerable: false,
5963                         writable: true
5964                 },
5965                 _createResult: {
5966                         value: function (i) {
5967                                 if (i === undefined) return {
5968                                         done: true,
5969                                         value: undefined
5970                                 };
5971                                 return {
5972                                         done: false,
5973                                         value: this._resolve(i)
5974                                 };
5975                         },
5976                         configurable: true,
5977                         enumerable: false,
5978                         writable: true
5979                 },
5980                 _resolve: {
5981                         value: function (i) {
5982                                 return this.__list__[i];
5983                         },
5984                         configurable: true,
5985                         enumerable: false,
5986                         writable: true
5987                 },
5988                 _unBind: {
5989                         value: function () {
5990                                 this.__list__ = null;
5991                                 delete this.__redo__;
5992                                 if (!this.__context__) return;
5993                                 this.__context__.off('_add', this._onAdd.bind(this));
5994                                 this.__context__.off('_delete', this._onDelete.bind(this));
5995                                 this.__context__.off('_clear', this._onClear.bind(this));
5996                                 this.__context__ = null;
5997                         },
5998                         configurable: true,
5999                         enumerable: false,
6000                         writable: true
6001                 },
6002                 toString: {
6003                         value: function () {
6004                                 return '[object Iterator]';
6005                         },
6006                         configurable: true,
6007                         enumerable: false,
6008                         writable: true
6009                 }
6010         }, {
6011                 _onAdd: {
6012                         value: function (index) {
6013                                 if (index >= this.__nextIndex__) return;
6014                                 ++this.__nextIndex__;
6015                                 if (!this.__redo__) {
6016                                         Object.defineProperty(this, '__redo__', {
6017                                                 value: [index],
6018                                                 configurable: true,
6019                                                 enumerable: false,
6020                                                 writable: false
6021                                         });
6022                                         return;
6023                                 }
6024                                 this.__redo__.forEach(function (redo, i) {
6025                                         if (redo >= index) this.__redo__[i] = ++redo;
6026                                 }, this);
6027                                 this.__redo__.push(index);
6028                         },
6029                         configurable: true,
6030                         enumerable: false,
6031                         writable: true
6032                 },
6033                 _onDelete: {
6034                         value: function (index) {
6035                                 var i;
6036                                 if (index >= this.__nextIndex__) return;
6037                                 --this.__nextIndex__;
6038                                 if (!this.__redo__) return;
6039                                 i = this.__redo__.indexOf(index);
6040                                 if (i !== -1) this.__redo__.splice(i, 1);
6041                                 this.__redo__.forEach(function (redo, i) {
6042                                         if (redo > index) this.__redo__[i] = --redo;
6043                                 }, this);
6044                         },
6045                         configurable: true,
6046                         enumerable: false,
6047                         writable: true
6048                 },
6049                 _onClear: {
6050                         value: function () {
6051                                 if (this.__redo__) clear.call(this.__redo__);
6052                                 this.__nextIndex__ = 0;
6053                         },
6054                         configurable: true,
6055                         enumerable: false,
6056                         writable: true
6057                 }
6058         }));
6059
6060         Object.defineProperty(Iterator.prototype, Symbol.iterator, {
6061                 value: function () {
6062                         return this;
6063                 },
6064                 configurable: true,
6065                 enumerable: false,
6066                 writable: true
6067         });
6068         Object.defineProperty(Iterator.prototype, Symbol.toStringTag, {
6069                 value: 'Iterator',
6070                 configurable: false,
6071                 enumerable: false,
6072                 writable: true
6073         });
6074
6075         return Iterator;
6076 }());
6077
6078 // _ArrayIterator
6079 /* global Iterator */
6080 // A modification of https://github.com/medikoo/es6-iterator
6081 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
6082
6083 var ArrayIterator = (function() { // eslint-disable-line no-unused-vars
6084
6085         var ArrayIterator = function(arr, kind) {
6086                 if (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind);
6087                 Iterator.call(this, arr);
6088                 if (!kind) kind = 'value';
6089                 else if (String.prototype.includes.call(kind, 'key+value')) kind = 'key+value';
6090                 else if (String.prototype.includes.call(kind, 'key')) kind = 'key';
6091                 else kind = 'value';
6092                 Object.defineProperty(this, '__kind__', {
6093                         value: kind,
6094                         configurable: false,
6095                         enumerable: false,
6096                         writable: false
6097                 });
6098         };
6099         if (Object.setPrototypeOf) Object.setPrototypeOf(ArrayIterator, Iterator.prototype);
6100
6101         ArrayIterator.prototype = Object.create(Iterator.prototype, {
6102                 constructor: {
6103                         value: ArrayIterator,
6104                         configurable: true,
6105                         enumerable: false,
6106                         writable: true
6107                 },
6108                 _resolve: {
6109                         value: function(i) {
6110                                 if (this.__kind__ === 'value') return this.__list__[i];
6111                                 if (this.__kind__ === 'key+value') return [i, this.__list__[i]];
6112                                 return i;
6113                         },
6114                         configurable: true,
6115                         enumerable: false,
6116                         writable: true
6117                 },
6118                 toString: {
6119                         value: function() {
6120                                 return '[object Array Iterator]';
6121                         },
6122                         configurable: true,
6123                         enumerable: false,
6124                         writable: true
6125                 }
6126         });
6127
6128         return ArrayIterator;
6129 }());
6130 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype.entries
6131 )) {
6132
6133 // Array.prototype.entries
6134 /* global CreateMethodProperty, ToObject */
6135 // 22.1.3.4. Array.prototype.entries ( )
6136 CreateMethodProperty(Array.prototype, 'entries', function entries() {
6137         // 1. Let O be ? ToObject(this value).
6138         var O = ToObject(this);
6139         // 2. Return CreateArrayIterator(O, "key+value").
6140         // TODO: Add CreateArrayIterator
6141         return new ArrayIterator(O, 'key+value');
6142 });
6143
6144 }
6145
6146 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype.keys
6147 )) {
6148
6149 // Array.prototype.keys
6150 /* global CreateMethodProperty, ToObject */
6151 // 22.1.3.14. Array.prototype.keys ( )
6152 CreateMethodProperty(Array.prototype, 'keys', function keys() {
6153         // 1. Let O be ? ToObject(this value).
6154         var O = ToObject(this);
6155         // 2. Return CreateArrayIterator(O, "key").
6156         // TODO: Add CreateArrayIterator.
6157         return new ArrayIterator(O, 'key');
6158 });
6159
6160 }
6161
6162 if (!("values"in Array.prototype
6163 )) {
6164
6165 // Array.prototype.values
6166 /* global CreateMethodProperty, Symbol, ToObject */
6167 // 22.1.3.30/ Array.prototype.values ( )
6168 // Polyfill.io - Firefox, Chrome and Opera have Array.prototype[Symbol.iterator], which is the exact same function as Array.prototype.values.
6169 if ('Symbol' in this && 'iterator' in Symbol && typeof Array.prototype[Symbol.iterator] === 'function') {
6170         CreateMethodProperty(Array.prototype, 'values', Array.prototype[Symbol.iterator]);
6171 } else {
6172         CreateMethodProperty(Array.prototype, 'values', function values () {
6173                 // 1. Let O be ? ToObject(this value).
6174                 var O = ToObject(this);
6175                 // 2. Return CreateArrayIterator(O, "value").
6176                 // TODO: Add CreateArrayIterator
6177                 return new ArrayIterator(O, 'value');
6178         });
6179 }
6180
6181 }
6182
6183 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype[Symbol.iterator]
6184 )) {
6185
6186 // Array.prototype.@@iterator
6187 /* global Symbol, CreateMethodProperty */
6188 // 22.1.3.31. Array.prototype [ @@iterator ] ( )
6189 // The initial value of the @@iterator property is the same function object as the initial value of the  Array.prototype.values property.
6190 CreateMethodProperty(Array.prototype, Symbol.iterator, Array.prototype.values);
6191
6192 }
6193
6194
6195 // _StringIterator
6196 // A modification of https://github.com/medikoo/es6-iterator
6197 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
6198
6199 /* global Iterator */
6200
6201 var StringIterator = (function() { // eslint-disable-line no-unused-vars
6202
6203         var StringIterator = function (str) {
6204                 if (!(this instanceof StringIterator)) return new StringIterator(str);
6205                 str = String(str);
6206                 Iterator.call(this, str);
6207                 Object.defineProperty(this, '__length__', {
6208                         value: str.length,
6209                         configurable: false,
6210                         enumerable: false,
6211                         writable: false
6212                 });
6213         };
6214         if (Object.setPrototypeOf) Object.setPrototypeOf(StringIterator, Iterator);
6215
6216         StringIterator.prototype = Object.create(Iterator.prototype, {
6217                 constructor: {
6218                         value: StringIterator,
6219                         configurable: true,
6220                         enumerable: false,
6221                         writable: true
6222                 },
6223                 _next: {
6224                         value: function() {
6225                                 if (!this.__list__) return;
6226                                 if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
6227                                 this._unBind();
6228                         },
6229                         configurable: true,
6230                         enumerable: false,
6231                         writable: true
6232                 },
6233                 _resolve: {
6234                         value: function (i) {
6235                                 var char = this.__list__[i], code;
6236                                 if (this.__nextIndex__ === this.__length__) return char;
6237                                 code = char.charCodeAt(0);
6238                                 if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++];
6239                                 return char;
6240                         },
6241                         configurable: true,
6242                         enumerable: false,
6243                         writable: true
6244                 },
6245                 toString: {
6246                         value: function() {
6247                                 return '[object String Iterator]';
6248                         },
6249                         configurable: true,
6250                         enumerable: false,
6251                         writable: true
6252                 }
6253         });
6254
6255         return StringIterator;
6256 }());
6257 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!String.prototype[Symbol.iterator]
6258 )) {
6259
6260 // String.prototype.@@iterator
6261 /* global CreateMethodProperty, RequireObjectCoercible, ToString, StringIterator, Symbol */
6262 // 21.1.3.29. String.prototype [ @@iterator ] ( )
6263 CreateMethodProperty(String.prototype, Symbol.iterator, function () {
6264         // 1. Let O be ? RequireObjectCoercible(this value).
6265         var O = RequireObjectCoercible(this);
6266         // 2. Let S be ? ToString(O).
6267         var S = ToString(O);
6268         // 3. Return CreateStringIterator(S).
6269         // TODO: Add CreateStringIterator.
6270         return new StringIterator(S);
6271 });
6272
6273 }
6274
6275 if (!("Symbol"in this&&"unscopables"in this.Symbol
6276 )) {
6277
6278 // Symbol.unscopables
6279 /* global Symbol */
6280 Object.defineProperty(Symbol, 'unscopables', { value: Symbol('unscopables') });
6281
6282 }
6283
6284 if (!((function(e){try{if("WeakMap"in e&&0===WeakMap.length){var t={},a=new WeakMap([[t,"test"]])
6285 return"test"===a.get(t)&&!1===a["delete"](0)}return!1}catch(n){return!1}})(this)
6286 )) {
6287
6288 // WeakMap
6289 /* globals Symbol, OrdinaryCreateFromConstructor, IsCallable, GetIterator, IteratorStep, IteratorValue, IteratorClose, Get, Call, CreateMethodProperty, Type, SameValue */
6290 (function (global) {
6291         // Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
6292         var undefMarker = Symbol('undef');
6293         // 23.3.1.1 WeakMap ( [ iterable ] )
6294         var WeakMap = function WeakMap(/* iterable */) {
6295                 // 1. If NewTarget is undefined, throw a TypeError exception.
6296                 if (!(this instanceof WeakMap)) {
6297                         throw new TypeError('Constructor WeakMap requires "new"');
6298                 }
6299                 // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakMapPrototype%", « [[WeakMapData]] »).
6300                 var map = OrdinaryCreateFromConstructor(this, WeakMap.prototype, {
6301                         _keys: [],
6302                         _values: [],
6303                         _es6WeakMap: true
6304                 });
6305
6306                 // 3. Set map.[[WeakMapData]] to a new empty List.
6307                 // Polyfill.io - This step was done as part of step two.
6308
6309                 // 4. If iterable is not present, let iterable be undefined.
6310                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
6311
6312                 // 5. If iterable is either undefined or null, return map.
6313                 if (iterable === null || iterable === undefined) {
6314                         return map;
6315                 }
6316
6317                 // 6. Let adder be ? Get(map, "set").
6318                 var adder = Get(map, "set");
6319
6320                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
6321                 if (!IsCallable(adder)) {
6322                         throw new TypeError("WeakMap.prototype.set is not a function");
6323                 }
6324
6325                 // 8. Let iteratorRecord be ? GetIterator(iterable).
6326                 try {
6327                         var iteratorRecord = GetIterator(iterable);
6328                         // 9. Repeat,
6329                         while (true) {
6330                                 // a. Let next be ? IteratorStep(iteratorRecord).
6331                                 var next = IteratorStep(iteratorRecord);
6332                                 // b. If next is false, return map.
6333                                 if (next === false) {
6334                                         return map;
6335                                 }
6336                                 // c. Let nextItem be ? IteratorValue(next).
6337                                 var nextItem = IteratorValue(next);
6338                                 // d. If Type(nextItem) is not Object, then
6339                                 if (Type(nextItem) !== 'object') {
6340                                         // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
6341                                         try {
6342                                                 throw new TypeError('Iterator value ' + nextItem + ' is not an entry object');
6343                                         } catch (error) {
6344                                                 // ii. Return ? IteratorClose(iteratorRecord, error).
6345                                                 return IteratorClose(iteratorRecord, error);
6346                                         }
6347                                 }
6348                                 try {
6349                                         // Polyfill.io - The try catch accounts for steps: f, h, and j.
6350
6351                                         // e. Let k be Get(nextItem, "0").
6352                                         var k = Get(nextItem, "0");
6353                                         // f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
6354                                         // g. Let v be Get(nextItem, "1").
6355                                         var v = Get(nextItem, "1");
6356                                         // h. If v is an abrupt completion, return ? IteratorClose(iteratorRecord, v).
6357                                         // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).
6358                                         Call(adder, map, [k, v]);
6359                                 } catch (e) {
6360                                         // j. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
6361                                         return IteratorClose(iteratorRecord, e);
6362                                 }
6363                         }
6364                 } catch (e) {
6365                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
6366                         if (Array.isArray(iterable) ||
6367                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
6368                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
6369                                 (!!iterable.callee)) {
6370                                 var index;
6371                                 var length = iterable.length;
6372                                 for (index = 0; index < length; index++) {
6373                                         var k = iterable[index][0];
6374                                         var v = iterable[index][1];
6375                                         Call(adder, map, [k, v]);
6376                                 }
6377                         }
6378                 }
6379                 return map;
6380         };
6381
6382         // 23.3.2.1 WeakMap.prototype
6383         // The initial value of WeakMap.prototype is the intrinsic object %WeakMapPrototype%.
6384         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
6385         Object.defineProperty(WeakMap, 'prototype', {
6386                 configurable: false,
6387                 enumerable: false,
6388                 writable: false,
6389                 value: {}
6390         });
6391
6392         // 23.3.3.1 WeakMap.prototype.constructor
6393         CreateMethodProperty(WeakMap.prototype, 'constructor', WeakMap);
6394
6395         // 23.3.3.2 WeakMap.prototype.delete ( key )
6396         CreateMethodProperty(WeakMap.prototype, 'delete', function (key) {
6397                 // 1. Let M be the this value.
6398                 var M = this;
6399                 // 2. If Type(M) is not Object, throw a TypeError exception.
6400                 if (Type(M) !== 'object') {
6401                         throw new TypeError('Method WeakMap.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
6402                 }
6403                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6404                 if (M._es6WeakMap !== true) {
6405                         throw new TypeError('Method WeakMap.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
6406                 }
6407                 // 4. Let entries be the List that is M.[[WeakMapData]].
6408                 var entries = M._keys;
6409                 // 5. If Type(key) is not Object, return false.
6410                 if (Type(key) !== 'object') {
6411                         return false;
6412                 }
6413                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6414                 for (var i = 0; i < entries.length; i++) {
6415                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then
6416                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6417                                 // i. Set p.[[Key]] to empty.
6418                                 this._keys[i] = undefMarker;
6419                                 // ii. Set p.[[Value]] to empty.
6420                                 this._values[i] = undefMarker;
6421                                 this._size = --this._size;
6422                                 // iii. Return true.
6423                                 return true;
6424                         }
6425                 }
6426                 // 7. Return false.
6427                 return false;
6428         });
6429
6430         // 23.3.3.3 WeakMap.prototype.get ( key )
6431         CreateMethodProperty(WeakMap.prototype, 'get', function get(key) {
6432                 // 1. Let M be the this value.
6433                 var M = this;
6434                 // 2. If Type(M) is not Object, throw a TypeError exception.
6435                 if (Type(M) !== 'object') {
6436                         throw new TypeError('Method WeakMap.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
6437                 }
6438                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6439                 if (M._es6WeakMap !== true) {
6440                         throw new TypeError('Method WeakMap.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
6441                 }
6442                 // 4. Let entries be the List that is M.[[WeakMapData]].
6443                 var entries = M._keys;
6444                 // 5. If Type(key) is not Object, return undefined.
6445                 if (Type(key) !== 'object') {
6446                         return undefined;
6447                 }
6448                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6449                 for (var i = 0; i < entries.length; i++) {
6450                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
6451                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6452                                 return M._values[i];
6453                         }
6454                 }
6455                 // 7. Return undefined.
6456                 return undefined;
6457         });
6458
6459         // 23.3.3.4 WeakMap.prototype.has ( key )
6460         CreateMethodProperty(WeakMap.prototype, 'has', function has(key) {
6461                 // 1. Let M be the this value.
6462                 var M = this;
6463                 // 2. If Type(M) is not Object, throw a TypeError exception.
6464                 if (typeof M !== 'object') {
6465                         throw new TypeError('Method WeakMap.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
6466                 }
6467                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6468                 if (M._es6WeakMap !== true) {
6469                         throw new TypeError('Method WeakMap.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
6470                 }
6471                 // 4. Let entries be the List that is M.[[WeakMapData]].
6472                 var entries = M._keys;
6473                 // 5. If Type(key) is not Object, return false.
6474                 if (Type(key) !== 'object') {
6475                         return false;
6476                 }
6477                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6478                 for (var i = 0; i < entries.length; i++) {
6479                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return true.
6480                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6481                                 return true;
6482                         }
6483                 }
6484                 // 7. Return false.
6485                 return false;
6486         });
6487
6488         // 23.3.3.5 WeakMap.prototype.set ( key, value )
6489         CreateMethodProperty(WeakMap.prototype, 'set', function set(key, value) {
6490                 // 1. Let M be the this value.
6491                 var M = this;
6492                 // 2. If Type(M) is not Object, throw a TypeError exception.
6493                 if (Type(M) !== 'object') {
6494                         throw new TypeError('Method WeakMap.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
6495                 }
6496                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6497                 if (M._es6WeakMap !== true) {
6498                         throw new TypeError('Method WeakMap.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
6499                 }
6500                 // 4. Let entries be the List that is M.[[WeakMapData]].
6501                 var entries = M._keys;
6502                 // 5. If Type(key) is not Object, throw a TypeError exception.
6503                 if (Type(key) !== 'object') {
6504                         throw new TypeError("Invalid value used as weak map key");
6505                 }
6506                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6507                 for (var i = 0; i < entries.length; i++) {
6508                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then
6509                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6510                                 // i. Set p.[[Value]] to value.
6511                                 M._values[i] = value;
6512                                 // ii. Return M.
6513                                 return M;
6514                         }
6515                 }
6516                 // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.
6517                 var p = {
6518                         '[[Key]]': key,
6519                         '[[Value]]': value
6520                 };
6521                 // 8. Append p as the last element of entries.
6522                 M._keys.push(p['[[Key]]']);
6523                 M._values.push(p['[[Value]]']);
6524                 // 9. Return M.
6525                 return M;
6526         });
6527
6528         // 23.3.3.6 WeakMap.prototype [ @@toStringTag ]
6529         // The initial value of the @@toStringTag property is the String value "WeakMap".
6530         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
6531
6532         // Polyfill.io - Safari 8 implements WeakMap.name but as a non-writable property, which means it would throw an error if we try and write to it here.
6533         if (!('name' in WeakMap)) {
6534                 // 19.2.4.2 name
6535                 Object.defineProperty(WeakMap, 'name', {
6536                         configurable: true,
6537                         enumerable: false,
6538                         writable: false,
6539                         value: 'WeakMap'
6540                 });
6541         }
6542
6543         // Export the object
6544         try {
6545                 CreateMethodProperty(global, 'WeakMap', WeakMap);
6546         } catch (e) {
6547                 // IE8 throws an error here if we set enumerable to false.
6548                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
6549                 global['WeakMap'] = WeakMap;
6550         }
6551 }(this));
6552
6553 }
6554
6555 if (!((function(e){try{if("WeakSet"in e&&0===WeakSet.length){var t={},n=new WeakSet([t])
6556 return n.has(t)&&!1===n["delete"](0)}return!1}catch(r){return!1}})(this)
6557 )) {
6558
6559 // WeakSet
6560 /* global Call, CreateMethodProperty, Get, GetIterator, IsArray, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Type, Symbol */
6561 (function (global) {
6562         // Deleted set items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
6563         var undefMarker = Symbol('undef');
6564         // 23.4.1.1. WeakSet ( [ iterable ] )
6565         var WeakSet = function WeakSet() {
6566                 // 1. If NewTarget is undefined, throw a TypeError exception.
6567                 if (!(this instanceof WeakSet)) {
6568                         throw new TypeError('Constructor WeakSet requires "new"');
6569                 }
6570                 // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakSetPrototype%", « [[WeakSetData]] »).
6571                 var set = OrdinaryCreateFromConstructor(this, WeakSet.prototype, {
6572                         _values: [],
6573                         _size: 0,
6574                         _es6WeakSet: true
6575                 });
6576
6577                 // 3. Set set.[[WeakSetData]] to a new empty List.
6578                 // Polyfill.io - This step was done as part of step two.
6579
6580                 // 4. If iterable is not present, let iterable be undefined.
6581                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
6582                 // 5. If iterable is either undefined or null, return set.
6583                 if (iterable === null || iterable === undefined) {
6584                         return set;
6585                 }
6586                 // 6. Let adder be ? Get(set, "add").
6587                 var adder = Get(set, 'add');
6588                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
6589                 if (!IsCallable(adder)) {
6590                         throw new TypeError("WeakSet.prototype.add is not a function");
6591                 }
6592                 try {
6593                         // 8. Let iteratorRecord be ? GetIterator(iterable).
6594                         var iteratorRecord = GetIterator(iterable);
6595                         // 9. Repeat,
6596                         while (true) {
6597                                 // a. Let next be ? IteratorStep(iteratorRecord).
6598                                 var next = IteratorStep(iteratorRecord);
6599                                 // b. If next is false, return set.
6600                                 if (next === false) {
6601                                         return set;
6602                                 }
6603                                 // c. Let nextValue be ? IteratorValue(next).
6604                                 var nextValue = IteratorValue(next);
6605                                 // d. Let status be Call(adder, set, « nextValue »).
6606                                 try {
6607                                         Call(adder, set, [nextValue]);
6608                                 } catch (e) {
6609                                         // e. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
6610                                         return IteratorClose(iteratorRecord, e);
6611                                 }
6612                         }
6613                 } catch (e) {
6614                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
6615                         if (IsArray(iterable) ||
6616                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
6617                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
6618                                 (!!iterable.callee)) {
6619                                 var index;
6620                                 var length = iterable.length;
6621                                 for (index = 0; index < length; index++) {
6622                                         Call(adder, set, [iterable[index]]);
6623                                 }
6624                         }
6625                 }
6626                 return set;
6627         };
6628
6629         // 23.4.2.1. WeakSet.prototype
6630         // The initial value of WeakSet.prototype is the intrinsic %WeakSetPrototype% object.
6631         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
6632         Object.defineProperty(WeakSet, 'prototype', {
6633                 configurable: false,
6634                 enumerable: false,
6635                 writable: false,
6636                 value: {}
6637         });
6638
6639         // 23.4.3.1. WeakSet.prototype.add ( value )
6640         CreateMethodProperty(WeakSet.prototype, 'add', function add(value) {
6641                 // 1. Let S be the this value.
6642                 var S = this;
6643                 // 2. If Type(S) is not Object, throw a TypeError exception.
6644                 if (Type(S) !== 'object') {
6645                         throw new TypeError('Method WeakSet.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
6646                 }
6647                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6648                 if (S._es6WeakSet !== true) {
6649                         throw new TypeError('Method WeakSet.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
6650                 }
6651                 // 4. If Type(value) is not Object, throw a TypeError exception.
6652                 if (Type(value) !== 'object') {
6653                         throw new TypeError('Invalid value used in weak set');
6654                 }
6655                 // 5. Let entries be the List that is S.[[WeakSetData]].
6656                 var entries = S._values;
6657                 // 6. For each e that is an element of entries, do
6658                 for (var i = 0; i < entries.length; i++) {
6659                         var e = entries[i];
6660                         // a. If e is not empty and SameValue(e, value) is true, then
6661                         if (e !== undefMarker && SameValueZero(e, value)) {
6662                                 // i. Return S.
6663                                 return S;
6664                         }
6665                 }
6666                 // 7. Append value as the last element of entries.
6667                 S._values.push(value);
6668                 // 8. Return S.
6669                 return S;
6670         });
6671
6672         // 23.4.3.2. WeakSet.prototype.constructor
6673         CreateMethodProperty(WeakSet.prototype, 'constructor', WeakSet);
6674
6675         // 23.4.3.3. WeakSet.prototype.delete ( value )
6676         CreateMethodProperty(WeakSet.prototype, 'delete', function (value) {
6677                 // 1. Let S be the this value.
6678                 var S = this;
6679                 // 2. If Type(S) is not Object, throw a TypeError exception.
6680                 if (Type(S) !== 'object') {
6681                         throw new TypeError('Method WeakSet.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
6682                 }
6683                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6684                 if (S._es6WeakSet !== true) {
6685                         throw new TypeError('Method WeakSet.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
6686                 }
6687                 // 4. If Type(value) is not Object, return false.
6688                 if (Type(value) !== 'object') {
6689                         return false;
6690                 }
6691                 // 5. Let entries be the List that is S.[[WeakSetData]].
6692                 var entries = S._values;
6693                 // 6. For each e that is an element of entries, do
6694                 for (var i = 0; i < entries.length; i++) {
6695                         var e = entries[i];
6696                         // a. If e is not empty and SameValue(e, value) is true, then
6697                         if (e !== undefMarker && SameValueZero(e, value)) {
6698                                 // i. Replace the element of entries whose value is e with an element whose value is empty.
6699                                 entries[i] = undefMarker;
6700                                 // ii. Return true.
6701                                 return true;
6702                         }
6703                 }
6704                 // 7. Return false.
6705                 return false;
6706         });
6707
6708         // 23.4.3.4. WeakSet.prototype.has ( value )
6709         CreateMethodProperty(WeakSet.prototype, 'has', function has(value) {
6710                 // 1. Let S be the this value.
6711                 var S = this;
6712                 // 2. If Type(S) is not Object, throw a TypeError exception.
6713                 if (Type(S) !== 'object') {
6714                         throw new TypeError('Method WeakSet.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(S));
6715                 }
6716                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6717                 if (S._es6WeakSet !== true) {
6718                         throw new TypeError('Method WeakSet.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(S));
6719                 }
6720                 // 4. Let entries be the List that is S.[[WeakSetData]].
6721                 var entries = S._values;
6722                 // 5. If Type(value) is not Object, return false.
6723                 if (Type(value) !== 'object') {
6724                         return false;
6725                 }
6726                 // 6. For each e that is an element of entries, do
6727                 for (var i = 0; i < entries.length; i++) {
6728                         var e = entries[i];
6729                         // a. If e is not empty and SameValue(e, value) is true, return true.
6730                         if (e !== undefMarker && SameValueZero(e, value)) {
6731                                 return true;
6732                         }
6733                 }
6734                 // 7. Return false.
6735                 return false;
6736         });
6737
6738         // 23.4.3.5. WeakSet.prototype [ @@toStringTag ]
6739         // The initial value of the @@toStringTag property is the String value "WeakSet".
6740         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
6741
6742         // Polyfill.io - Safari 8 implements Set.name but as a non-configurable property, which means it would throw an error if we try and configure it here.
6743         if (!('name' in WeakSet)) {
6744                 // 19.2.4.2 name
6745                 Object.defineProperty(WeakSet, 'name', {
6746                         configurable: true,
6747                         enumerable: false,
6748                         writable: false,
6749                         value: 'WeakSet'
6750                 });
6751         }
6752
6753         // Export the object
6754         try {
6755                 CreateMethodProperty(global, 'WeakSet', WeakSet);
6756         } catch (e) {
6757                 // IE8 throws an error here if we set enumerable to false.
6758                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
6759                 global['WeakSet'] = WeakSet;
6760         }
6761
6762 }(this));
6763
6764 }
6765
6766 })
6767 .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});