+if (!("Date"in this&&"toISOString"in Date.prototype
+)) {
+
+// Date.prototype.toISOString
+Date.prototype.toISOString = function toISOString() {
+ var date = this;
+
+ function pad(str, len) {
+ var pad = "0000";
+ str = '' + str;
+ return pad.substr(0, len - str.length) + str;
+ }
+
+ var y = date.getUTCFullYear(),
+ m = pad(date.getUTCMonth() + 1, 2),
+ d = pad(date.getUTCDate(), 2),
+ h = pad(date.getUTCHours(), 2),
+ i = pad(date.getUTCMinutes(), 2),
+ s = pad(date.getUTCSeconds(), 2),
+ ms = pad(date.getUTCMilliseconds(), 3);
+
+ return y +'-'+ m +'-'+ d + 'T' + h +':'+ i +':'+ s +'.'+ ms +'Z';
+};
+
+}
+
+if (!("defineProperty"in Object&&function(){try{var e={}
+return Object.defineProperty(e,"test",{value:42}),!0}catch(t){return!1}}()
+)) {
+
+// Object.defineProperty
+(function (nativeDefineProperty) {
+
+ var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__');
+ var ERR_ACCESSORS_NOT_SUPPORTED = 'Getters & setters cannot be defined on this javascript engine';
+ var ERR_VALUE_ACCESSORS = 'A property cannot both have accessors and be writable or have a value';
+
+ // Polyfill.io - This does not use CreateMethodProperty because our CreateMethodProperty function uses Object.defineProperty.
+ Object['defineProperty'] = function defineProperty(object, property, descriptor) {
+
+ // Where native support exists, assume it
+ if (nativeDefineProperty && (object === window || object === document || object === Element.prototype || object instanceof Element)) {
+ return nativeDefineProperty(object, property, descriptor);
+ }
+
+ if (object === null || !(object instanceof Object || typeof object === 'object')) {
+ throw new TypeError('Object.defineProperty called on non-object');
+ }
+
+ if (!(descriptor instanceof Object)) {
+ throw new TypeError('Property description must be an object');
+ }
+
+ var propertyString = String(property);
+ var hasValueOrWritable = 'value' in descriptor || 'writable' in descriptor;
+ var getterType = 'get' in descriptor && typeof descriptor.get;
+ var setterType = 'set' in descriptor && typeof descriptor.set;
+
+ // handle descriptor.get
+ if (getterType) {
+ if (getterType !== 'function') {
+ throw new TypeError('Getter must be a function');
+ }
+ if (!supportsAccessors) {
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ }
+ if (hasValueOrWritable) {
+ throw new TypeError(ERR_VALUE_ACCESSORS);
+ }
+ Object.__defineGetter__.call(object, propertyString, descriptor.get);
+ } else {
+ object[propertyString] = descriptor.value;
+ }
+
+ // handle descriptor.set
+ if (setterType) {
+ if (setterType !== 'function') {
+ throw new TypeError('Setter must be a function');
+ }
+ if (!supportsAccessors) {
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ }
+ if (hasValueOrWritable) {
+ throw new TypeError(ERR_VALUE_ACCESSORS);
+ }
+ Object.__defineSetter__.call(object, propertyString, descriptor.set);
+ }
+
+ // OK to define value unconditionally - if a getter has been specified as well, an error would be thrown above
+ if ('value' in descriptor) {
+ object[propertyString] = descriptor.value;
+ }
+
+ return object;
+ };
+}(Object.defineProperty));
+
+}
+
+
+// _ESAbstract.CreateDataProperty
+// 7.3.4. CreateDataProperty ( O, P, V )
+// NOTE
+// This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator.
+// 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.
+function CreateDataProperty(O, P, V) { // eslint-disable-line no-unused-vars
+ // 1. Assert: Type(O) is Object.
+ // 2. Assert: IsPropertyKey(P) is true.
+ // 3. Let newDesc be the PropertyDescriptor{ [[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }.
+ var newDesc = {
+ value: V,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ };
+ // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).
+ try {
+ Object.defineProperty(O, P, newDesc);
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+// _ESAbstract.CreateDataPropertyOrThrow
+/* global CreateDataProperty */
+// 7.3.6. CreateDataPropertyOrThrow ( O, P, V )
+function CreateDataPropertyOrThrow(O, P, V) { // eslint-disable-line no-unused-vars
+ // 1. Assert: Type(O) is Object.
+ // 2. Assert: IsPropertyKey(P) is true.
+ // 3. Let success be ? CreateDataProperty(O, P, V).
+ var success = CreateDataProperty(O, P, V);
+ // 4. If success is false, throw a TypeError exception.
+ if (!success) {
+ 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) + '`');
+ }
+ // 5. Return success.
+ return success;
+}
+
+// _ESAbstract.CreateMethodProperty
+// 7.3.5. CreateMethodProperty ( O, P, V )
+function CreateMethodProperty(O, P, V) { // eslint-disable-line no-unused-vars
+ // 1. Assert: Type(O) is Object.
+ // 2. Assert: IsPropertyKey(P) is true.
+ // 3. Let newDesc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}.
+ var newDesc = {
+ value: V,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ };
+ // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).
+ Object.defineProperty(O, P, newDesc);
+}
+if (!("isArray"in Array
+)) {
+
+// Array.isArray
+/* global CreateMethodProperty, IsArray */
+// 22.1.2.2. Array.isArray ( arg )
+CreateMethodProperty(Array, 'isArray', function isArray(arg) {
+ // 1. Return ? IsArray(arg).
+ return IsArray(arg);
+});
+