]> git.openstreetmap.org Git - rails.git/blob - vendor/assets/polyfill/es6.js
Merge remote-tracking branch 'upstream/pull/4717'
[rails.git] / vendor / assets / polyfill / es6.js
1 /* Polyfill service v3.38.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.OrdinaryCreateFromConstructor, License: CC0 (required by "Map", "es6", "Array.from", "Set", "WeakMap", "WeakSet", "_ESAbstract.Construct", "Array.of")
88  * - _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")
89  * - _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")
90  * - 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")
91  * - 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")
92  * - Array.of, License: CC0 (required by "es6")
93  * - Object.seal, License: MIT (required by "es6")
94  * - Object.setPrototypeOf, License: MIT (required by "es6", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator", "_StringIterator", "String.prototype.@@iterator")
95  * - Promise, License: MIT (required by "es6")
96  * - RegExp.prototype.flags, License: MIT (required by "es6")
97  * - String.fromCodePoint, License: MIT (required by "es6")
98  * - String.prototype.codePointAt, License: MIT (required by "es6")
99  * - String.prototype.endsWith, License: CC0 (required by "es6")
100  * - String.prototype.includes, License: CC0 (required by "es6", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "Array.prototype.@@iterator")
101  * - String.prototype.repeat, License: CC0 (required by "es6")
102  * - String.prototype.startsWith, License: CC0 (required by "es6")
103  * - 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")
104  * - Symbol.hasInstance, License: MIT (required by "es6")
105  * - Symbol.isConcatSpreadable, License: MIT (required by "es6")
106  * - Symbol.iterator, License: MIT (required by "es6", "Array.from", "Array.prototype.@@iterator", "Map", "Set", "String.prototype.@@iterator", "_ESAbstract.GetIterator", "WeakMap", "WeakSet", "_Iterator", "_ArrayIterator", "Array.prototype.entries", "Array.prototype.keys", "Array.prototype.values", "_StringIterator")
107  * - _ESAbstract.GetIterator, License: CC0 (required by "Array.from", "es6", "Map", "Set", "WeakMap", "WeakSet")
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 x(){}.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.OrdinaryCreateFromConstructor
3619 /* global GetPrototypeFromConstructor */
3620 // 9.1.13. OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
3621 function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars
3622         var internalSlotsList = arguments[2] || {};
3623         // 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object.
3624         // The corresponding object must be an intrinsic that is intended to be used as the[[Prototype]] value of an object.
3625
3626         // 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).
3627         var proto = GetPrototypeFromConstructor(constructor, intrinsicDefaultProto);
3628
3629         // 3. Return ObjectCreate(proto, internalSlotsList).
3630         // 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.
3631         var obj = Object.create(proto);
3632         for (var name in internalSlotsList) {
3633                 if (Object.prototype.hasOwnProperty.call(internalSlotsList, name)) {
3634                         Object.defineProperty(obj, name, {
3635                                 configurable: true,
3636                                 enumerable: false,
3637                                 writable: true,
3638                                 value: internalSlotsList[name]
3639                         });
3640                 }
3641         }
3642         return obj;
3643 }
3644
3645 // _ESAbstract.Construct
3646 /* global IsConstructor, OrdinaryCreateFromConstructor, Call */
3647 // 7.3.13. Construct ( F [ , argumentsList [ , newTarget ]] )
3648 function Construct(F /* [ , argumentsList [ , newTarget ]] */) { // eslint-disable-line no-unused-vars
3649         // 1. If newTarget is not present, set newTarget to F.
3650         var newTarget = arguments.length > 2 ? arguments[2] : F;
3651
3652         // 2. If argumentsList is not present, set argumentsList to a new empty List.
3653         var argumentsList = arguments.length > 1 ? arguments[1] : [];
3654
3655         // 3. Assert: IsConstructor(F) is true.
3656         if (!IsConstructor(F)) {
3657                 throw new TypeError('F must be a constructor.');
3658         }
3659
3660         // 4. Assert: IsConstructor(newTarget) is true.
3661         if (!IsConstructor(newTarget)) {
3662                 throw new TypeError('newTarget must be a constructor.');
3663         }
3664
3665         // 5. Return ? F.[[Construct]](argumentsList, newTarget).
3666         // Polyfill.io - If newTarget is the same as F, it is equivalent to new F(...argumentsList).
3667         if (newTarget === F) {
3668                 return new (Function.prototype.bind.apply(F, [null].concat(argumentsList)))();
3669         } else {
3670                 // Polyfill.io - This is mimicking section 9.2.2 step 5.a.
3671                 var obj = OrdinaryCreateFromConstructor(newTarget, Object.prototype);
3672                 return Call(F, obj, argumentsList);
3673         }
3674 }
3675
3676 // _ESAbstract.ArraySpeciesCreate
3677 /* global IsArray, ArrayCreate, Get, Type, IsConstructor, Construct */
3678 // 9.4.2.3. ArraySpeciesCreate ( originalArray, length )
3679 function ArraySpeciesCreate(originalArray, length) { // eslint-disable-line no-unused-vars
3680         // 1. Assert: length is an integer Number ≥ 0.
3681         // 2. If length is -0, set length to +0.
3682         if (1/length === -Infinity) {
3683                 length = 0;
3684         }
3685
3686         // 3. Let isArray be ? IsArray(originalArray).
3687         var isArray = IsArray(originalArray);
3688
3689         // 4. If isArray is false, return ? ArrayCreate(length).
3690         if (isArray === false) {
3691                 return ArrayCreate(length);
3692         }
3693
3694         // 5. Let C be ? Get(originalArray, "constructor").
3695         var C = Get(originalArray, 'constructor');
3696
3697         // Polyfill.io - We skip this section as not sure how to make a cross-realm normal Array, a same-realm Array.
3698         // 6. If IsConstructor(C) is true, then
3699         // if (IsConstructor(C)) {
3700                 // a. Let thisRealm be the current Realm Record.
3701                 // b. Let realmC be ? GetFunctionRealm(C).
3702                 // c. If thisRealm and realmC are not the same Realm Record, then
3703                         // i. If SameValue(C, realmC.[[Intrinsics]].[[%Array%]]) is true, set C to undefined.
3704         // }
3705         // 7. If Type(C) is Object, then
3706         if (Type(C) === 'object') {
3707                 // a. Set C to ? Get(C, @@species).
3708                 C = 'Symbol' in this && 'species' in this.Symbol ? Get(C, this.Symbol.species) : undefined;
3709                 // b. If C is null, set C to undefined.
3710                 if (C === null) {
3711                         C = undefined;
3712                 }
3713         }
3714         // 8. If C is undefined, return ? ArrayCreate(length).
3715         if (C === undefined) {
3716                 return ArrayCreate(length);
3717         }
3718         // 9. If IsConstructor(C) is false, throw a TypeError exception.
3719         if (!IsConstructor(C)) {
3720                 throw new TypeError('C must be a constructor');
3721         }
3722         // 10. Return ? Construct(C, « length »).
3723         return Construct(C, [length]);
3724 }
3725 if (!("filter"in Array.prototype
3726 )) {
3727
3728 // Array.prototype.filter
3729 /* global CreateMethodProperty, ToObject, ToLength, Get, IsCallable, ArraySpeciesCreate, ToString, HasProperty, ToBoolean, Call, CreateDataPropertyOrThrow */
3730 // 22.1.3.7. Array.prototype.filter ( callbackfn [ , thisArg ] )
3731 CreateMethodProperty(Array.prototype, 'filter', function filter(callbackfn /* [ , thisArg ] */) {
3732         // 1. Let O be ? ToObject(this value).
3733         var O = ToObject(this);
3734         // 2. Let len be ? ToLength(? Get(O, "length")).
3735         var len = ToLength(Get(O, "length"));
3736         // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
3737         if (IsCallable(callbackfn) === false) {
3738                 throw new TypeError(callbackfn + ' is not a function');
3739         }
3740         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
3741         var T = arguments.length > 1 ? arguments[1] : undefined;
3742         // 5. Let A be ? ArraySpeciesCreate(O, 0).
3743         var A = ArraySpeciesCreate(O, 0);
3744         // 6. Let k be 0.
3745         var k = 0;
3746         // 7. Let to be 0.
3747         var to = 0;
3748         // 8. Repeat, while k < len
3749         while (k < len) {
3750                 // a. Let Pk be ! ToString(k).
3751                 var Pk = ToString(k);
3752                 // b. Let kPresent be ? HasProperty(O, Pk).
3753                 var kPresent = HasProperty(O, Pk);
3754                 // c. If kPresent is true, then
3755                 if (kPresent) {
3756                         // i. Let kValue be ? Get(O, Pk).
3757                         var kValue = Get(O, Pk);
3758                         // ii. Let selected be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).
3759                         var selected = ToBoolean(Call(callbackfn, T, [kValue, k, O]));
3760                         // iii. If selected is true, then
3761                         if (selected) {
3762                                 // 1. Perform ? CreateDataPropertyOrThrow(A, ! ToString(to), kValue)
3763                                 CreateDataPropertyOrThrow(A, ToString(to), kValue);
3764                                 // 2. Increase to by 1.
3765                                 to = to + 1;
3766                         }
3767
3768                 }
3769                 // d. Increase k by 1.
3770                 k = k + 1;
3771         }
3772         // 9. Return A.
3773         return A;
3774 });
3775
3776 }
3777
3778 if (!("map"in Array.prototype
3779 )) {
3780
3781 // Array.prototype.map
3782 /* global ArraySpeciesCreate, Call, CreateDataPropertyOrThrow, CreateMethodProperty, Get, HasProperty, IsCallable, ToLength, ToObject, ToString */
3783 /* global CreateMethodProperty, ToObject, ToLength, Get, ArraySpeciesCreate, ToString, HasProperty, Call, CreateDataPropertyOrThrow */
3784 // 22.1.3.16. Array.prototype.map ( callbackfn [ , thisArg ] )
3785 CreateMethodProperty(Array.prototype, 'map', function map(callbackfn /* [ , thisArg ] */) {
3786         // 1. Let O be ? ToObject(this value).
3787         var O = ToObject(this);
3788         // 2. Let len be ? ToLength(? Get(O, "length")).
3789         var len = ToLength(Get(O, "length"));
3790         // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
3791         if (IsCallable(callbackfn) === false) {
3792                 throw new TypeError(callbackfn + ' is not a function');
3793         }
3794         // 4. If thisArg is present, let T be thisArg; else let T be undefined.
3795         var T = arguments.length > 1 ? arguments[1] : undefined;
3796         // 5. Let A be ? ArraySpeciesCreate(O, len).
3797         var A = ArraySpeciesCreate(O, len);
3798         // 6. Let k be 0.
3799         var k = 0;
3800         // 7. Repeat, while k < len
3801         while (k < len) {
3802                 // a. Let Pk be ! ToString(k).
3803                 var Pk = ToString(k);
3804                 // b. Let kPresent be ? HasProperty(O, Pk).
3805                 var kPresent = HasProperty(O, Pk);
3806                 // c. If kPresent is true, then
3807                 if (kPresent) {
3808                         // i. Let kValue be ? Get(O, Pk).
3809                         var kValue = Get(O, Pk);
3810                         // ii. Let mappedValue be ? Call(callbackfn, T, « kValue, k, O »).
3811                         var mappedValue = Call(callbackfn, T, [kValue, k, O]);
3812                         // iii. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
3813                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
3814                 }
3815                 // d. Increase k by 1.
3816                 k = k + 1;
3817         }
3818         // 8. Return A.
3819         return A;
3820 });
3821
3822 }
3823
3824 if (!("of"in Array
3825 )) {
3826
3827 // Array.of
3828 /* global ArrayCreate, Construct, CreateDataPropertyOrThrow, CreateMethodProperty, IsConstructor, ToString */
3829 // 22.1.2.3. Array.of ( ...items )
3830 CreateMethodProperty(Array, 'of', function of() {
3831         // 1. Let len be the actual number of arguments passed to this function.
3832         var len = arguments.length;
3833         // 2. Let items be the List of arguments passed to this function.
3834         var items = arguments;
3835         // 3. Let C be the this value.
3836         var C = this;
3837         // 4. If IsConstructor(C) is true, then
3838         if (IsConstructor(C)) {
3839                 // a. Let A be ? Construct(C, « len »).
3840                 var A = Construct(C, [len]);
3841                 // 5. Else,
3842         } else {
3843                 // a. Let A be ? ArrayCreate(len).
3844                 var A = ArrayCreate(len);
3845         }
3846         // 6. Let k be 0.
3847         var k = 0;
3848         // 7. Repeat, while k < len
3849         while (k < len) {
3850                 // a. Let kValue be items[k].
3851                 var kValue = items[k];
3852                 // b. Let Pk be ! ToString(k).
3853                 var Pk = ToString(k);
3854                 // c. Perform ? CreateDataPropertyOrThrow(A, Pk, kValue).
3855                 CreateDataPropertyOrThrow(A, Pk, kValue);
3856                 // d. Increase k by 1.
3857                 var k = k + 1;
3858
3859         }
3860         // 8. Perform ? Set(A, "length", len, true)
3861         A["length"] = len;
3862         // 9. Return A.
3863         return A;
3864 });
3865
3866 }
3867
3868 if (!("seal"in Object&&function(){try{return Object.seal("1"),!0}catch(t){return!1}}
3869 )) {
3870
3871 // Object.seal
3872 /* global CreateMethodProperty, Type */
3873 // 19.1.2.19 Object.seal ( O )
3874 (function(originalObjectSeal) {
3875     CreateMethodProperty(Object, 'seal', function seal(O) {
3876         // 1. If Type(O) is not Object, return O.
3877         if (Type(O) === 'object') {
3878             return O;
3879         }
3880         // 2. Let status be ? SetIntegrityLevel(O, "sealed").
3881         // 3. If status is false, throw a TypeError exception.
3882         // 4. Return O.
3883         return originalObjectSeal ? originalObjectSeal(O) : O;
3884     });
3885 }(Object.seal));
3886
3887
3888 }
3889
3890
3891 // Object.setPrototypeOf
3892 /* global CreateMethodProperty */
3893 // ES6-shim 0.16.0 (c) 2013-2014 Paul Miller (http://paulmillr.com)
3894 // ES6-shim may be freely distributed under the MIT license.
3895 // For more details and documentation:
3896 // https://github.com/paulmillr/es6-shim/
3897
3898  // NOTE:  This versions needs object ownership
3899   //        because every promoted object needs to be reassigned
3900   //        otherwise uncompatible browsers cannot work as expected
3901   //
3902   // NOTE:  This might need es5-shim or polyfills upfront
3903   //        because it's based on ES5 API.
3904   //        (probably just an IE <= 8 problem)
3905   //
3906   // NOTE:  nodejs is fine in version 0.8, 0.10, and future versions.
3907 (function () {
3908         if (Object.setPrototypeOf) { return; }
3909
3910         /*jshint proto: true */
3911         // @author    Andrea Giammarchi - @WebReflection
3912
3913         var getOwnPropertyNames = Object.getOwnPropertyNames;
3914         var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3915         var create = Object.create;
3916         var defineProperty = Object.defineProperty;
3917         var getPrototypeOf = Object.getPrototypeOf;
3918         var objProto = Object.prototype;
3919
3920         var copyDescriptors = function (target, source) {
3921                 // define into target descriptors from source
3922                 getOwnPropertyNames(source).forEach(function (key) {
3923                         defineProperty(
3924                                 target,
3925                                 key,
3926                                 getOwnPropertyDescriptor(source, key)
3927                         );
3928                 });
3929                 return target;
3930         };
3931         // used as fallback when no promotion is possible
3932         var createAndCopy = function setPrototypeOf(origin, proto) {
3933                 return copyDescriptors(create(proto), origin);
3934         };
3935         var set, sPOf;
3936         try {
3937                 // this might fail for various reasons
3938                 // ignore if Chrome cought it at runtime
3939                 set = getOwnPropertyDescriptor(objProto, '__proto__').set;
3940                 set.call({}, null);
3941                 // setter not poisoned, it can promote
3942                 // Firefox, Chrome
3943                 sPOf = function setPrototypeOf(origin, proto) {
3944                         set.call(origin, proto);
3945                         return origin;
3946                 };
3947         } catch (e) {
3948                 // do one or more feature detections
3949                 set = { __proto__: null };
3950                 // if proto does not work, needs to fallback
3951                 // some Opera, Rhino, ducktape
3952                 if (set instanceof Object) {
3953                         sPOf = createAndCopy;
3954                 } else {
3955                         // verify if null objects are buggy
3956                         /* eslint-disable no-proto */
3957                         set.__proto__ = objProto;
3958                         /* eslint-enable no-proto */
3959                         // if null objects are buggy
3960                         // nodejs 0.8 to 0.10
3961                         if (set instanceof Object) {
3962                                 sPOf = function setPrototypeOf(origin, proto) {
3963                                         // use such bug to promote
3964                                         /* eslint-disable no-proto */
3965                                         origin.__proto__ = proto;
3966                                         /* eslint-enable no-proto */
3967                                         return origin;
3968                                 };
3969                         } else {
3970                                 // try to use proto or fallback
3971                                 // Safari, old Firefox, many others
3972                                 sPOf = function setPrototypeOf(origin, proto) {
3973                                         // if proto is not null
3974                                         if (getPrototypeOf(origin)) {
3975                                                 // use __proto__ to promote
3976                                                 /* eslint-disable no-proto */
3977                                                 origin.__proto__ = proto;
3978                                                 /* eslint-enable no-proto */
3979                                                 return origin;
3980                                         } else {
3981                                                 // otherwise unable to promote: fallback
3982                                                 return createAndCopy(origin, proto);
3983                                         }
3984                                 };
3985                         }
3986                 }
3987         }
3988         CreateMethodProperty(Object, 'setPrototypeOf', sPOf);
3989 }());
3990 if (!("Promise"in this
3991 )) {
3992
3993 // Promise
3994 !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:/*!***********************!*\
3995   !*** ./src/global.js ***!
3996   \***********************/
3997 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:/*!***********************************!*\
3998   !*** (webpack)/buildin/global.js ***!
3999   \***********************************/
4000 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:/*!*********************!*\
4001   !*** ./src/yaku.js ***!
4002   \*********************/
4003 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))}});
4004 }
4005
4006 if (!("flags"in RegExp.prototype
4007 )) {
4008
4009 // RegExp.prototype.flags
4010 /* global Get, ToBoolean, Type */
4011 Object.defineProperty(RegExp.prototype, 'flags', {
4012         configurable: true,
4013         enumerable: false,
4014         get: function () {
4015                 // 21.2.5.3.1 Let R be the this value.
4016                 var R = this;
4017
4018                 // 21.2.5.3.2 If Type(R) is not Object, throw a TypeError exception.
4019                 if (Type(R) !== 'object') {
4020                         throw new TypeError('Method called on incompatible type: must be an object.');
4021                 }
4022                 // 21.2.5.3.3 Let result be the empty String.
4023                 var result = '';
4024
4025                 // 21.2.5.3.4 Let global be ToBoolean(? Get(R, "global")).
4026                 var global = ToBoolean(Get(R, 'global'));
4027
4028                 // 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.
4029                 if (global) {
4030                         result += 'g';
4031                 }
4032
4033                 // 21.2.5.3.6 Let ignoreCase be ToBoolean(? Get(R, "ignoreCase")).
4034                 var ignoreCase = ToBoolean(Get(R, 'ignoreCase'));
4035
4036                 // 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.
4037                 if (ignoreCase) {
4038                         result += 'i';
4039                 }
4040
4041                 // 21.2.5.3.8 Let multiline be ToBoolean(? Get(R, "multiline")).
4042                 var multiline = ToBoolean(Get(R, 'multiline'));
4043
4044                 // 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.
4045                 if (multiline) {
4046                         result += 'm';
4047                 }
4048
4049                 // 21.2.5.3.10 Let unicode be ToBoolean(? Get(R, "unicode")).
4050                 var unicode = ToBoolean(Get(R, 'unicode'));
4051
4052                 // 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.
4053                 if (unicode) {
4054                         result += 'u';
4055                 }
4056
4057                 // 21.2.5.3.12 Let sticky be ToBoolean(? Get(R, "sticky")).
4058                 var sticky = ToBoolean(Get(R, 'sticky'));
4059
4060                 // 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.
4061                 if (sticky) {
4062                         result += 'y';
4063                 }
4064
4065                 // 21.2.5.3.14 Return result.
4066                 return result;
4067         }
4068 });
4069
4070 }
4071
4072 if (!("fromCodePoint"in String&&1===String.fromCodePoint.length
4073 )) {
4074
4075 // String.fromCodePoint
4076 /* global CreateMethodProperty, IsArray, SameValue, ToInteger, ToNumber, UTF16Encoding */
4077
4078 // 21.1.2.2. String.fromCodePoint ( ...codePoints )
4079 CreateMethodProperty(String, 'fromCodePoint', function fromCodePoint(_) { // eslint-disable-line no-unused-vars
4080         // Polyfill.io - List to store the characters whilst iterating over the code points.
4081         var result = [];
4082         // 1. Let codePoints be a List containing the arguments passed to this function.
4083         var codePoints = arguments;
4084         // 2. Let length be the number of elements in codePoints.
4085         var length = arguments.length;
4086         // 3. Let elements be a new empty List.
4087         var elements = [];
4088         // 4. Let nextIndex be 0.
4089         var nextIndex = 0;
4090         // 5. Repeat, while nextIndex < length
4091         while (nextIndex < length) {
4092                 // Polyfill.io - We reset the elements List as we store the partial results in the result List.
4093                 var elements = [];
4094                 // a. Let next be codePoints[nextIndex].
4095                 var next = codePoints[nextIndex];
4096                 // b. Let nextCP be ? ToNumber(next).
4097                 var nextCP = ToNumber(next);
4098                 // c. If SameValue(nextCP, ToInteger(nextCP)) is false, throw a RangeError exception.
4099                 if (SameValue(nextCP, ToInteger(nextCP)) === false) {
4100                         throw new RangeError('Invalid code point ' + Object.prototype.toString.call(nextCP));
4101                 }
4102                 // d. If nextCP < 0 or nextCP > 0x10FFFF, throw a RangeError exception.
4103                 if (nextCP < 0 || nextCP > 0x10FFFF) {
4104                         throw new RangeError('Invalid code point ' + Object.prototype.toString.call(nextCP));
4105                 }
4106                 // e. Append the elements of the UTF16Encoding of nextCP to the end of elements.
4107                 // Polyfill.io - UTF16Encoding can return a single codepoint or a list of multiple codepoints.
4108                 var cp = UTF16Encoding(nextCP);
4109                 if (IsArray(cp)) {
4110                         elements = elements.concat(cp);
4111                 } else {
4112                         elements.push(cp);
4113                 }
4114                 // f. Let nextIndex be nextIndex + 1.
4115                 nextIndex = nextIndex + 1;
4116
4117                 // Polyfill.io - Retrieving the characters whilst iterating enables the function to work in a memory efficient and performant way.
4118                 result.push(String.fromCharCode.apply(null, elements));
4119         }
4120         // 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.
4121         return length === 0 ? '' : result.join('');
4122 });
4123
4124 }
4125
4126 if (!("codePointAt"in String.prototype
4127 )) {
4128
4129 // String.prototype.codePointAt
4130 /* global CreateMethodProperty, RequireObjectCoercible, ToInteger, ToString, UTF16Decode */
4131 // 21.1.3.3. String.prototype.codePointAt ( pos )
4132 CreateMethodProperty(String.prototype, 'codePointAt', function codePointAt(pos) {
4133         // 1. Let O be ? RequireObjectCoercible(this value).
4134         var O = RequireObjectCoercible(this);
4135         // 2. Let S be ? ToString(O).
4136         var S = ToString(O);
4137         // 3. Let position be ? ToInteger(pos).
4138         var position = ToInteger(pos);
4139         // 4. Let size be the length of S.
4140         var size = S.length;
4141         // 5. If position < 0 or position ≥ size, return undefined.
4142         if (position < 0 || position >= size) {
4143                 return undefined;
4144         }
4145         // 6. Let first be the numeric value of the code unit at index position within the String S.
4146         var first = String.prototype.charCodeAt.call(S, position);
4147         // 7. If first < 0xD800 or first > 0xDBFF or position+1 = size, return first.
4148         if (first < 0xD800 || first > 0xDBFF || position + 1 === size) {
4149                 return first;
4150         }
4151         // 8. Let second be the numeric value of the code unit at index position+1 within the String S.
4152         var second = String.prototype.charCodeAt.call(S, position + 1);
4153         // 9. If second < 0xDC00 or second > 0xDFFF, return first.
4154         if (second < 0xDC00 || second > 0xDFFF) {
4155                 return first;
4156         }
4157         // 10. Return UTF16Decode(first, second).
4158         // 21.1.3.3.10 Return UTF16Decode(first, second).
4159         return UTF16Decode(first, second);
4160 });
4161
4162 }
4163
4164 if (!("endsWith"in String.prototype
4165 )) {
4166
4167 // String.prototype.endsWith
4168 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4169 // 21.1.3.6. String.prototype.endsWith ( searchString [ , endPosition ] )
4170 CreateMethodProperty(String.prototype, 'endsWith', function endsWith(searchString /* [ , endPosition ] */) {
4171         'use strict';
4172         var endPosition = arguments.length > 1 ? arguments[1] : undefined;
4173         // 1. Let O be ? RequireObjectCoercible(this value).
4174         var O = RequireObjectCoercible(this);
4175         // 2. Let S be ? ToString(O).
4176         var S = ToString(O);
4177         // 3. Let isRegExp be ? IsRegExp(searchString).
4178         var isRegExp = IsRegExp(searchString);
4179         // 4. If isRegExp is true, throw a TypeError exception.
4180         if (isRegExp) {
4181                 throw new TypeError('First argument to String.prototype.endsWith must not be a regular expression');
4182         }
4183         // 5. Let searchStr be ? ToString(searchString).
4184         var searchStr = ToString(searchString);
4185         // 6. Let len be the length of S.
4186         var len = S.length;
4187         // 7. If endPosition is undefined, let pos be len, else let pos be ? ToInteger(endPosition).
4188         var pos = endPosition === undefined ? len : ToInteger(endPosition);
4189         // 8. Let end be min(max(pos, 0), len).
4190         var end = Math.min(Math.max(pos, 0), len);
4191         // 9. Let searchLength be the length of searchStr.
4192         var searchLength = searchStr.length;
4193         // 10. Let start be end - searchLength.
4194         var start = end - searchLength;
4195         // 11. If start is less than 0, return false.
4196         if (start < 0) {
4197                 return false;
4198         }
4199         // 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.
4200         if (S.substr(start, searchLength) === searchStr) {
4201                 return true;
4202          }
4203         // 13. Otherwise, return false.
4204         return false;
4205 });
4206
4207 }
4208
4209 if (!("includes"in String.prototype
4210 )) {
4211
4212 // String.prototype.includes
4213 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4214 // 21.1.3.7. String.prototype.includes ( searchString [ , position ] )
4215 CreateMethodProperty(String.prototype, 'includes', function includes(searchString /* [ , position ] */) {
4216         'use strict';
4217         var position = arguments.length > 1 ? arguments[1] : undefined;
4218         // 1. Let O be ? RequireObjectCoercible(this value).
4219         var O = RequireObjectCoercible(this);
4220         // 2. Let S be ? ToString(O).
4221         var S = ToString(O);
4222         // 3. Let isRegExp be ? IsRegExp(searchString).
4223         var isRegExp = IsRegExp(searchString);
4224         // 4. If isRegExp is true, throw a TypeError exception.
4225         if (isRegExp) {
4226                 throw new TypeError('First argument to String.prototype.includes must not be a regular expression');
4227         }
4228         // 5. Let searchStr be ? ToString(searchString).
4229         var searchStr = ToString(searchString);
4230         // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)
4231         var pos = ToInteger(position);
4232         // 7. Let len be the length of S.
4233         var len = S.length;
4234         // 8. Let start be min(max(pos, 0), len).
4235         var start = Math.min(Math.max(pos, 0), len);
4236         // 9. Let searchLen be the length of searchStr.
4237         // var searchLength = searchStr.length;
4238         // 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.
4239         return String.prototype.indexOf.call(S, searchStr, start) !== -1;
4240 });
4241
4242 }
4243
4244 if (!("repeat"in String.prototype
4245 )) {
4246
4247 // String.prototype.repeat
4248 /* global CreateMethodProperty, RequireObjectCoercible, ToInteger, ToString */
4249 // 21.1.3.15String.prototype.repeat ( count )
4250 CreateMethodProperty(String.prototype, 'repeat', function repeat(count) {
4251         'use strict';
4252         // 1. Let O be ? RequireObjectCoercible(this value).
4253         var O = RequireObjectCoercible(this);
4254         // 2. Let S be ? ToString(O).
4255         var S = ToString(O);
4256         // 3. Let n be ? ToInteger(count).
4257         var n = ToInteger(count);
4258         // 4. If n < 0, throw a RangeError exception.
4259         if (n < 0) {
4260                 throw new RangeError('Invalid count value');
4261         }
4262         // 5. If n is +∞, throw a RangeError exception.
4263         if (n === Infinity) {
4264                 throw new RangeError('Invalid count value');
4265         }
4266         // 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.
4267         var T = n === 0 ? '' : new Array(n + 1).join(S);
4268         // 7. Return T.
4269         return T;
4270 });
4271
4272 }
4273
4274 if (!("startsWith"in String.prototype
4275 )) {
4276
4277 // String.prototype.startsWith
4278 /* global CreateMethodProperty, IsRegExp, RequireObjectCoercible, ToInteger, ToString */
4279 // 21.1.3.20. String.prototype.startsWith ( searchString [ , position ] )
4280 CreateMethodProperty(String.prototype, 'startsWith', function startsWith(searchString /* [ , position ] */) {
4281         'use strict';
4282         var position = arguments.length > 1 ? arguments[1] : undefined;
4283         // 1. Let O be ? RequireObjectCoercible(this value).
4284         var O = RequireObjectCoercible(this);
4285         // 2. Let S be ? ToString(O).
4286         var S = ToString(O);
4287         // 3. Let isRegExp be ? IsRegExp(searchString).
4288         var isRegExp = IsRegExp(searchString);
4289         // 4. If isRegExp is true, throw a TypeError exception.
4290         if (isRegExp) {
4291                 throw new TypeError('First argument to String.prototype.startsWith must not be a regular expression');
4292         }
4293         // 5. Let searchStr be ? ToString(searchString).
4294         var searchStr = ToString(searchString);
4295         // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)
4296         var pos = ToInteger(position);
4297         // 7. Let len be the length of S.
4298         var len = S.length;
4299         // 8. Let start be min(max(pos, 0), len).
4300         var start = Math.min(Math.max(pos, 0), len);
4301         // 9. Let searchLength be the length of searchStr.
4302         var searchLength = searchStr.length;
4303         // 10. If searchLength+start is greater than len, return false.
4304         if (searchLength + start > len) {
4305                 return false;
4306         }
4307         // 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.
4308         if (S.substr(start).indexOf(searchString) === 0) {
4309                 return true;
4310         }
4311         // 12. Otherwise, return false.
4312         return false;
4313 });
4314
4315 }
4316
4317 if (!("Symbol"in this&&0===this.Symbol.length
4318 )) {
4319
4320 // Symbol
4321 // A modification of https://github.com/WebReflection/get-own-property-symbols
4322 // (C) Andrea Giammarchi - MIT Licensed
4323
4324 (function (Object, GOPS, global) {
4325         'use strict'; //so that ({}).toString.call(null) returns the correct [object Null] rather than [object Window]
4326
4327         var     setDescriptor;
4328         var id = 0;
4329         var random = '' + Math.random();
4330         var prefix = '__\x01symbol:';
4331         var prefixLength = prefix.length;
4332         var internalSymbol = '__\x01symbol@@' + random;
4333         var DP = 'defineProperty';
4334         var DPies = 'defineProperties';
4335         var GOPN = 'getOwnPropertyNames';
4336         var GOPD = 'getOwnPropertyDescriptor';
4337         var PIE = 'propertyIsEnumerable';
4338         var ObjectProto = Object.prototype;
4339         var hOP = ObjectProto.hasOwnProperty;
4340         var pIE = ObjectProto[PIE];
4341         var toString = ObjectProto.toString;
4342         var concat = Array.prototype.concat;
4343         var cachedWindowNames = Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
4344         var nGOPN = Object[GOPN];
4345         var gOPN = function getOwnPropertyNames (obj) {
4346                 if (toString.call(obj) === '[object Window]') {
4347                         try {
4348                                 return nGOPN(obj);
4349                         } catch (e) {
4350                                 // IE bug where layout engine calls userland gOPN for cross-domain `window` objects
4351                                 return concat.call([], cachedWindowNames);
4352                         }
4353                 }
4354                 return nGOPN(obj);
4355         };
4356         var gOPD = Object[GOPD];
4357         var create = Object.create;
4358         var keys = Object.keys;
4359         var freeze = Object.freeze || Object;
4360         var defineProperty = Object[DP];
4361         var $defineProperties = Object[DPies];
4362         var descriptor = gOPD(Object, GOPN);
4363         var addInternalIfNeeded = function (o, uid, enumerable) {
4364                 if (!hOP.call(o, internalSymbol)) {
4365                         try {
4366                                 defineProperty(o, internalSymbol, {
4367                                         enumerable: false,
4368                                         configurable: false,
4369                                         writable: false,
4370                                         value: {}
4371                                 });
4372                         } catch (e) {
4373                                 o[internalSymbol] = {};
4374                         }
4375                 }
4376                 o[internalSymbol]['@@' + uid] = enumerable;
4377         };
4378         var createWithSymbols = function (proto, descriptors) {
4379                 var self = create(proto);
4380                 gOPN(descriptors).forEach(function (key) {
4381                         if (propertyIsEnumerable.call(descriptors, key)) {
4382                                 $defineProperty(self, key, descriptors[key]);
4383                         }
4384                 });
4385                 return self;
4386         };
4387         var copyAsNonEnumerable = function (descriptor) {
4388                 var newDescriptor = create(descriptor);
4389                 newDescriptor.enumerable = false;
4390                 return newDescriptor;
4391         };
4392         var get = function get(){};
4393         var onlyNonSymbols = function (name) {
4394                 return name != internalSymbol &&
4395                         !hOP.call(source, name);
4396         };
4397         var onlySymbols = function (name) {
4398                 return name != internalSymbol &&
4399                         hOP.call(source, name);
4400         };
4401         var propertyIsEnumerable = function propertyIsEnumerable(key) {
4402                 var uid = '' + key;
4403                 return onlySymbols(uid) ? (
4404                         hOP.call(this, uid) &&
4405                         this[internalSymbol]['@@' + uid]
4406                 ) : pIE.call(this, key);
4407         };
4408         var setAndGetSymbol = function (uid) {
4409                 var descriptor = {
4410                         enumerable: false,
4411                         configurable: true,
4412                         get: get,
4413                         set: function (value) {
4414                         setDescriptor(this, uid, {
4415                                 enumerable: false,
4416                                 configurable: true,
4417                                 writable: true,
4418                                 value: value
4419                         });
4420                         addInternalIfNeeded(this, uid, true);
4421                         }
4422                 };
4423                 try {
4424                         defineProperty(ObjectProto, uid, descriptor);
4425                 } catch (e) {
4426                         ObjectProto[uid] = descriptor.value;
4427                 }
4428                 return freeze(source[uid] = defineProperty(
4429                         Object(uid),
4430                         'constructor',
4431                         sourceConstructor
4432                 ));
4433         };
4434         var Symbol = function Symbol() {
4435                 var description = arguments[0];
4436                 if (this instanceof Symbol) {
4437                         throw new TypeError('Symbol is not a constructor');
4438                 }
4439                 return setAndGetSymbol(
4440                         prefix.concat(description || '', random, ++id)
4441                 );
4442                 };
4443         var source = create(null);
4444         var sourceConstructor = {value: Symbol};
4445         var sourceMap = function (uid) {
4446                 return source[uid];
4447                 };
4448         var $defineProperty = function defineProp(o, key, descriptor) {
4449                 var uid = '' + key;
4450                 if (onlySymbols(uid)) {
4451                         setDescriptor(o, uid, descriptor.enumerable ?
4452                                 copyAsNonEnumerable(descriptor) : descriptor);
4453                         addInternalIfNeeded(o, uid, !!descriptor.enumerable);
4454                 } else {
4455                         defineProperty(o, key, descriptor);
4456                 }
4457                 return o;
4458         };
4459
4460         var onlyInternalSymbols = function (obj) {
4461                 return function (name) {
4462                         return hOP.call(obj, internalSymbol) && hOP.call(obj[internalSymbol], '@@' + name);
4463                 };
4464         };
4465         var $getOwnPropertySymbols = function getOwnPropertySymbols(o) {
4466                 return gOPN(o).filter(o === ObjectProto ? onlyInternalSymbols(o) : onlySymbols).map(sourceMap);
4467                 }
4468         ;
4469
4470         descriptor.value = $defineProperty;
4471         defineProperty(Object, DP, descriptor);
4472
4473         descriptor.value = $getOwnPropertySymbols;
4474         defineProperty(Object, GOPS, descriptor);
4475
4476         descriptor.value = function getOwnPropertyNames(o) {
4477                 return gOPN(o).filter(onlyNonSymbols);
4478         };
4479         defineProperty(Object, GOPN, descriptor);
4480
4481         descriptor.value = function defineProperties(o, descriptors) {
4482                 var symbols = $getOwnPropertySymbols(descriptors);
4483                 if (symbols.length) {
4484                 keys(descriptors).concat(symbols).forEach(function (uid) {
4485                         if (propertyIsEnumerable.call(descriptors, uid)) {
4486                         $defineProperty(o, uid, descriptors[uid]);
4487                         }
4488                 });
4489                 } else {
4490                 $defineProperties(o, descriptors);
4491                 }
4492                 return o;
4493         };
4494         defineProperty(Object, DPies, descriptor);
4495
4496         descriptor.value = propertyIsEnumerable;
4497         defineProperty(ObjectProto, PIE, descriptor);
4498
4499         descriptor.value = Symbol;
4500         defineProperty(global, 'Symbol', descriptor);
4501
4502         // defining `Symbol.for(key)`
4503         descriptor.value = function (key) {
4504                 var uid = prefix.concat(prefix, key, random);
4505                 return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid);
4506         };
4507         defineProperty(Symbol, 'for', descriptor);
4508
4509         // defining `Symbol.keyFor(symbol)`
4510         descriptor.value = function (symbol) {
4511                 if (onlyNonSymbols(symbol))
4512                 throw new TypeError(symbol + ' is not a symbol');
4513                 return hOP.call(source, symbol) ?
4514                 symbol.slice(prefixLength * 2, -random.length) :
4515                 void 0
4516                 ;
4517         };
4518         defineProperty(Symbol, 'keyFor', descriptor);
4519
4520         descriptor.value = function getOwnPropertyDescriptor(o, key) {
4521                 var descriptor = gOPD(o, key);
4522                 if (descriptor && onlySymbols(key)) {
4523                 descriptor.enumerable = propertyIsEnumerable.call(o, key);
4524                 }
4525                 return descriptor;
4526         };
4527         defineProperty(Object, GOPD, descriptor);
4528
4529         descriptor.value = function (proto, descriptors) {
4530                 return arguments.length === 1 || typeof descriptors === "undefined" ?
4531                 create(proto) :
4532                 createWithSymbols(proto, descriptors);
4533         };
4534         defineProperty(Object, 'create', descriptor);
4535
4536         var strictModeSupported = (function(){ 'use strict'; return this; }).call(null) === null;
4537         if (strictModeSupported) {
4538                 descriptor.value = function () {
4539                         var str = toString.call(this);
4540                         return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str;
4541                 };
4542         } else {
4543                 descriptor.value = function () {
4544                         // https://github.com/Financial-Times/polyfill-library/issues/164#issuecomment-486965300
4545                         // Polyfill.io this code is here for the situation where a browser does not
4546                         // support strict mode and is executing `Object.prototype.toString.call(null)`.
4547                         // This code ensures that we return the correct result in that situation however,
4548                         // this code also introduces a bug where it will return the incorrect result for
4549                         // `Object.prototype.toString.call(window)`. We can't have the correct result for
4550                         // both `window` and `null`, so we have opted for `null` as we believe this is the more 
4551                         // common situation. 
4552                         if (this === window) {
4553                                 return '[object Null]';
4554                         }
4555
4556                         var str = toString.call(this);
4557                         return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str;
4558                 };
4559         }
4560         defineProperty(ObjectProto, 'toString', descriptor);
4561
4562         setDescriptor = function (o, key, descriptor) {
4563                 var protoDescriptor = gOPD(ObjectProto, key);
4564                 delete ObjectProto[key];
4565                 defineProperty(o, key, descriptor);
4566                 if (o !== ObjectProto) {
4567                         defineProperty(ObjectProto, key, protoDescriptor);
4568                 }
4569         };
4570
4571 }(Object, 'getOwnPropertySymbols', this));
4572
4573 }
4574
4575 if (!("Symbol"in this&&"hasInstance"in this.Symbol
4576 )) {
4577
4578 // Symbol.hasInstance
4579 /* global Symbol */
4580 Object.defineProperty(Symbol, 'hasInstance', { value: Symbol('hasInstance') });
4581
4582 }
4583
4584 if (!("Symbol"in this&&"isConcatSpreadable"in this.Symbol
4585 )) {
4586
4587 // Symbol.isConcatSpreadable
4588 /* global Symbol */
4589 Object.defineProperty(Symbol, 'isConcatSpreadable', { value: Symbol('isConcatSpreadable') });
4590
4591 }
4592
4593 if (!("Symbol"in this&&"iterator"in this.Symbol
4594 )) {
4595
4596 // Symbol.iterator
4597 /* global Symbol */
4598 Object.defineProperty(Symbol, 'iterator', { value: Symbol('iterator') });
4599
4600 }
4601
4602
4603 // _ESAbstract.GetIterator
4604 /* global GetMethod, Symbol, Call, Type, GetV */
4605 // 7.4.1. GetIterator ( obj [ , method ] )
4606 // The abstract operation GetIterator with argument obj and optional argument method performs the following steps:
4607 function GetIterator(obj /*, method */) { // eslint-disable-line no-unused-vars
4608         // 1. If method is not present, then
4609                 // a. Set method to ? GetMethod(obj, @@iterator).
4610         var method = arguments.length > 1 ? arguments[1] : GetMethod(obj, Symbol.iterator);
4611         // 2. Let iterator be ? Call(method, obj).
4612         var iterator = Call(method, obj);
4613         // 3. If Type(iterator) is not Object, throw a TypeError exception.
4614         if (Type(iterator) !== 'object') {
4615                 throw new TypeError('bad iterator');
4616         }
4617         // 4. Let nextMethod be ? GetV(iterator, "next").
4618         var nextMethod = GetV(iterator, "next");
4619         // 5. Let iteratorRecord be Record {[[Iterator]]: iterator, [[NextMethod]]: nextMethod, [[Done]]: false}.
4620         var iteratorRecord = Object.create(null);
4621         iteratorRecord['[[Iterator]]'] = iterator;
4622         iteratorRecord['[[NextMethod]]'] = nextMethod;
4623         iteratorRecord['[[Done]]'] = false;
4624         // 6. Return iteratorRecord.
4625         return iteratorRecord;
4626 }
4627 if (!("Symbol"in this&&"match"in this.Symbol
4628 )) {
4629
4630 // Symbol.match
4631 /* global Symbol */
4632 Object.defineProperty(Symbol, 'match', { value: Symbol('match') });
4633
4634 }
4635
4636 if (!("Symbol"in this&&"replace"in this.Symbol
4637 )) {
4638
4639 // Symbol.replace
4640 /* global Symbol */
4641 Object.defineProperty(Symbol, 'replace', { value: Symbol('replace') });
4642
4643 }
4644
4645 if (!("Symbol"in this&&"search"in this.Symbol
4646 )) {
4647
4648 // Symbol.search
4649 /* global Symbol */
4650 Object.defineProperty(Symbol, 'search', { value: Symbol('search') });
4651
4652 }
4653
4654 if (!("Symbol"in this&&"species"in this.Symbol
4655 )) {
4656
4657 // Symbol.species
4658 /* global Symbol */
4659 Object.defineProperty(Symbol, 'species', { value: Symbol('species') });
4660
4661 }
4662
4663 if (!("Map"in this&&function(t){try{var n=new Map([[1,1],[2,2]])
4664 return 0===Map.length&&2===n.size&&"Symbol"in t&&"iterator"in Symbol&&"function"==typeof n[Symbol.iterator]}catch(i){return!1}}(this)
4665 )) {
4666
4667 // Map
4668 /* global CreateIterResultObject, CreateMethodProperty, GetIterator, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Type, Symbol */
4669 (function (global) {
4670         var supportsGetters = (function () {
4671                 try {
4672                         var a = {};
4673                         Object.defineProperty(a, 't', {
4674                                 configurable: true,
4675                                 enumerable: false,
4676                                 get: function () {
4677                                         return true;
4678                                 },
4679                                 set: undefined
4680                         });
4681                         return !!a.t;
4682                 } catch (e) {
4683                         return false;
4684                 }
4685         }());
4686
4687         // 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.
4688         var undefMarker = Symbol('undef');
4689         // 23.1.1.1 Map ( [ iterable ] )
4690         var Map = function Map(/* iterable */) {
4691                 // 1. If NewTarget is undefined, throw a TypeError exception.
4692                 if (!(this instanceof Map)) {
4693                         throw new TypeError('Constructor Map requires "new"');
4694                 }
4695                 // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, "%MapPrototype%", « [[MapData]] »).
4696                 var map = OrdinaryCreateFromConstructor(this, Map.prototype, {
4697                         _keys: [],
4698                         _values: [],
4699                         _size: 0,
4700                         _es6Map: true
4701                 });
4702
4703                 // 3. Set map.[[MapData]] to a new empty List.
4704                 // Polyfill.io - This step was done as part of step two.
4705
4706                 // 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.
4707                 if (!supportsGetters) {
4708                         Object.defineProperty(map, 'size', {
4709                                 configurable: true,
4710                                 enumerable: false,
4711                                 writable: true,
4712                                 value: 0
4713                         });
4714                 }
4715
4716                 // 4. If iterable is not present, let iterable be undefined.
4717                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
4718
4719                 // 5. If iterable is either undefined or null, return map.
4720                 if (iterable === null || iterable === undefined) {
4721                         return map;
4722                 }
4723
4724                 // 6. Let adder be ? Get(map, "set").
4725                 var adder = map.set;
4726
4727                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
4728                 if (!IsCallable(adder)) {
4729                         throw new TypeError("Map.prototype.set is not a function");
4730                 }
4731
4732                 // 8. Let iteratorRecord be ? GetIterator(iterable).
4733                 try {
4734                         var iteratorRecord = GetIterator(iterable);
4735                         // 9. Repeat,
4736                         while (true) {
4737                                 // a. Let next be ? IteratorStep(iteratorRecord).
4738                                 var next = IteratorStep(iteratorRecord);
4739                                 // b. If next is false, return map.
4740                                 if (next === false) {
4741                                         return map;
4742                                 }
4743                                 // c. Let nextItem be ? IteratorValue(next).
4744                                 var nextItem = IteratorValue(next);
4745                                 // d. If Type(nextItem) is not Object, then
4746                                 if (Type(nextItem) !== 'object') {
4747                                         // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
4748                                         try {
4749                                                 throw new TypeError('Iterator value ' + nextItem + ' is not an entry object');
4750                                         } catch (error) {
4751                                                 // ii. Return ? IteratorClose(iteratorRecord, error).
4752                                                 return IteratorClose(iteratorRecord, error);
4753                                         }
4754                                 }
4755                                 try {
4756                                         // Polyfill.io - The try catch accounts for steps: f, h, and j.
4757
4758                                         // e. Let k be Get(nextItem, "0").
4759                                         var k = nextItem[0];
4760                                         // f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
4761                                         // g. Let v be Get(nextItem, "1").
4762                                         var v = nextItem[1];
4763                                         // h. If v is an abrupt completion, return ? IteratorClose(iteratorRecord, v).
4764                                         // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).
4765                                         adder.call(map, k, v);
4766                                 } catch (e) {
4767                                         // j. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
4768                                         return IteratorClose(iteratorRecord, e);
4769                                 }
4770                         }
4771                 } catch (e) {
4772                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
4773                         if (Array.isArray(iterable) ||
4774                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
4775                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
4776                                 (!!iterable.callee)) {
4777                                 var index;
4778                                 var length = iterable.length;
4779                                 for (index = 0; index < length; index++) {
4780                                         adder.call(map, iterable[index][0], iterable[index][1]);
4781                                 }
4782                         }
4783                 }
4784                 return map;
4785         };
4786
4787         // 23.1.2.1. Map.prototype
4788         // The initial value of Map.prototype is the intrinsic object %MapPrototype%.
4789         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
4790         Object.defineProperty(Map, 'prototype', {
4791                 configurable: false,
4792                 enumerable: false,
4793                 writable: false,
4794                 value: {}
4795         });
4796
4797         // 23.1.2.2 get Map [ @@species ]
4798         if (supportsGetters) {
4799                 Object.defineProperty(Map, Symbol.species, {
4800                         configurable: true,
4801                         enumerable: false,
4802                         get: function () {
4803                                 // 1. Return the this value.
4804                                 return this;
4805                         },
4806                         set: undefined
4807                 });
4808         } else {
4809                 CreateMethodProperty(Map, Symbol.species, Map);
4810         }
4811
4812         // 23.1.3.1 Map.prototype.clear ( )
4813         CreateMethodProperty(Map.prototype, 'clear', function clear() {
4814                         // 1. Let M be the this value.
4815                         var M = this;
4816                         // 2. If Type(M) is not Object, throw a TypeError exception.
4817                         if (Type(M) !== 'object') {
4818                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4819                         }
4820                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4821                         if (M._es6Map !== true) {
4822                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4823                         }
4824                         // 4. Let entries be the List that is M.[[MapData]].
4825                         var entries = M._keys;
4826                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4827                         for (var i = 0; i < entries.length; i++) {
4828                                 // 5.a. Set p.[[Key]] to empty.
4829                                 M._keys[i] = undefMarker;
4830                                 // 5.b. Set p.[[Value]] to empty.
4831                                 M._values[i] = undefMarker;
4832                         }
4833                         this._size = 0;
4834                         if (!supportsGetters) {
4835                                 this.size = this._size;
4836                         }
4837                         // 6. Return undefined.
4838                         return undefined;
4839                 }
4840         );
4841
4842         // 23.1.3.2. Map.prototype.constructor
4843         CreateMethodProperty(Map.prototype, 'constructor', Map);
4844
4845         // 23.1.3.3. Map.prototype.delete ( key )
4846         CreateMethodProperty(Map.prototype, 'delete', function (key) {
4847                         // 1. Let M be the this value.
4848                         var M = this;
4849                         // 2. If Type(M) is not Object, throw a TypeError exception.
4850                         if (Type(M) !== 'object') {
4851                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4852                         }
4853                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4854                         if (M._es6Map !== true) {
4855                                 throw new TypeError('Method Map.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
4856                         }
4857                         // 4. Let entries be the List that is M.[[MapData]].
4858                         var entries = M._keys;
4859                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4860                         for (var i = 0; i < entries.length; i++) {
4861                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then
4862                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4863                                         // i. Set p.[[Key]] to empty.
4864                                         this._keys[i] = undefMarker;
4865                                         // ii. Set p.[[Value]] to empty.
4866                                         this._values[i] = undefMarker;
4867                                         this._size = --this._size;
4868                                         if (!supportsGetters) {
4869                                                 this.size = this._size;
4870                                         }
4871                                         // iii. Return true.
4872                                         return true;
4873                                 }
4874                         }
4875                         // 6. Return false.
4876                         return false;
4877                 }
4878         );
4879
4880         // 23.1.3.4. Map.prototype.entries ( )
4881         CreateMethodProperty(Map.prototype, 'entries', function entries () {
4882                         // 1. Let M be the this value.
4883                         var M = this;
4884                         // 2. Return ? CreateMapIterator(M, "key+value").
4885                         return CreateMapIterator(M, 'key+value');
4886                 }
4887         );
4888
4889         // 23.1.3.5. Map.prototype.forEach ( callbackfn [ , thisArg ] )
4890         CreateMethodProperty(Map.prototype, 'forEach', function (callbackFn) {
4891                         // 1. Let M be the this value.
4892                         var M = this;
4893                         // 2. If Type(M) is not Object, throw a TypeError exception.
4894                         if (Type(M) !== 'object') {
4895                                 throw new TypeError('Method Map.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(M));
4896                         }
4897                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4898                         if (M._es6Map !== true) {
4899                                 throw new TypeError('Method Map.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(M));
4900                         }
4901                         // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
4902                         if (!IsCallable(callbackFn)) {
4903                                 throw new TypeError(Object.prototype.toString.call(callbackFn) + ' is not a function.');
4904                         }
4905                         // 5. If thisArg is present, let T be thisArg; else let T be undefined.
4906                         if (arguments[1]) {
4907                                 var T = arguments[1];
4908                         }
4909                         // 6. Let entries be the List that is M.[[MapData]].
4910                         var entries = M._keys;
4911                         // 7. For each Record {[[Key]], [[Value]]} e that is an element of entries, in original key insertion order, do
4912                         for (var i = 0; i < entries.length; i++) {
4913                                 // a. If e.[[Key]] is not empty, then
4914                                 if (M._keys[i] !== undefMarker && M._values[i] !== undefMarker ) {
4915                                         // i. Perform ? Call(callbackfn, T, « e.[[Value]], e.[[Key]], M »).
4916                                         callbackFn.call(T, M._values[i], M._keys[i], M);
4917                                 }
4918                         }
4919                         // 8. Return undefined.
4920                         return undefined;
4921                 }
4922         );
4923
4924         // 23.1.3.6. Map.prototype.get ( key )
4925         CreateMethodProperty(Map.prototype, 'get', function get(key) {
4926                         // 1. Let M be the this value.
4927                         var M = this;
4928                         // 2. If Type(M) is not Object, throw a TypeError exception.
4929                         if (Type(M) !== 'object') {
4930                                 throw new TypeError('Method Map.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
4931                         }
4932                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4933                         if (M._es6Map !== true) {
4934                                 throw new TypeError('Method Map.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
4935                         }
4936                         // 4. Let entries be the List that is M.[[MapData]].
4937                         var entries = M._keys;
4938                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4939                         for (var i = 0; i < entries.length; i++) {
4940                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return p.[[Value]].
4941                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4942                                         return M._values[i];
4943                                 }
4944                         }
4945                         // 6. Return undefined.
4946                         return undefined;
4947                 });
4948
4949         // 23.1.3.7. Map.prototype.has ( key )
4950         CreateMethodProperty(Map.prototype, 'has', function has (key) {
4951                         // 1. Let M be the this value.
4952                         var M = this;
4953                         // 2. If Type(M) is not Object, throw a TypeError exception.
4954                         if (typeof M !== 'object') {
4955                                 throw new TypeError('Method Map.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
4956                         }
4957                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4958                         if (M._es6Map !== true) {
4959                                 throw new TypeError('Method Map.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
4960                         }
4961                         // 4. Let entries be the List that is M.[[MapData]].
4962                         var entries = M._keys;
4963                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4964                         for (var i = 0; i < entries.length; i++) {
4965                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return true.
4966                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
4967                                         return true;
4968                                 }
4969                         }
4970                         // 6. Return false.
4971                         return false;
4972                 });
4973
4974         // 23.1.3.8. Map.prototype.keys ( )
4975         CreateMethodProperty(Map.prototype, 'keys', function keys () {
4976                         // 1. Let M be the this value.
4977                         var M = this;
4978                         // 2. Return ? CreateMapIterator(M, "key").
4979                         return CreateMapIterator(M, "key");
4980                 });
4981
4982         // 23.1.3.9. Map.prototype.set ( key, value )
4983         CreateMethodProperty(Map.prototype, 'set', function set(key, value) {
4984                         // 1. Let M be the this value.
4985                         var M = this;
4986                         // 2. If Type(M) is not Object, throw a TypeError exception.
4987                         if (Type(M) !== 'object') {
4988                                 throw new TypeError('Method Map.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
4989                         }
4990                         // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
4991                         if (M._es6Map !== true) {
4992                                 throw new TypeError('Method Map.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
4993                         }
4994                         // 4. Let entries be the List that is M.[[MapData]].
4995                         var entries = M._keys;
4996                         // 5. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
4997                         for (var i = 0; i < entries.length; i++) {
4998                                 // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then
4999                                 if (M._keys[i] !== undefMarker && SameValueZero(M._keys[i], key)) {
5000                                         // i. Set p.[[Value]] to value.
5001                                         M._values[i] = value;
5002                                         // Return M.
5003                                         return M;
5004                                 }
5005                         }
5006                         // 6. If key is -0, let key be +0.
5007                         if (key === -0) {
5008                                 key = 0;
5009                         }
5010                         // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.
5011                         var p = {};
5012                         p['[[Key]]'] = key;
5013                         p['[[Value]]'] = value;
5014                         // 8. Append p as the last element of entries.
5015                         M._keys.push(p['[[Key]]']);
5016                         M._values.push(p['[[Value]]']);
5017                         ++M._size;
5018                         if (!supportsGetters) {
5019                                 M.size = M._size;
5020                         }
5021                         // 9. Return M.
5022                         return M;
5023                 });
5024
5025         // 23.1.3.10. get Map.prototype.size
5026         if (supportsGetters) {
5027                 Object.defineProperty(Map.prototype, 'size', {
5028                         configurable: true,
5029                         enumerable: false,
5030                         get: function () {
5031                                 // 1. Let M be the this value.
5032                                 var M = this;
5033                                 // 2. If Type(M) is not Object, throw a TypeError exception.
5034                                 if (Type(M) !== 'object') {
5035                                         throw new TypeError('Method Map.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(M));
5036                                 }
5037                                 // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.
5038                                 if (M._es6Map !== true) {
5039                                         throw new TypeError('Method Map.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(M));
5040                                 }
5041                                 // 4. Let entries be the List that is M.[[MapData]].
5042                                 var entries = M._keys;
5043                                 // 5. Let count be 0.
5044                                 var count = 0;
5045                                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
5046                                 for (var i = 0; i < entries.length; i++) {
5047                                         // a. If p.[[Key]] is not empty, set count to count+1.
5048                                         if (M._keys[i] !== undefMarker) {
5049                                                 count = count + 1;
5050                                         }
5051                                 }
5052                                 // 7. Return count.
5053                                 return count;
5054                         },
5055                         set: undefined
5056                 });
5057         }
5058
5059         // 23.1.3.11. Map.prototype.values ( )
5060         CreateMethodProperty(Map.prototype, 'values', function values () {
5061                         // 1. Let M be the this value.
5062                         var M = this;
5063                         // 2. Return ? CreateMapIterator(M, "value").
5064                         return CreateMapIterator(M, 'value');
5065                 }
5066         );
5067
5068         // 23.1.3.12. Map.prototype [ @@iterator ] ( )
5069         // The initial value of the @@iterator property is the same function object as the initial value of the entries property.
5070         CreateMethodProperty(Map.prototype, Symbol.iterator, Map.prototype.entries);
5071
5072         // 23.1.3.13. Map.prototype [ @@toStringTag ]
5073         // The initial value of the @@toStringTag property is the String value "Map".
5074         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5075
5076         // 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.
5077         if (!('name' in Map)) {
5078                 // 19.2.4.2 name
5079                 Object.defineProperty(Map, 'name', {
5080                         configurable: true,
5081                         enumerable: false,
5082                         writable: false,
5083                         value: 'Map'
5084                 });
5085         }
5086
5087         // 23.1.5.1. CreateMapIterator ( map, kind )
5088         function CreateMapIterator(map, kind) {
5089                 // 1. If Type(map) is not Object, throw a TypeError exception.
5090                 if (Type(map) !== 'object') {
5091                         throw new TypeError('createMapIterator called on incompatible receiver ' + Object.prototype.toString.call(map));
5092                 }
5093                 // 2. If map does not have a [[MapData]] internal slot, throw a TypeError exception.
5094                 if (map._es6Map !== true) {
5095                         throw new TypeError('createMapIterator called on incompatible receiver ' + Object.prototype.toString.call(map));
5096                 }
5097                 // 3. Let iterator be ObjectCreate(%MapIteratorPrototype%, « [[Map]], [[MapNextIndex]], [[MapIterationKind]] »).
5098                 var iterator = Object.create(MapIteratorPrototype);
5099                 // 4. Set iterator.[[Map]] to map.
5100                 Object.defineProperty(iterator, '[[Map]]', {
5101                         configurable: true,
5102                         enumerable: false,
5103                         writable: true,
5104                         value: map
5105                 });
5106                 // 5. Set iterator.[[MapNextIndex]] to 0.
5107                 Object.defineProperty(iterator, '[[MapNextIndex]]', {
5108                         configurable: true,
5109                         enumerable: false,
5110                         writable: true,
5111                         value: 0
5112                 });
5113                 // 6. Set iterator.[[MapIterationKind]] to kind.
5114                 Object.defineProperty(iterator, '[[MapIterationKind]]', {
5115                         configurable: true,
5116                         enumerable: false,
5117                         writable: true,
5118                         value: kind
5119                 });
5120                 // 7. Return iterator.
5121                 return iterator;
5122         }
5123
5124         // 23.1.5.2. The %MapIteratorPrototype% Object
5125         var MapIteratorPrototype = {};
5126         // Polyfill.io - We use this as a quick way to check if an object is a Map Iterator instance.
5127         Object.defineProperty(MapIteratorPrototype, 'isMapIterator', {
5128                 configurable: false,
5129                 enumerable: false,
5130                 writable: false,
5131                 value: true
5132         });
5133
5134         // 23.1.5.2.1. %MapIteratorPrototype%.next ( )
5135         CreateMethodProperty(MapIteratorPrototype, 'next', function next() {
5136                         // 1. Let O be the this value.
5137                         var O = this;
5138                         // 2. If Type(O) is not Object, throw a TypeError exception.
5139                         if (Type(O) !== 'object') {
5140                                 throw new TypeError('Method %MapIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5141                         }
5142                         // 3. If O does not have all of the internal slots of a Map Iterator Instance (23.1.5.3), throw a TypeError exception.
5143                         if (!O.isMapIterator) {
5144                                 throw new TypeError('Method %MapIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5145                         }
5146                         // 4. Let m be O.[[Map]].
5147                         var m = O['[[Map]]'];
5148                         // 5. Let index be O.[[MapNextIndex]].
5149                         var index = O['[[MapNextIndex]]'];
5150                         // 6. Let itemKind be O.[[MapIterationKind]].
5151                         var itemKind = O['[[MapIterationKind]]'];
5152                         // 7. If m is undefined, return CreateIterResultObject(undefined, true).
5153                         if (m === undefined) {
5154                                 return CreateIterResultObject(undefined, true);
5155                         }
5156                         // 8. Assert: m has a [[MapData]] internal slot.
5157                         if (!m._es6Map) {
5158                                 throw new Error(Object.prototype.toString.call(m) + ' has a [[MapData]] internal slot.');
5159                         }
5160                         // 9. Let entries be the List that is m.[[MapData]].
5161                         var entries = m._keys;
5162                         // 10. Let numEntries be the number of elements of entries.
5163                         var numEntries = entries.length;
5164                         // 11. NOTE: numEntries must be redetermined each time this method is evaluated.
5165                         // 12. Repeat, while index is less than numEntries,
5166                         while (index < numEntries) {
5167                                 // a. Let e be the Record {[[Key]], [[Value]]} that is the value of entries[index].
5168                                 var e = Object.create(null);
5169                                 e['[[Key]]'] = m._keys[index];
5170                                 e['[[Value]]'] = m._values[index];
5171                                 // b. Set index to index+1.
5172                                 index = index + 1;
5173                                 // c. Set O.[[MapNextIndex]] to index.
5174                                 O['[[MapNextIndex]]'] = index;
5175                                 // d. If e.[[Key]] is not empty, then
5176                                 if (e['[[Key]]'] !== undefMarker) {
5177                                         // i. If itemKind is "key", let result be e.[[Key]].
5178                                         if (itemKind === 'key') {
5179                                                 var result = e['[[Key]]'];
5180                                                 // ii. Else if itemKind is "value", let result be e.[[Value]].
5181                                         } else if (itemKind === 'value') {
5182                                                 result = e['[[Value]]'];
5183                                                 // iii. Else,
5184                                         } else {
5185                                                 // 1. Assert: itemKind is "key+value".
5186                                                 if (itemKind !== 'key+value') {
5187                                                         throw new Error();
5188                                                 }
5189                                                 // 2. Let result be CreateArrayFromList(« e.[[Key]], e.[[Value]] »).
5190                                                 result = [
5191                                                         e['[[Key]]'],
5192                                                         e['[[Value]]']
5193                                                 ];
5194                                         }
5195                                         // iv. Return CreateIterResultObject(result, false).
5196                                         return CreateIterResultObject(result, false);
5197                                 }
5198                         }
5199                         // 13. Set O.[[Map]] to undefined.
5200                         O['[[Map]]'] = undefined;
5201                         // 14. Return CreateIterResultObject(undefined, true).
5202                         return CreateIterResultObject(undefined, true);
5203                 }
5204         );
5205
5206         // 23.1.5.2.2 %MapIteratorPrototype% [ @@toStringTag ]
5207         // The initial value of the @@toStringTag property is the String value "Map Iterator".
5208         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5209
5210         CreateMethodProperty(MapIteratorPrototype, Symbol.iterator, function iterator() {
5211                         return this;
5212                 }
5213         );
5214
5215         // Export the object
5216         try {
5217                 CreateMethodProperty(global, 'Map', Map);
5218         } catch (e) {
5219                 // IE8 throws an error here if we set enumerable to false.
5220                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
5221                 global['Map'] = Map;
5222         }
5223 }(this));
5224
5225 }
5226
5227 if (!("Set"in this&&function(){try{var t=new Set([1,2])
5228 return 0===Set.length&&2===t.size&&"Symbol"in this&&"iterator"in Symbol&&"function"==typeof t[Symbol.iterator]}catch(e){return!1}}()
5229 )) {
5230
5231 // Set
5232 /* global CreateIterResultObject, CreateMethodProperty, GetIterator, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Symbol */
5233 (function (global) {
5234         var supportsGetters = (function () {
5235                 try {
5236                         var a = {};
5237                         Object.defineProperty(a, 't', {
5238                                 configurable: true,
5239                                 enumerable: false,
5240                                 get: function () {
5241                                         return true;
5242                                 },
5243                                 set: undefined
5244                         });
5245                         return !!a.t;
5246                 } catch (e) {
5247                         return false;
5248                 }
5249         }());
5250
5251         // 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.
5252         var undefMarker = Symbol('undef');
5253         // 23.2.1.1. Set ( [ iterable ] )
5254         var Set = function Set(/* iterable */) {
5255                 // 1. If NewTarget is undefined, throw a TypeError exception.
5256                 if (!(this instanceof Set)) {
5257                         throw new TypeError('Constructor Set requires "new"');
5258                 }
5259                 // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, "%SetPrototype%", « [[SetData]] »).
5260                 var set = OrdinaryCreateFromConstructor(this, Set.prototype, {
5261                         _values: [],
5262                         _size: 0,
5263                         _es6Set: true
5264                 });
5265
5266                 // 3. Set set.[[SetData]] to a new empty List.
5267                 // Polyfill.io - This step was done as part of step two.
5268
5269                 // 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.
5270                 if (!supportsGetters) {
5271                         Object.defineProperty(set, 'size', {
5272                                 configurable: true,
5273                                 enumerable: false,
5274                                 writable: true,
5275                                 value: 0
5276                         });
5277                 }
5278
5279                 // 4. If iterable is not present, let iterable be undefined.
5280                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
5281
5282                 // 5. If iterable is either undefined or null, return set.
5283                 if (iterable === null || iterable === undefined) {
5284                         return set;
5285                 }
5286
5287                 // 6. Let adder be ? Get(set, "add").
5288                 var adder = set.add;
5289                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
5290                 if (!IsCallable(adder)) {
5291                         throw new TypeError("Set.prototype.add is not a function");
5292                 }
5293
5294                 try {
5295                         // 8. Let iteratorRecord be ? GetIterator(iterable).
5296                         var iteratorRecord = GetIterator(iterable);
5297                         // 9. Repeat,
5298                         while (true) {
5299                                 // a. Let next be ? IteratorStep(iteratorRecord).
5300                                 var next = IteratorStep(iteratorRecord);
5301                                 // b. If next is false, return set.
5302                                 if (next === false) {
5303                                         return set;
5304                                 }
5305                                 // c. Let nextValue be ? IteratorValue(next).
5306                                 var nextValue = IteratorValue(next);
5307                                 // d. Let status be Call(adder, set, « nextValue.[[Value]] »).
5308                                 try {
5309                                         adder.call(set, nextValue);
5310                                 } catch (e) {
5311                                         // e. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
5312                                         return IteratorClose(iteratorRecord, e);
5313                                 }
5314                         }
5315                 } catch (e) {
5316                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
5317                         if (Array.isArray(iterable) ||
5318                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
5319                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
5320                                 (!!iterable.callee)) {
5321                                 var index;
5322                                 var length = iterable.length;
5323                                 for (index = 0; index < length; index++) {
5324                                         adder.call(set, iterable[index]);
5325                                 }
5326                         } else {
5327                                 throw (e);
5328                         }
5329                 }
5330                 return set;
5331         };
5332
5333         // 23.2.2.1. Set.prototype
5334         // The initial value of Set.prototype is the intrinsic %SetPrototype% object.
5335         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
5336         Object.defineProperty(Set, 'prototype', {
5337                 configurable: false,
5338                 enumerable: false,
5339                 writable: false,
5340                 value: {}
5341         });
5342
5343         // 23.2.2.2 get Set [ @@species ]
5344         if (supportsGetters) {
5345                 Object.defineProperty(Set, Symbol.species, {
5346                         configurable: true,
5347                         enumerable: false,
5348                         get: function () {
5349                                 // 1. Return the this value.
5350                                 return this;
5351                         },
5352                         set: undefined
5353                 });
5354         } else {
5355                 CreateMethodProperty(Set, Symbol.species, Set);
5356         }
5357
5358         // 23.2.3.1. Set.prototype.add ( value )
5359         CreateMethodProperty(Set.prototype, 'add', function add(value) {
5360                         // 1. Let S be the this value.
5361                         var S = this;
5362                         // 2. If Type(S) is not Object, throw a TypeError exception.
5363                         if (typeof S !== 'object') {
5364                                 throw new TypeError('Method Set.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
5365                         }
5366                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5367                         if (S._es6Set !== true) {
5368                                 throw new TypeError('Method Set.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
5369                         }
5370                         // 4. Let entries be the List that is S.[[SetData]].
5371                         var entries = S._values;
5372                         // 5. For each e that is an element of entries, do
5373                         for (var i = 0; i < entries.length; i++) {
5374                                 var e = entries[i];
5375                                 // a. If e is not empty and SameValueZero(e, value) is true, then
5376                                 if (e !== undefMarker && SameValueZero(e, value)) {
5377                                         // i. Return S.
5378                                         return S;
5379                                 }
5380                         }
5381                         // 6. If value is -0, let value be +0.
5382                         if (1/value === -Infinity) {
5383                                 value = 0;
5384                         }
5385                         // 7. Append value as the last element of entries.
5386                         S._values.push(value);
5387
5388                         this._size = ++this._size;
5389                         if (!supportsGetters) {
5390                                 this.size = this._size;
5391                         }
5392                         // 8. Return S.
5393                         return S;
5394                 });
5395
5396         // 23.2.3.2. Set.prototype.clear ( )
5397         CreateMethodProperty(Set.prototype, 'clear', function clear() {
5398                         // 1. Let S be the this value.
5399                         var S = this;
5400                         // 2. If Type(S) is not Object, throw a TypeError exception.
5401                         if (typeof S !== 'object') {
5402                                 throw new TypeError('Method Set.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(S));
5403                         }
5404                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5405                         if (S._es6Set !== true) {
5406                                 throw new TypeError('Method Set.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(S));
5407                         }
5408                         // 4. Let entries be the List that is S.[[SetData]].
5409                         var entries = S._values;
5410                         // 5. For each e that is an element of entries, do
5411                         for (var i = 0; i < entries.length; i++) {
5412                                 // a. Replace the element of entries whose value is e with an element whose value is empty.
5413                                 entries[i] = undefMarker;
5414                         }
5415                         this._size = 0;
5416                         if (!supportsGetters) {
5417                                 this.size = this._size;
5418                         }
5419                         // 6. Return undefined.
5420                         return undefined;
5421                 });
5422
5423         // 23.2.3.3. Set.prototype.constructor
5424         CreateMethodProperty(Set.prototype, 'constructor', Set);
5425
5426         // 23.2.3.4. Set.prototype.delete ( value )
5427         CreateMethodProperty(Set.prototype, 'delete', function (value) {
5428                         // 1. Let S be the this value.
5429                         var S = this;
5430                         // 2. If Type(S) is not Object, throw a TypeError exception.
5431                         if (typeof S !== 'object') {
5432                                 throw new TypeError('Method Set.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
5433                         }
5434                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5435                         if (S._es6Set !== true) {
5436                                 throw new TypeError('Method Set.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
5437                         }
5438                         // 4. Let entries be the List that is S.[[SetData]].
5439                         var entries = S._values;
5440                         // 5. For each e that is an element of entries, do
5441                         for (var i = 0; i < entries.length; i++) {
5442                                 var e = entries[i];
5443                                 // a. If e is not empty and SameValueZero(e, value) is true, then
5444                                 if (e !== undefMarker && SameValueZero(e, value)) {
5445                                         // i. Replace the element of entries whose value is e with an element whose value is empty.
5446                                         entries[i] = undefMarker;
5447
5448                                         this._size = --this._size;
5449                                         if (!supportsGetters) {
5450                                                 this.size = this._size;
5451                                         }
5452                                         // ii. Return true.
5453                                         return true;
5454                                 }
5455                         }
5456                         // 6. Return false.
5457                         return false;
5458                 }
5459         );
5460
5461         // 23.2.3.5. Set.prototype.entries ( )
5462         CreateMethodProperty(Set.prototype, 'entries', function entries() {
5463                         // 1. Let S be the this value.
5464                         var S = this;
5465                         // 2. Return ? CreateSetIterator(S, "key+value").
5466                         return CreateSetIterator(S, 'key+value');
5467                 }
5468         );
5469
5470         // 23.2.3.6. Set.prototype.forEach ( callbackfn [ , thisArg ] )
5471         CreateMethodProperty(Set.prototype, 'forEach', function forEach(callbackFn /*[ , thisArg ]*/) {
5472                         // 1. Let S be the this value.
5473                         var S = this;
5474                         // 2. If Type(S) is not Object, throw a TypeError exception.
5475                         if (typeof S !== 'object') {
5476                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5477                         }
5478                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5479                         if (S._es6Set !== true) {
5480                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5481                         }
5482                         // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
5483                         if (!IsCallable(callbackFn)) {
5484                                 throw new TypeError(Object.prototype.toString.call(callbackFn) + ' is not a function.');
5485                         }
5486                         // 5. If thisArg is present, let T be thisArg; else let T be undefined.
5487                         if (arguments[1]) {
5488                                 var T = arguments[1];
5489                         }
5490                         // 6. Let entries be the List that is S.[[SetData]].
5491                         var entries = S._values;
5492                         // 7. For each e that is an element of entries, in original insertion order, do
5493                         for (var i = 0; i < entries.length; i++) {
5494                                 var e = entries[i];
5495                                 // a. If e is not empty, then
5496                                 if (e !== undefMarker) {
5497                                         // i. Perform ? Call(callbackfn, T, « e, e, S »).
5498                                         callbackFn.call(T, e, e, S);
5499                                 }
5500                         }
5501                         // 8. Return undefined.
5502                         return undefined;
5503                 }
5504         );
5505
5506         // 23.2.3.7. Set.prototype.has ( value )
5507         CreateMethodProperty(Set.prototype, 'has', function has(value) {
5508                         // 1. Let S be the this value.
5509                         var S = this;
5510                         // 2. If Type(S) is not Object, throw a TypeError exception.
5511                         if (typeof S !== 'object') {
5512                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5513                         }
5514                         // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5515                         if (S._es6Set !== true) {
5516                                 throw new TypeError('Method Set.prototype.forEach called on incompatible receiver ' + Object.prototype.toString.call(S));
5517                         }
5518                         // 4. Let entries be the List that is S.[[SetData]].
5519                         var entries = S._values;
5520                         // 5. For each e that is an element of entries, do
5521                         for (var i = 0; i < entries.length; i++) {
5522                                 var e = entries[i];
5523                                 // a. If e is not empty and SameValueZero(e, value) is true, return true.
5524                                 if (e !== undefMarker && SameValueZero(e, value)) {
5525                                         return true;
5526                                 }
5527                         }
5528                         // 6. Return false.
5529                         return false;
5530                 }
5531         );
5532
5533         // Polyfill.io - We need to define Set.prototype.values before Set.prototype.keys because keys is a reference to values.
5534         // 23.2.3.10. Set.prototype.values()
5535         var values = function values() {
5536                 // 1. Let S be the this value.
5537                 var S = this;
5538                 // 2. Return ? CreateSetIterator(S, "value").
5539                 return CreateSetIterator(S, "value");
5540         };
5541         CreateMethodProperty(Set.prototype, 'values', values);
5542
5543         // 23.2.3.8 Set.prototype.keys ( )
5544         // The initial value of the keys property is the same function object as the initial value of the values property.
5545         CreateMethodProperty(Set.prototype, 'keys', values);
5546
5547         // 23.2.3.9. get Set.prototype.size
5548         if (supportsGetters) {
5549                 Object.defineProperty(Set.prototype, 'size', {
5550                         configurable: true,
5551                         enumerable: false,
5552                         get: function () {
5553                                 // 1. Let S be the this value.
5554                                 var S = this;
5555                                 // 2. If Type(S) is not Object, throw a TypeError exception.
5556                                 if (typeof S !== 'object') {
5557                                         throw new TypeError('Method Set.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(S));
5558                                 }
5559                                 // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
5560                                 if (S._es6Set !== true) {
5561                                         throw new TypeError('Method Set.prototype.size called on incompatible receiver ' + Object.prototype.toString.call(S));
5562                                 }
5563                                 // 4. Let entries be the List that is S.[[SetData]].
5564                                 var entries = S._values;
5565                                 // 5. Let count be 0.
5566                                 var count = 0;
5567                                 // 6. For each e that is an element of entries, do
5568                                 for (var i = 0; i < entries.length; i++) {
5569                                         var e = entries[i];
5570                                         // a. If e is not empty, set count to count+1.
5571                                         if (e !== undefMarker) {
5572                                                 count = count + 1;
5573                                         }
5574                                 }
5575                                 // 7. Return count.
5576                                 return count;
5577                         },
5578                         set: undefined
5579                 });
5580         }
5581
5582         // 23.2.3.11. Set.prototype [ @@iterator ] ( )
5583         // The initial value of the @@iterator property is the same function object as the initial value of the values property.
5584         CreateMethodProperty(Set.prototype, Symbol.iterator, values);
5585
5586         // 23.2.3.12. Set.prototype [ @@toStringTag ]
5587         // The initial value of the @@toStringTag property is the String value "Set".
5588         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5589
5590         // 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.
5591         if (!('name' in Set)) {
5592                 // 19.2.4.2 name
5593                 Object.defineProperty(Set, 'name', {
5594                         configurable: true,
5595                         enumerable: false,
5596                         writable: false,
5597                         value: 'Set'
5598                 });
5599         }
5600
5601         // 23.2.5.1. CreateSetIterator ( set, kind )
5602         function CreateSetIterator(set, kind) {
5603                 // 1. If Type(set) is not Object, throw a TypeError exception.
5604                 if (typeof set !== 'object') {
5605                         throw new TypeError('createSetIterator called on incompatible receiver ' + Object.prototype.toString.call(set));
5606                 }
5607                 // 2. If set does not have a [[SetData]] internal slot, throw a TypeError exception.
5608                 if (set._es6Set !== true) {
5609                         throw new TypeError('createSetIterator called on incompatible receiver ' + Object.prototype.toString.call(set));
5610                 }
5611                 // 3. Let iterator be ObjectCreate(%SetIteratorPrototype%, « [[IteratedSet]], [[SetNextIndex]], [[SetIterationKind]] »).
5612                 var iterator = Object.create(SetIteratorPrototype);
5613                 // 4. Set iterator.[[IteratedSet]] to set.
5614                 Object.defineProperty(iterator, '[[IteratedSet]]', {
5615                         configurable: true,
5616                         enumerable: false,
5617                         writable: true,
5618                         value: set
5619                 });
5620                 // 5. Set iterator.[[SetNextIndex]] to 0.
5621                 Object.defineProperty(iterator, '[[SetNextIndex]]', {
5622                         configurable: true,
5623                         enumerable: false,
5624                         writable: true,
5625                         value: 0
5626                 });
5627                 // 6. Set iterator.[[SetIterationKind]] to kind.
5628                 Object.defineProperty(iterator, '[[SetIterationKind]]', {
5629                         configurable: true,
5630                         enumerable: false,
5631                         writable: true,
5632                         value: kind
5633                 });
5634                 // 7. Return iterator.
5635                 return iterator;
5636         }
5637
5638         // 23.2.5.2. The %SetIteratorPrototype% Object
5639         var SetIteratorPrototype = {};
5640         //Polyfill.io - We add this property to help us identify what is a set iterator.
5641         Object.defineProperty(SetIteratorPrototype, 'isSetIterator', {
5642                 configurable: false,
5643                 enumerable: false,
5644                 writable: false,
5645                 value: true
5646         });
5647
5648         // 23.2.5.2.1. %SetIteratorPrototype%.next ( )
5649         CreateMethodProperty(SetIteratorPrototype, 'next', function next() {
5650                 // 1. Let O be the this value.
5651                 var O = this;
5652                 // 2. If Type(O) is not Object, throw a TypeError exception.
5653                 if (typeof O !== 'object') {
5654                         throw new TypeError('Method %SetIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5655                 }
5656                 // 3. If O does not have all of the internal slots of a Set Iterator Instance (23.2.5.3), throw a TypeError exception.
5657                 if (!O.isSetIterator) {
5658                         throw new TypeError('Method %SetIteratorPrototype%.next called on incompatible receiver ' + Object.prototype.toString.call(O));
5659                 }
5660                 // 4. Let s be O.[[IteratedSet]].
5661                 var s = O['[[IteratedSet]]'];
5662                 // 5. Let index be O.[[SetNextIndex]].
5663                 var index = O['[[SetNextIndex]]'];
5664                 // 6. Let itemKind be O.[[SetIterationKind]].
5665                 var itemKind = O['[[SetIterationKind]]'];
5666                 // 7. If s is undefined, return CreateIterResultObject(undefined, true).
5667                 if (s === undefined) {
5668                         return CreateIterResultObject(undefined, true);
5669                 }
5670                 // 8. Assert: s has a [[SetData]] internal slot.
5671                 if (!s._es6Set) {
5672                         throw new Error(Object.prototype.toString.call(s) + ' does not have [[SetData]] internal slot.');
5673                 }
5674                 // 9. Let entries be the List that is s.[[SetData]].
5675                 var entries = s._values;
5676                 // 10. Let numEntries be the number of elements of entries.
5677                 var numEntries = entries.length;
5678                 // 11. NOTE: numEntries must be redetermined each time this method is evaluated.
5679                 // 12. Repeat, while index is less than numEntries,
5680                 while (index < numEntries) {
5681                         // a. Let e be entries[index].
5682                         var e = entries[index];
5683                         // b. Set index to index+1.
5684                         index = index + 1;
5685                         // c. Set O.[[SetNextIndex]] to index.
5686                         O['[[SetNextIndex]]'] = index;
5687                         // d. If e is not empty, then
5688                         if (e !== undefMarker) {
5689                                 // i. If itemKind is "key+value", then
5690                                 if (itemKind === 'key+value') {
5691                                         // 1. Return CreateIterResultObject(CreateArrayFromList(« e, e »), false).
5692                                         return CreateIterResultObject([e, e], false);
5693                                 }
5694                                 // ii. Return CreateIterResultObject(e, false).
5695                                 return CreateIterResultObject(e, false);
5696                         }
5697                 }
5698                 // 13. Set O.[[IteratedSet]] to undefined.
5699                 O['[[IteratedSet]]'] = undefined;
5700                 // 14. Return CreateIterResultObject(undefined, true).
5701                 return CreateIterResultObject(undefined, true);
5702         });
5703
5704         // 23.2.5.2.2. %SetIteratorPrototype% [ @@toStringTag ]
5705         // The initial value of the @@toStringTag property is the String value "Set Iterator".
5706         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
5707
5708         CreateMethodProperty(SetIteratorPrototype, Symbol.iterator, function iterator() {
5709                         return this;
5710                 }
5711         );
5712
5713         // Export the object
5714         try {
5715                 CreateMethodProperty(global, 'Set', Set);
5716         } catch (e) {
5717                 // IE8 throws an error here if we set enumerable to false.
5718                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
5719                 global['Set'] = Set;
5720         }
5721
5722 }(this));
5723
5724 }
5725
5726 if (!("from"in Array&&function(){try{return Array.from({length:-Infinity}),!0}catch(r){return!1}}()
5727 )) {
5728
5729 // Array.from
5730 /* globals
5731         IsCallable, GetMethod, Symbol, IsConstructor, Construct, ArrayCreate, GetIterator, IteratorClose,
5732         ToString, IteratorStep, IteratorValue, Call, CreateDataPropertyOrThrow, ToObject, ToLength, Get, CreateMethodProperty
5733 */
5734 (function () {
5735         var toString = Object.prototype.toString;
5736         var stringMatch = String.prototype.match;
5737         // A cross-realm friendly way to detect if a value is a String object or literal.
5738         function isString(value) {
5739                 if (typeof value === 'string') { return true; }
5740                 if (typeof value !== 'object') { return false; }
5741                 return toString.call(value) === '[object String]';
5742         }
5743
5744         // 22.1.2.1. Array.from ( items [ , mapfn [ , thisArg ] ] )
5745         CreateMethodProperty(Array, 'from', function from(items /* [ , mapfn [ , thisArg ] ] */) { // eslint-disable-line no-undef
5746                 // 1. Let C be the this value.
5747                 var C = this;
5748                 // 2. If mapfn is undefined, let mapping be false.
5749                 var mapfn = arguments.length > 1 ? arguments[1] : undefined;
5750                 if (mapfn === undefined) {
5751                         var mapping = false;
5752                         // 3. Else,
5753                 } else {
5754                         // a. If IsCallable(mapfn) is false, throw a TypeError exception.
5755                         if (IsCallable(mapfn) === false) {
5756                                 throw new TypeError(Object.prototype.toString.call(mapfn) + ' is not a function.');
5757                         }
5758                         // b. If thisArg is present, let T be thisArg; else let T be undefined.
5759                         var thisArg = arguments.length > 2 ? arguments[2] : undefined;
5760                         if (thisArg !== undefined) {
5761                                 var T = thisArg;
5762                         } else {
5763                                 T = undefined;
5764                         }
5765                         // c. Let mapping be true.
5766                         mapping = true;
5767
5768                 }
5769                 // 4. Let usingIterator be ? GetMethod(items, @@iterator).
5770                 var usingIterator = GetMethod(items, Symbol.iterator);
5771                 // 5. If usingIterator is not undefined, then
5772                 if (usingIterator !== undefined) {
5773                         // a. If IsConstructor(C) is true, then
5774                         if (IsConstructor(C)) {
5775                                 // i. Let A be ? Construct(C).
5776                                 var A = Construct(C);
5777                                 // b. Else,
5778                         } else {
5779                                 // i. Let A be ! ArrayCreate(0).
5780                                 A = ArrayCreate(0);
5781                         }
5782                         // c. Let iteratorRecord be ? GetIterator(items, usingIterator).
5783                         var iteratorRecord = GetIterator(items, usingIterator);
5784                         // d. Let k be 0.
5785                         var k = 0;
5786                         // e. Repeat,
5787                         while (true) {
5788                                 // i. If k ≥ 2^53-1, then
5789                                 if (k >= (Math.pow(2, 53) - 1)) {
5790                                         // 1. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
5791                                         var error = new TypeError('Iteration count can not be greater than or equal 9007199254740991.');
5792                                         // 2. Return ? IteratorClose(iteratorRecord, error).
5793                                         return IteratorClose(iteratorRecord, error);
5794                                 }
5795                                 // ii. Let Pk be ! ToString(k).
5796                                 var Pk = ToString(k);
5797                                 // iii. Let next be ? IteratorStep(iteratorRecord).
5798                                 var next = IteratorStep(iteratorRecord);
5799                                 // iv. If next is false, then
5800                                 if (next === false) {
5801                                         // 1. Perform ? Set(A, "length", k, true).
5802                                         A["length"] = k;
5803                                         // 2. Return A.
5804                                         return A;
5805                                 }
5806                                 // v. Let nextValue be ? IteratorValue(next).
5807                                 var nextValue = IteratorValue(next);
5808                                 // vi. If mapping is true, then
5809                                 if (mapping) {
5810                                         try {
5811                                                 // Polyfill.io - The try catch accounts for step 2.
5812                                                 // 1. Let mappedValue be Call(mapfn, T, « nextValue, k »).
5813                                                 var mappedValue = Call(mapfn, T, [nextValue, k]);
5814                                                 // 2. If mappedValue is an abrupt completion, return ? IteratorClose(iteratorRecord, mappedValue).
5815                                                 // 3. Let mappedValue be mappedValue.[[Value]].
5816                                         } catch (e) {
5817                                                 return IteratorClose(iteratorRecord, e);
5818                                         }
5819
5820                                         // vii. Else, let mappedValue be nextValue.
5821                                 } else {
5822                                         mappedValue = nextValue;
5823                                 }
5824                                 try {
5825                                         // Polyfill.io - The try catch accounts for step ix.
5826                                         // viii. Let defineStatus be CreateDataPropertyOrThrow(A, Pk, mappedValue).
5827                                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
5828                                         // ix. If defineStatus is an abrupt completion, return ? IteratorClose(iteratorRecord, defineStatus).
5829                                 } catch (e) {
5830                                         return IteratorClose(iteratorRecord, e);
5831                                 }
5832                                 // x. Increase k by 1.
5833                                 k = k + 1;
5834                         }
5835                 }
5836                 // 6. NOTE: items is not an Iterable so assume it is an array-like object.
5837                 // 7. Let arrayLike be ! ToObject(items).
5838                 // Polyfill.io - For Strings we need to split astral symbols into surrogate pairs.
5839                 if (isString(items)) {
5840                         var arrayLike = stringMatch.call(items, /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g) || [];
5841                 } else {
5842                         arrayLike = ToObject(items);
5843                 }
5844                 // 8. Let len be ? ToLength(? Get(arrayLike, "length")).
5845                 var len = ToLength(Get(arrayLike, "length"));
5846                 // 9. If IsConstructor(C) is true, then
5847                 if (IsConstructor(C)) {
5848                         // a. Let A be ? Construct(C, « len »).
5849                         A = Construct(C, [len]);
5850                         // 10. Else,
5851                 } else {
5852                         // a. Let A be ? ArrayCreate(len).
5853                         A = ArrayCreate(len);
5854                 }
5855                 // 11. Let k be 0.
5856                 k = 0;
5857                 // 12. Repeat, while k < len
5858                 while (k < len) {
5859                         // a. Let Pk be ! ToString(k).
5860                         Pk = ToString(k);
5861                         // b. Let kValue be ? Get(arrayLike, Pk).
5862                         var kValue = Get(arrayLike, Pk);
5863                         // c. If mapping is true, then
5864                         if (mapping === true) {
5865                                 // i. Let mappedValue be ? Call(mapfn, T, « kValue, k »).
5866                                 mappedValue = Call(mapfn, T, [kValue, k]);
5867                                 // d. Else, let mappedValue be kValue.
5868                         } else {
5869                                 mappedValue = kValue;
5870                         }
5871                         // e. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
5872                         CreateDataPropertyOrThrow(A, Pk, mappedValue);
5873                         // f. Increase k by 1.
5874                         k = k + 1;
5875                 }
5876                 // 13. Perform ? Set(A, "length", len, true).
5877                 A["length"] = len;
5878                 // 14. Return A.
5879                 return A;
5880         });
5881 }());
5882
5883 }
5884
5885 if (!("Symbol"in this&&"split"in this.Symbol
5886 )) {
5887
5888 // Symbol.split
5889 /* global Symbol */
5890 Object.defineProperty(Symbol, 'split', { value: Symbol('split') });
5891
5892 }
5893
5894 if (!("Symbol"in this&&"toPrimitive"in this.Symbol
5895 )) {
5896
5897 // Symbol.toPrimitive
5898 /* global Symbol */
5899 Object.defineProperty(Symbol, 'toPrimitive', { value: Symbol('toPrimitive') });
5900
5901 }
5902
5903 if (!("Symbol"in this&&"toStringTag"in this.Symbol
5904 )) {
5905
5906 // Symbol.toStringTag
5907 /* global Symbol */
5908 Object.defineProperty(Symbol, 'toStringTag', {
5909         value: Symbol('toStringTag')
5910 });
5911
5912 }
5913
5914
5915 // _Iterator
5916 /* global Symbol */
5917 // A modification of https://github.com/medikoo/es6-iterator
5918 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
5919
5920 var Iterator = (function () { // eslint-disable-line no-unused-vars
5921         var clear = function () {
5922                 this.length = 0;
5923                 return this;
5924         };
5925         var callable = function (fn) {
5926                 if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
5927                 return fn;
5928         };
5929
5930         var Iterator = function (list, context) {
5931                 if (!(this instanceof Iterator)) {
5932                         return new Iterator(list, context);
5933                 }
5934                 Object.defineProperties(this, {
5935                         __list__: {
5936                                 writable: true,
5937                                 value: list
5938                         },
5939                         __context__: {
5940                                 writable: true,
5941                                 value: context
5942                         },
5943                         __nextIndex__: {
5944                                 writable: true,
5945                                 value: 0
5946                         }
5947                 });
5948                 if (!context) return;
5949                 callable(context.on);
5950                 context.on('_add', this._onAdd.bind(this));
5951                 context.on('_delete', this._onDelete.bind(this));
5952                 context.on('_clear', this._onClear.bind(this));
5953         };
5954
5955         Object.defineProperties(Iterator.prototype, Object.assign({
5956                 constructor: {
5957                         value: Iterator,
5958                         configurable: true,
5959                         enumerable: false,
5960                         writable: true
5961                 },
5962                 _next: {
5963                         value: function () {
5964                                 var i;
5965                                 if (!this.__list__) return;
5966                                 if (this.__redo__) {
5967                                         i = this.__redo__.shift();
5968                                         if (i !== undefined) return i;
5969                                 }
5970                                 if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;
5971                                 this._unBind();
5972                         },
5973                         configurable: true,
5974                         enumerable: false,
5975                         writable: true
5976                 },
5977                 next: {
5978                         value: function () {
5979                                 return this._createResult(this._next());
5980                         },
5981                         configurable: true,
5982                         enumerable: false,
5983                         writable: true
5984                 },
5985                 _createResult: {
5986                         value: function (i) {
5987                                 if (i === undefined) return {
5988                                         done: true,
5989                                         value: undefined
5990                                 };
5991                                 return {
5992                                         done: false,
5993                                         value: this._resolve(i)
5994                                 };
5995                         },
5996                         configurable: true,
5997                         enumerable: false,
5998                         writable: true
5999                 },
6000                 _resolve: {
6001                         value: function (i) {
6002                                 return this.__list__[i];
6003                         },
6004                         configurable: true,
6005                         enumerable: false,
6006                         writable: true
6007                 },
6008                 _unBind: {
6009                         value: function () {
6010                                 this.__list__ = null;
6011                                 delete this.__redo__;
6012                                 if (!this.__context__) return;
6013                                 this.__context__.off('_add', this._onAdd.bind(this));
6014                                 this.__context__.off('_delete', this._onDelete.bind(this));
6015                                 this.__context__.off('_clear', this._onClear.bind(this));
6016                                 this.__context__ = null;
6017                         },
6018                         configurable: true,
6019                         enumerable: false,
6020                         writable: true
6021                 },
6022                 toString: {
6023                         value: function () {
6024                                 return '[object Iterator]';
6025                         },
6026                         configurable: true,
6027                         enumerable: false,
6028                         writable: true
6029                 }
6030         }, {
6031                 _onAdd: {
6032                         value: function (index) {
6033                                 if (index >= this.__nextIndex__) return;
6034                                 ++this.__nextIndex__;
6035                                 if (!this.__redo__) {
6036                                         Object.defineProperty(this, '__redo__', {
6037                                                 value: [index],
6038                                                 configurable: true,
6039                                                 enumerable: false,
6040                                                 writable: false
6041                                         });
6042                                         return;
6043                                 }
6044                                 this.__redo__.forEach(function (redo, i) {
6045                                         if (redo >= index) this.__redo__[i] = ++redo;
6046                                 }, this);
6047                                 this.__redo__.push(index);
6048                         },
6049                         configurable: true,
6050                         enumerable: false,
6051                         writable: true
6052                 },
6053                 _onDelete: {
6054                         value: function (index) {
6055                                 var i;
6056                                 if (index >= this.__nextIndex__) return;
6057                                 --this.__nextIndex__;
6058                                 if (!this.__redo__) return;
6059                                 i = this.__redo__.indexOf(index);
6060                                 if (i !== -1) this.__redo__.splice(i, 1);
6061                                 this.__redo__.forEach(function (redo, i) {
6062                                         if (redo > index) this.__redo__[i] = --redo;
6063                                 }, this);
6064                         },
6065                         configurable: true,
6066                         enumerable: false,
6067                         writable: true
6068                 },
6069                 _onClear: {
6070                         value: function () {
6071                                 if (this.__redo__) clear.call(this.__redo__);
6072                                 this.__nextIndex__ = 0;
6073                         },
6074                         configurable: true,
6075                         enumerable: false,
6076                         writable: true
6077                 }
6078         }));
6079
6080         Object.defineProperty(Iterator.prototype, Symbol.iterator, {
6081                 value: function () {
6082                         return this;
6083                 },
6084                 configurable: true,
6085                 enumerable: false,
6086                 writable: true
6087         });
6088         Object.defineProperty(Iterator.prototype, Symbol.toStringTag, {
6089                 value: 'Iterator',
6090                 configurable: false,
6091                 enumerable: false,
6092                 writable: true
6093         });
6094
6095         return Iterator;
6096 }());
6097
6098 // _ArrayIterator
6099 /* global Iterator */
6100 // A modification of https://github.com/medikoo/es6-iterator
6101 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
6102
6103 var ArrayIterator = (function() { // eslint-disable-line no-unused-vars
6104
6105         var ArrayIterator = function(arr, kind) {
6106                 if (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind);
6107                 Iterator.call(this, arr);
6108                 if (!kind) kind = 'value';
6109                 else if (String.prototype.includes.call(kind, 'key+value')) kind = 'key+value';
6110                 else if (String.prototype.includes.call(kind, 'key')) kind = 'key';
6111                 else kind = 'value';
6112                 Object.defineProperty(this, '__kind__', {
6113                         value: kind,
6114                         configurable: false,
6115                         enumerable: false,
6116                         writable: false
6117                 });
6118         };
6119         if (Object.setPrototypeOf) Object.setPrototypeOf(ArrayIterator, Iterator.prototype);
6120
6121         ArrayIterator.prototype = Object.create(Iterator.prototype, {
6122                 constructor: {
6123                         value: ArrayIterator,
6124                         configurable: true,
6125                         enumerable: false,
6126                         writable: true
6127                 },
6128                 _resolve: {
6129                         value: function(i) {
6130                                 if (this.__kind__ === 'value') return this.__list__[i];
6131                                 if (this.__kind__ === 'key+value') return [i, this.__list__[i]];
6132                                 return i;
6133                         },
6134                         configurable: true,
6135                         enumerable: false,
6136                         writable: true
6137                 },
6138                 toString: {
6139                         value: function() {
6140                                 return '[object Array Iterator]';
6141                         },
6142                         configurable: true,
6143                         enumerable: false,
6144                         writable: true
6145                 }
6146         });
6147
6148         return ArrayIterator;
6149 }());
6150 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype.entries
6151 )) {
6152
6153 // Array.prototype.entries
6154 /* global CreateMethodProperty, ToObject */
6155 // 22.1.3.4. Array.prototype.entries ( )
6156 CreateMethodProperty(Array.prototype, 'entries', function entries() {
6157         // 1. Let O be ? ToObject(this value).
6158         var O = ToObject(this);
6159         // 2. Return CreateArrayIterator(O, "key+value").
6160         // TODO: Add CreateArrayIterator
6161         return new ArrayIterator(O, 'key+value');
6162 });
6163
6164 }
6165
6166 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype.keys
6167 )) {
6168
6169 // Array.prototype.keys
6170 /* global CreateMethodProperty, ToObject */
6171 // 22.1.3.14. Array.prototype.keys ( )
6172 CreateMethodProperty(Array.prototype, 'keys', function keys() {
6173         // 1. Let O be ? ToObject(this value).
6174         var O = ToObject(this);
6175         // 2. Return CreateArrayIterator(O, "key").
6176         // TODO: Add CreateArrayIterator.
6177         return new ArrayIterator(O, 'key');
6178 });
6179
6180 }
6181
6182 if (!("values"in Array.prototype
6183 )) {
6184
6185 // Array.prototype.values
6186 /* global CreateMethodProperty, Symbol, ToObject */
6187 // 22.1.3.30/ Array.prototype.values ( )
6188 // Polyfill.io - Firefox, Chrome and Opera have Array.prototype[Symbol.iterator], which is the exact same function as Array.prototype.values.
6189 if ('Symbol' in this && 'iterator' in Symbol && typeof Array.prototype[Symbol.iterator] === 'function') {
6190         CreateMethodProperty(Array.prototype, 'values', Array.prototype[Symbol.iterator]);
6191 } else {
6192         CreateMethodProperty(Array.prototype, 'values', function values () {
6193                 // 1. Let O be ? ToObject(this value).
6194                 var O = ToObject(this);
6195                 // 2. Return CreateArrayIterator(O, "value").
6196                 // TODO: Add CreateArrayIterator
6197                 return new ArrayIterator(O, 'value');
6198         });
6199 }
6200
6201 }
6202
6203 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!Array.prototype[Symbol.iterator]
6204 )) {
6205
6206 // Array.prototype.@@iterator
6207 /* global Symbol, CreateMethodProperty */
6208 // 22.1.3.31. Array.prototype [ @@iterator ] ( )
6209 // The initial value of the @@iterator property is the same function object as the initial value of the  Array.prototype.values property.
6210 CreateMethodProperty(Array.prototype, Symbol.iterator, Array.prototype.values);
6211
6212 }
6213
6214
6215 // _StringIterator
6216 // A modification of https://github.com/medikoo/es6-iterator
6217 // Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
6218
6219 /* global Iterator */
6220
6221 var StringIterator = (function() { // eslint-disable-line no-unused-vars
6222
6223         var StringIterator = function (str) {
6224                 if (!(this instanceof StringIterator)) return new StringIterator(str);
6225                 str = String(str);
6226                 Iterator.call(this, str);
6227                 Object.defineProperty(this, '__length__', {
6228                         value: str.length,
6229                         configurable: false,
6230                         enumerable: false,
6231                         writable: false
6232                 });
6233         };
6234         if (Object.setPrototypeOf) Object.setPrototypeOf(StringIterator, Iterator);
6235
6236         StringIterator.prototype = Object.create(Iterator.prototype, {
6237                 constructor: {
6238                         value: StringIterator,
6239                         configurable: true,
6240                         enumerable: false,
6241                         writable: true
6242                 },
6243                 _next: {
6244                         value: function() {
6245                                 if (!this.__list__) return;
6246                                 if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
6247                                 this._unBind();
6248                         },
6249                         configurable: true,
6250                         enumerable: false,
6251                         writable: true
6252                 },
6253                 _resolve: {
6254                         value: function (i) {
6255                                 var char = this.__list__[i], code;
6256                                 if (this.__nextIndex__ === this.__length__) return char;
6257                                 code = char.charCodeAt(0);
6258                                 if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++];
6259                                 return char;
6260                         },
6261                         configurable: true,
6262                         enumerable: false,
6263                         writable: true
6264                 },
6265                 toString: {
6266                         value: function() {
6267                                 return '[object String Iterator]';
6268                         },
6269                         configurable: true,
6270                         enumerable: false,
6271                         writable: true
6272                 }
6273         });
6274
6275         return StringIterator;
6276 }());
6277 if (!("Symbol"in this&&"iterator"in this.Symbol&&!!String.prototype[Symbol.iterator]
6278 )) {
6279
6280 // String.prototype.@@iterator
6281 /* global CreateMethodProperty, RequireObjectCoercible, ToString, StringIterator, Symbol */
6282 // 21.1.3.29. String.prototype [ @@iterator ] ( )
6283 CreateMethodProperty(String.prototype, Symbol.iterator, function () {
6284         // 1. Let O be ? RequireObjectCoercible(this value).
6285         var O = RequireObjectCoercible(this);
6286         // 2. Let S be ? ToString(O).
6287         var S = ToString(O);
6288         // 3. Return CreateStringIterator(S).
6289         // TODO: Add CreateStringIterator.
6290         return new StringIterator(S);
6291 });
6292
6293 }
6294
6295 if (!("Symbol"in this&&"unscopables"in this.Symbol
6296 )) {
6297
6298 // Symbol.unscopables
6299 /* global Symbol */
6300 Object.defineProperty(Symbol, 'unscopables', { value: Symbol('unscopables') });
6301
6302 }
6303
6304 if (!((function(e){try{if("WeakMap"in e&&0===WeakMap.length){var t={},a=new WeakMap([[t,"test"]])
6305 return"test"===a.get(t)&&!1===a["delete"](0)}return!1}catch(n){return!1}})(this)
6306 )) {
6307
6308 // WeakMap
6309 /* globals Symbol, OrdinaryCreateFromConstructor, IsCallable, GetIterator, IteratorStep, IteratorValue, IteratorClose, Get, Call, CreateMethodProperty, Type, SameValue */
6310 (function (global) {
6311         // 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.
6312         var undefMarker = Symbol('undef');
6313         // 23.3.1.1 WeakMap ( [ iterable ] )
6314         var WeakMap = function WeakMap(/* iterable */) {
6315                 // 1. If NewTarget is undefined, throw a TypeError exception.
6316                 if (!(this instanceof WeakMap)) {
6317                         throw new TypeError('Constructor WeakMap requires "new"');
6318                 }
6319                 // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakMapPrototype%", « [[WeakMapData]] »).
6320                 var map = OrdinaryCreateFromConstructor(this, WeakMap.prototype, {
6321                         _keys: [],
6322                         _values: [],
6323                         _es6WeakMap: true
6324                 });
6325
6326                 // 3. Set map.[[WeakMapData]] to a new empty List.
6327                 // Polyfill.io - This step was done as part of step two.
6328
6329                 // 4. If iterable is not present, let iterable be undefined.
6330                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
6331
6332                 // 5. If iterable is either undefined or null, return map.
6333                 if (iterable === null || iterable === undefined) {
6334                         return map;
6335                 }
6336
6337                 // 6. Let adder be ? Get(map, "set").
6338                 var adder = Get(map, "set");
6339
6340                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
6341                 if (!IsCallable(adder)) {
6342                         throw new TypeError("WeakMap.prototype.set is not a function");
6343                 }
6344
6345                 // 8. Let iteratorRecord be ? GetIterator(iterable).
6346                 try {
6347                         var iteratorRecord = GetIterator(iterable);
6348                         // 9. Repeat,
6349                         while (true) {
6350                                 // a. Let next be ? IteratorStep(iteratorRecord).
6351                                 var next = IteratorStep(iteratorRecord);
6352                                 // b. If next is false, return map.
6353                                 if (next === false) {
6354                                         return map;
6355                                 }
6356                                 // c. Let nextItem be ? IteratorValue(next).
6357                                 var nextItem = IteratorValue(next);
6358                                 // d. If Type(nextItem) is not Object, then
6359                                 if (Type(nextItem) !== 'object') {
6360                                         // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.
6361                                         try {
6362                                                 throw new TypeError('Iterator value ' + nextItem + ' is not an entry object');
6363                                         } catch (error) {
6364                                                 // ii. Return ? IteratorClose(iteratorRecord, error).
6365                                                 return IteratorClose(iteratorRecord, error);
6366                                         }
6367                                 }
6368                                 try {
6369                                         // Polyfill.io - The try catch accounts for steps: f, h, and j.
6370
6371                                         // e. Let k be Get(nextItem, "0").
6372                                         var k = Get(nextItem, "0");
6373                                         // f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
6374                                         // g. Let v be Get(nextItem, "1").
6375                                         var v = Get(nextItem, "1");
6376                                         // h. If v is an abrupt completion, return ? IteratorClose(iteratorRecord, v).
6377                                         // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).
6378                                         Call(adder, map, [k, v]);
6379                                 } catch (e) {
6380                                         // j. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
6381                                         return IteratorClose(iteratorRecord, e);
6382                                 }
6383                         }
6384                 } catch (e) {
6385                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
6386                         if (Array.isArray(iterable) ||
6387                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
6388                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
6389                                 (!!iterable.callee)) {
6390                                 var index;
6391                                 var length = iterable.length;
6392                                 for (index = 0; index < length; index++) {
6393                                         var k = iterable[index][0];
6394                                         var v = iterable[index][1];
6395                                         Call(adder, map, [k, v]);
6396                                 }
6397                         }
6398                 }
6399                 return map;
6400         };
6401
6402         // 23.3.2.1 WeakMap.prototype
6403         // The initial value of WeakMap.prototype is the intrinsic object %WeakMapPrototype%.
6404         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
6405         Object.defineProperty(WeakMap, 'prototype', {
6406                 configurable: false,
6407                 enumerable: false,
6408                 writable: false,
6409                 value: {}
6410         });
6411
6412         // 23.3.3.1 WeakMap.prototype.constructor
6413         CreateMethodProperty(WeakMap.prototype, 'constructor', WeakMap);
6414
6415         // 23.3.3.2 WeakMap.prototype.delete ( key )
6416         CreateMethodProperty(WeakMap.prototype, 'delete', function (key) {
6417                 // 1. Let M be the this value.
6418                 var M = this;
6419                 // 2. If Type(M) is not Object, throw a TypeError exception.
6420                 if (Type(M) !== 'object') {
6421                         throw new TypeError('Method WeakMap.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
6422                 }
6423                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6424                 if (M._es6WeakMap !== true) {
6425                         throw new TypeError('Method WeakMap.prototype.clear called on incompatible receiver ' + Object.prototype.toString.call(M));
6426                 }
6427                 // 4. Let entries be the List that is M.[[WeakMapData]].
6428                 var entries = M._keys;
6429                 // 5. If Type(key) is not Object, return false.
6430                 if (Type(key) !== 'object') {
6431                         return false;
6432                 }
6433                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6434                 for (var i = 0; i < entries.length; i++) {
6435                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then
6436                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6437                                 // i. Set p.[[Key]] to empty.
6438                                 this._keys[i] = undefMarker;
6439                                 // ii. Set p.[[Value]] to empty.
6440                                 this._values[i] = undefMarker;
6441                                 this._size = --this._size;
6442                                 // iii. Return true.
6443                                 return true;
6444                         }
6445                 }
6446                 // 7. Return false.
6447                 return false;
6448         });
6449
6450         // 23.3.3.3 WeakMap.prototype.get ( key )
6451         CreateMethodProperty(WeakMap.prototype, 'get', function get(key) {
6452                 // 1. Let M be the this value.
6453                 var M = this;
6454                 // 2. If Type(M) is not Object, throw a TypeError exception.
6455                 if (Type(M) !== 'object') {
6456                         throw new TypeError('Method WeakMap.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
6457                 }
6458                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6459                 if (M._es6WeakMap !== true) {
6460                         throw new TypeError('Method WeakMap.prototype.get called on incompatible receiver ' + Object.prototype.toString.call(M));
6461                 }
6462                 // 4. Let entries be the List that is M.[[WeakMapData]].
6463                 var entries = M._keys;
6464                 // 5. If Type(key) is not Object, return undefined.
6465                 if (Type(key) !== 'object') {
6466                         return undefined;
6467                 }
6468                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6469                 for (var i = 0; i < entries.length; i++) {
6470                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
6471                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6472                                 return M._values[i];
6473                         }
6474                 }
6475                 // 7. Return undefined.
6476                 return undefined;
6477         });
6478
6479         // 23.3.3.4 WeakMap.prototype.has ( key )
6480         CreateMethodProperty(WeakMap.prototype, 'has', function has(key) {
6481                 // 1. Let M be the this value.
6482                 var M = this;
6483                 // 2. If Type(M) is not Object, throw a TypeError exception.
6484                 if (typeof M !== 'object') {
6485                         throw new TypeError('Method WeakMap.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
6486                 }
6487                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6488                 if (M._es6WeakMap !== true) {
6489                         throw new TypeError('Method WeakMap.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(M));
6490                 }
6491                 // 4. Let entries be the List that is M.[[WeakMapData]].
6492                 var entries = M._keys;
6493                 // 5. If Type(key) is not Object, return false.
6494                 if (Type(key) !== 'object') {
6495                         return false;
6496                 }
6497                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6498                 for (var i = 0; i < entries.length; i++) {
6499                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return true.
6500                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6501                                 return true;
6502                         }
6503                 }
6504                 // 7. Return false.
6505                 return false;
6506         });
6507
6508         // 23.3.3.5 WeakMap.prototype.set ( key, value )
6509         CreateMethodProperty(WeakMap.prototype, 'set', function set(key, value) {
6510                 // 1. Let M be the this value.
6511                 var M = this;
6512                 // 2. If Type(M) is not Object, throw a TypeError exception.
6513                 if (Type(M) !== 'object') {
6514                         throw new TypeError('Method WeakMap.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
6515                 }
6516                 // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.
6517                 if (M._es6WeakMap !== true) {
6518                         throw new TypeError('Method WeakMap.prototype.set called on incompatible receiver ' + Object.prototype.toString.call(M));
6519                 }
6520                 // 4. Let entries be the List that is M.[[WeakMapData]].
6521                 var entries = M._keys;
6522                 // 5. If Type(key) is not Object, throw a TypeError exception.
6523                 if (Type(key) !== 'object') {
6524                         throw new TypeError("Invalid value used as weak map key");
6525                 }
6526                 // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries, do
6527                 for (var i = 0; i < entries.length; i++) {
6528                         // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then
6529                         if (M._keys[i] !== undefMarker && SameValue(M._keys[i], key)) {
6530                                 // i. Set p.[[Value]] to value.
6531                                 M._values[i] = value;
6532                                 // ii. Return M.
6533                                 return M;
6534                         }
6535                 }
6536                 // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.
6537                 var p = {
6538                         '[[Key]]': key,
6539                         '[[Value]]': value
6540                 };
6541                 // 8. Append p as the last element of entries.
6542                 M._keys.push(p['[[Key]]']);
6543                 M._values.push(p['[[Value]]']);
6544                 // 9. Return M.
6545                 return M;
6546         });
6547
6548         // 23.3.3.6 WeakMap.prototype [ @@toStringTag ]
6549         // The initial value of the @@toStringTag property is the String value "WeakMap".
6550         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
6551
6552         // 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.
6553         if (!('name' in WeakMap)) {
6554                 // 19.2.4.2 name
6555                 Object.defineProperty(WeakMap, 'name', {
6556                         configurable: true,
6557                         enumerable: false,
6558                         writable: false,
6559                         value: 'WeakMap'
6560                 });
6561         }
6562
6563         // Export the object
6564         try {
6565                 CreateMethodProperty(global, 'WeakMap', WeakMap);
6566         } catch (e) {
6567                 // IE8 throws an error here if we set enumerable to false.
6568                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
6569                 global['WeakMap'] = WeakMap;
6570         }
6571 }(this));
6572
6573 }
6574
6575 if (!((function(e){try{if("WeakSet"in e&&0===WeakSet.length){var t={},n=new WeakSet([t])
6576 return n.has(t)&&!1===n["delete"](0)}return!1}catch(r){return!1}})(this)
6577 )) {
6578
6579 // WeakSet
6580 /* global Call, CreateMethodProperty, Get, GetIterator, IsArray, IsCallable, IteratorClose, IteratorStep, IteratorValue, OrdinaryCreateFromConstructor, SameValueZero, Type, Symbol */
6581 (function (global) {
6582         // 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.
6583         var undefMarker = Symbol('undef');
6584         // 23.4.1.1. WeakSet ( [ iterable ] )
6585         var WeakSet = function WeakSet() {
6586                 // 1. If NewTarget is undefined, throw a TypeError exception.
6587                 if (!(this instanceof WeakSet)) {
6588                         throw new TypeError('Constructor WeakSet requires "new"');
6589                 }
6590                 // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakSetPrototype%", « [[WeakSetData]] »).
6591                 var set = OrdinaryCreateFromConstructor(this, WeakSet.prototype, {
6592                         _values: [],
6593                         _size: 0,
6594                         _es6WeakSet: true
6595                 });
6596
6597                 // 3. Set set.[[WeakSetData]] to a new empty List.
6598                 // Polyfill.io - This step was done as part of step two.
6599
6600                 // 4. If iterable is not present, let iterable be undefined.
6601                 var iterable = arguments.length > 0 ? arguments[0] : undefined;
6602                 // 5. If iterable is either undefined or null, return set.
6603                 if (iterable === null || iterable === undefined) {
6604                         return set;
6605                 }
6606                 // 6. Let adder be ? Get(set, "add").
6607                 var adder = Get(set, 'add');
6608                 // 7. If IsCallable(adder) is false, throw a TypeError exception.
6609                 if (!IsCallable(adder)) {
6610                         throw new TypeError("WeakSet.prototype.add is not a function");
6611                 }
6612                 try {
6613                         // 8. Let iteratorRecord be ? GetIterator(iterable).
6614                         var iteratorRecord = GetIterator(iterable);
6615                         // 9. Repeat,
6616                         while (true) {
6617                                 // a. Let next be ? IteratorStep(iteratorRecord).
6618                                 var next = IteratorStep(iteratorRecord);
6619                                 // b. If next is false, return set.
6620                                 if (next === false) {
6621                                         return set;
6622                                 }
6623                                 // c. Let nextValue be ? IteratorValue(next).
6624                                 var nextValue = IteratorValue(next);
6625                                 // d. Let status be Call(adder, set, « nextValue »).
6626                                 try {
6627                                         Call(adder, set, [nextValue]);
6628                                 } catch (e) {
6629                                         // e. If status is an abrupt completion, return ? IteratorClose(iteratorRecord, status).
6630                                         return IteratorClose(iteratorRecord, e);
6631                                 }
6632                         }
6633                 } catch (e) {
6634                         // Polyfill.io - For user agents which do not have iteration methods on argument objects or arrays, we can special case those.
6635                         if (IsArray(iterable) ||
6636                                 Object.prototype.toString.call(iterable) === '[object Arguments]' ||
6637                                 // IE 7 & IE 8 return '[object Object]' for the arguments object, we can detect by checking for the existence of the callee property
6638                                 (!!iterable.callee)) {
6639                                 var index;
6640                                 var length = iterable.length;
6641                                 for (index = 0; index < length; index++) {
6642                                         Call(adder, set, [iterable[index]]);
6643                                 }
6644                         }
6645                 }
6646                 return set;
6647         };
6648
6649         // 23.4.2.1. WeakSet.prototype
6650         // The initial value of WeakSet.prototype is the intrinsic %WeakSetPrototype% object.
6651         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
6652         Object.defineProperty(WeakSet, 'prototype', {
6653                 configurable: false,
6654                 enumerable: false,
6655                 writable: false,
6656                 value: {}
6657         });
6658
6659         // 23.4.3.1. WeakSet.prototype.add ( value )
6660         CreateMethodProperty(WeakSet.prototype, 'add', function add(value) {
6661                 // 1. Let S be the this value.
6662                 var S = this;
6663                 // 2. If Type(S) is not Object, throw a TypeError exception.
6664                 if (Type(S) !== 'object') {
6665                         throw new TypeError('Method WeakSet.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
6666                 }
6667                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6668                 if (S._es6WeakSet !== true) {
6669                         throw new TypeError('Method WeakSet.prototype.add called on incompatible receiver ' + Object.prototype.toString.call(S));
6670                 }
6671                 // 4. If Type(value) is not Object, throw a TypeError exception.
6672                 if (Type(value) !== 'object') {
6673                         throw new TypeError('Invalid value used in weak set');
6674                 }
6675                 // 5. Let entries be the List that is S.[[WeakSetData]].
6676                 var entries = S._values;
6677                 // 6. For each e that is an element of entries, do
6678                 for (var i = 0; i < entries.length; i++) {
6679                         var e = entries[i];
6680                         // a. If e is not empty and SameValue(e, value) is true, then
6681                         if (e !== undefMarker && SameValueZero(e, value)) {
6682                                 // i. Return S.
6683                                 return S;
6684                         }
6685                 }
6686                 // 7. Append value as the last element of entries.
6687                 S._values.push(value);
6688                 // 8. Return S.
6689                 return S;
6690         });
6691
6692         // 23.4.3.2. WeakSet.prototype.constructor
6693         CreateMethodProperty(WeakSet.prototype, 'constructor', WeakSet);
6694
6695         // 23.4.3.3. WeakSet.prototype.delete ( value )
6696         CreateMethodProperty(WeakSet.prototype, 'delete', function (value) {
6697                 // 1. Let S be the this value.
6698                 var S = this;
6699                 // 2. If Type(S) is not Object, throw a TypeError exception.
6700                 if (Type(S) !== 'object') {
6701                         throw new TypeError('Method WeakSet.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
6702                 }
6703                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6704                 if (S._es6WeakSet !== true) {
6705                         throw new TypeError('Method WeakSet.prototype.delete called on incompatible receiver ' + Object.prototype.toString.call(S));
6706                 }
6707                 // 4. If Type(value) is not Object, return false.
6708                 if (Type(value) !== 'object') {
6709                         return false;
6710                 }
6711                 // 5. Let entries be the List that is S.[[WeakSetData]].
6712                 var entries = S._values;
6713                 // 6. For each e that is an element of entries, do
6714                 for (var i = 0; i < entries.length; i++) {
6715                         var e = entries[i];
6716                         // a. If e is not empty and SameValue(e, value) is true, then
6717                         if (e !== undefMarker && SameValueZero(e, value)) {
6718                                 // i. Replace the element of entries whose value is e with an element whose value is empty.
6719                                 entries[i] = undefMarker;
6720                                 // ii. Return true.
6721                                 return true;
6722                         }
6723                 }
6724                 // 7. Return false.
6725                 return false;
6726         });
6727
6728         // 23.4.3.4. WeakSet.prototype.has ( value )
6729         CreateMethodProperty(WeakSet.prototype, 'has', function has(value) {
6730                 // 1. Let S be the this value.
6731                 var S = this;
6732                 // 2. If Type(S) is not Object, throw a TypeError exception.
6733                 if (Type(S) !== 'object') {
6734                         throw new TypeError('Method WeakSet.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(S));
6735                 }
6736                 // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.
6737                 if (S._es6WeakSet !== true) {
6738                         throw new TypeError('Method WeakSet.prototype.has called on incompatible receiver ' + Object.prototype.toString.call(S));
6739                 }
6740                 // 4. Let entries be the List that is S.[[WeakSetData]].
6741                 var entries = S._values;
6742                 // 5. If Type(value) is not Object, return false.
6743                 if (Type(value) !== 'object') {
6744                         return false;
6745                 }
6746                 // 6. For each e that is an element of entries, do
6747                 for (var i = 0; i < entries.length; i++) {
6748                         var e = entries[i];
6749                         // a. If e is not empty and SameValue(e, value) is true, return true.
6750                         if (e !== undefMarker && SameValueZero(e, value)) {
6751                                 return true;
6752                         }
6753                 }
6754                 // 7. Return false.
6755                 return false;
6756         });
6757
6758         // 23.4.3.5. WeakSet.prototype [ @@toStringTag ]
6759         // The initial value of the @@toStringTag property is the String value "WeakSet".
6760         // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
6761
6762         // 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.
6763         if (!('name' in WeakSet)) {
6764                 // 19.2.4.2 name
6765                 Object.defineProperty(WeakSet, 'name', {
6766                         configurable: true,
6767                         enumerable: false,
6768                         writable: false,
6769                         value: 'WeakSet'
6770                 });
6771         }
6772
6773         // Export the object
6774         try {
6775                 CreateMethodProperty(global, 'WeakSet', WeakSet);
6776         } catch (e) {
6777                 // IE8 throws an error here if we set enumerable to false.
6778                 // More info on table 2: https://msdn.microsoft.com/en-us/library/dd229916(v=vs.85).aspx
6779                 global['WeakSet'] = WeakSet;
6780         }
6781
6782 }(this));
6783
6784 }
6785
6786 })
6787 .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});