作者 曾海沥

add master

要显示太多修改。

为保证性能只显示 29 of 29+ 个文件。

/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
;(function () {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
var proto = EventEmitter.prototype;
var exports = this;
var originalGlobalValue = exports.EventEmitter;
/**
* Finds the index of the listener for the event in its storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Function[]|Object} All listener functions for the event.
*/
proto.getListeners = function getListeners(evt) {
var events = this._getEvents();
var response;
var key;
// Return a concatenated array of all matching events if
// the selector is a regular expression.
if (evt instanceof RegExp) {
response = {};
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
response[key] = events[key];
}
}
}
else {
response = events[evt] || (events[evt] = []);
}
return response;
};
/**
* Takes a list of listener objects and flattens it into a list of listener functions.
*
* @param {Object[]} listeners Raw listener objects.
* @return {Function[]} Just the listener functions.
*/
proto.flattenListeners = function flattenListeners(listeners) {
var flatListeners = [];
var i;
for (i = 0; i < listeners.length; i += 1) {
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
/**
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Object} All listener functions for an event in an object.
*/
proto.getListenersAsObject = function getListenersAsObject(evt) {
var listeners = this.getListeners(evt);
var response;
if (listeners instanceof Array) {
response = {};
response[evt] = listeners;
}
return response || listeners;
};
/**
* Adds a listener function to the specified event.
* The listener will not be added if it is a duplicate.
* If the listener returns true then it will be removed after it is called.
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListener = function addListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var listenerIsWrapped = typeof listener === 'object';
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
listeners[key].push(listenerIsWrapped ? listener : {
listener: listener,
once: false
});
}
}
return this;
};
/**
* Alias of addListener
*/
proto.on = alias('addListener');
/**
* Semi-alias of addListener. It will add a listener that will be
* automatically removed after its first execution.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addOnceListener = function addOnceListener(evt, listener) {
return this.addListener(evt, {
listener: listener,
once: true
});
};
/**
* Alias of addOnceListener.
*/
proto.once = alias('addOnceListener');
/**
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
* You need to tell it what event names should be matched by a regex.
*
* @param {String} evt Name of the event to create.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvent = function defineEvent(evt) {
this.getListeners(evt);
return this;
};
/**
* Uses defineEvent to define multiple events.
*
* @param {String[]} evts An array of event names to define.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvents = function defineEvents(evts) {
for (var i = 0; i < evts.length; i += 1) {
this.defineEvent(evts[i]);
}
return this;
};
/**
* Removes a listener function from the specified event.
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
*
* @param {String|RegExp} evt Name of the event to remove the listener from.
* @param {Function} listener Method to remove from the event.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListener = function removeListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
index = indexOfListener(listeners[key], listener);
if (index !== -1) {
listeners[key].splice(index, 1);
}
}
}
return this;
};
/**
* Alias of removeListener
*/
proto.off = alias('removeListener');
/**
* Adds listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
* You can also pass it a regular expression to add the array of listeners to all events that match it.
* Yeah, this function does quite a bit. That's probably a bad thing.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListeners = function addListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(false, evt, listeners);
};
/**
* Removes listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be removed.
* You can also pass it a regular expression to remove the listeners from all events that match it.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListeners = function removeListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(true, evt, listeners);
};
/**
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
* The first argument will determine if the listeners are removed (true) or added (false).
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be added/removed.
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
*
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
var i;
var value;
var single = remove ? this.removeListener : this.addListener;
var multiple = remove ? this.removeListeners : this.addListeners;
// If evt is an object then pass each of its properties to this method
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
for (i in evt) {
if (evt.hasOwnProperty(i) && (value = evt[i])) {
// Pass the single listener straight through to the singular method
if (typeof value === 'function') {
single.call(this, i, value);
}
else {
// Otherwise pass back to the multiple function
multiple.call(this, i, value);
}
}
}
}
else {
// So evt must be a string
// And listeners must be an array of listeners
// Loop over it and pass each one to the multiple method
i = listeners.length;
while (i--) {
single.call(this, evt, listeners[i]);
}
}
return this;
};
/**
* Removes all listeners from a specified event.
* If you do not specify an event then all listeners will be removed.
* That means every event will be emptied.
* You can also pass a regex to remove all events that match it.
*
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeEvent = function removeEvent(evt) {
var type = typeof evt;
var events = this._getEvents();
var key;
// Remove different things depending on the state of evt
if (type === 'string') {
// Remove all listeners for the specified event
delete events[evt];
}
else if (evt instanceof RegExp) {
// Remove all events matching the regex.
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
delete events[key];
}
}
}
else {
// Remove all listeners in all events
delete this._events;
}
return this;
};
/**
* Alias of removeEvent.
*
* Added to mirror the node API.
*/
proto.removeAllListeners = alias('removeEvent');
/**
* Emits an event of your choice.
* When emitted, every listener attached to that event will be executed.
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
* So they will not arrive within the array on the other side, they will be separate.
* You can also pass a regular expression to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {Array} [args] Optional array of arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emitEvent = function emitEvent(evt, args) {
var listenersMap = this.getListenersAsObject(evt);
var listeners;
var listener;
var i;
var key;
var response;
for (key in listenersMap) {
if (listenersMap.hasOwnProperty(key)) {
listeners = listenersMap[key].slice(0);
i = listeners.length;
while (i--) {
// If the listener returns true then it shall be removed from the event
// The function is executed either with a basic call or an apply if there is an args array
listener = listeners[i];
if (listener.once === true) {
this.removeListener(evt, listener.listener);
}
response = listener.listener.apply(this, args || []);
if (response === this._getOnceReturnValue()) {
this.removeListener(evt, listener.listener);
}
}
}
}
return this;
};
/**
* Alias of emitEvent
*/
proto.trigger = alias('emitEvent');
/**
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {...*} Optional additional arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emit = function emit(evt) {
var args = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
/**
* Sets the current value to check against when executing listeners. If a
* listeners return value matches the one set here then it will be removed
* after execution. This value defaults to true.
*
* @param {*} value The new value to check for when executing listeners.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.setOnceReturnValue = function setOnceReturnValue(value) {
this._onceReturnValue = value;
return this;
};
/**
* Fetches the current value to check against when executing listeners. If
* the listeners return value matches this one then it should be removed
* automatically. It will return true by default.
*
* @return {*|Boolean} The current value to check for or the default, true.
* @api private
*/
proto._getOnceReturnValue = function _getOnceReturnValue() {
if (this.hasOwnProperty('_onceReturnValue')) {
return this._onceReturnValue;
}
else {
return true;
}
};
/**
* Fetches the events object and creates one if required.
*
* @return {Object} The events storage object.
* @api private
*/
proto._getEvents = function _getEvents() {
return this._events || (this._events = {});
};
/**
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
*
* @return {Function} Non conflicting EventEmitter class.
*/
EventEmitter.noConflict = function noConflict() {
exports.EventEmitter = originalGlobalValue;
return EventEmitter;
};
// Expose the class either via AMD, CommonJS or the global object
if (typeof define === 'function' && define.amd) {
define(function () {
return EventEmitter;
});
}
else if (typeof module === 'object' && module.exports){
module.exports = EventEmitter;
}
else {
exports.EventEmitter = EventEmitter;
}
}.call(this));
/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
;(function () {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
var proto = EventEmitter.prototype;
var exports = this;
var originalGlobalValue = exports.EventEmitter;
/**
* Finds the index of the listener for the event in its storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Function[]|Object} All listener functions for the event.
*/
proto.getListeners = function getListeners(evt) {
var events = this._getEvents();
var response;
var key;
// Return a concatenated array of all matching events if
// the selector is a regular expression.
if (evt instanceof RegExp) {
response = {};
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
response[key] = events[key];
}
}
}
else {
response = events[evt] || (events[evt] = []);
}
return response;
};
/**
* Takes a list of listener objects and flattens it into a list of listener functions.
*
* @param {Object[]} listeners Raw listener objects.
* @return {Function[]} Just the listener functions.
*/
proto.flattenListeners = function flattenListeners(listeners) {
var flatListeners = [];
var i;
for (i = 0; i < listeners.length; i += 1) {
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
/**
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Object} All listener functions for an event in an object.
*/
proto.getListenersAsObject = function getListenersAsObject(evt) {
var listeners = this.getListeners(evt);
var response;
if (listeners instanceof Array) {
response = {};
response[evt] = listeners;
}
return response || listeners;
};
/**
* Adds a listener function to the specified event.
* The listener will not be added if it is a duplicate.
* If the listener returns true then it will be removed after it is called.
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListener = function addListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var listenerIsWrapped = typeof listener === 'object';
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
listeners[key].push(listenerIsWrapped ? listener : {
listener: listener,
once: false
});
}
}
return this;
};
/**
* Alias of addListener
*/
proto.on = alias('addListener');
/**
* Semi-alias of addListener. It will add a listener that will be
* automatically removed after its first execution.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addOnceListener = function addOnceListener(evt, listener) {
return this.addListener(evt, {
listener: listener,
once: true
});
};
/**
* Alias of addOnceListener.
*/
proto.once = alias('addOnceListener');
/**
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
* You need to tell it what event names should be matched by a regex.
*
* @param {String} evt Name of the event to create.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvent = function defineEvent(evt) {
this.getListeners(evt);
return this;
};
/**
* Uses defineEvent to define multiple events.
*
* @param {String[]} evts An array of event names to define.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvents = function defineEvents(evts) {
for (var i = 0; i < evts.length; i += 1) {
this.defineEvent(evts[i]);
}
return this;
};
/**
* Removes a listener function from the specified event.
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
*
* @param {String|RegExp} evt Name of the event to remove the listener from.
* @param {Function} listener Method to remove from the event.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListener = function removeListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
index = indexOfListener(listeners[key], listener);
if (index !== -1) {
listeners[key].splice(index, 1);
}
}
}
return this;
};
/**
* Alias of removeListener
*/
proto.off = alias('removeListener');
/**
* Adds listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
* You can also pass it a regular expression to add the array of listeners to all events that match it.
* Yeah, this function does quite a bit. That's probably a bad thing.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListeners = function addListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(false, evt, listeners);
};
/**
* Removes listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be removed.
* You can also pass it a regular expression to remove the listeners from all events that match it.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListeners = function removeListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(true, evt, listeners);
};
/**
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
* The first argument will determine if the listeners are removed (true) or added (false).
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be added/removed.
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
*
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
var i;
var value;
var single = remove ? this.removeListener : this.addListener;
var multiple = remove ? this.removeListeners : this.addListeners;
// If evt is an object then pass each of its properties to this method
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
for (i in evt) {
if (evt.hasOwnProperty(i) && (value = evt[i])) {
// Pass the single listener straight through to the singular method
if (typeof value === 'function') {
single.call(this, i, value);
}
else {
// Otherwise pass back to the multiple function
multiple.call(this, i, value);
}
}
}
}
else {
// So evt must be a string
// And listeners must be an array of listeners
// Loop over it and pass each one to the multiple method
i = listeners.length;
while (i--) {
single.call(this, evt, listeners[i]);
}
}
return this;
};
/**
* Removes all listeners from a specified event.
* If you do not specify an event then all listeners will be removed.
* That means every event will be emptied.
* You can also pass a regex to remove all events that match it.
*
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeEvent = function removeEvent(evt) {
var type = typeof evt;
var events = this._getEvents();
var key;
// Remove different things depending on the state of evt
if (type === 'string') {
// Remove all listeners for the specified event
delete events[evt];
}
else if (evt instanceof RegExp) {
// Remove all events matching the regex.
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
delete events[key];
}
}
}
else {
// Remove all listeners in all events
delete this._events;
}
return this;
};
/**
* Alias of removeEvent.
*
* Added to mirror the node API.
*/
proto.removeAllListeners = alias('removeEvent');
/**
* Emits an event of your choice.
* When emitted, every listener attached to that event will be executed.
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
* So they will not arrive within the array on the other side, they will be separate.
* You can also pass a regular expression to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {Array} [args] Optional array of arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emitEvent = function emitEvent(evt, args) {
var listenersMap = this.getListenersAsObject(evt);
var listeners;
var listener;
var i;
var key;
var response;
for (key in listenersMap) {
if (listenersMap.hasOwnProperty(key)) {
listeners = listenersMap[key].slice(0);
i = listeners.length;
while (i--) {
// If the listener returns true then it shall be removed from the event
// The function is executed either with a basic call or an apply if there is an args array
listener = listeners[i];
if (listener.once === true) {
this.removeListener(evt, listener.listener);
}
response = listener.listener.apply(this, args || []);
if (response === this._getOnceReturnValue()) {
this.removeListener(evt, listener.listener);
}
}
}
}
return this;
};
/**
* Alias of emitEvent
*/
proto.trigger = alias('emitEvent');
/**
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {...*} Optional additional arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emit = function emit(evt) {
var args = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
/**
* Sets the current value to check against when executing listeners. If a
* listeners return value matches the one set here then it will be removed
* after execution. This value defaults to true.
*
* @param {*} value The new value to check for when executing listeners.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.setOnceReturnValue = function setOnceReturnValue(value) {
this._onceReturnValue = value;
return this;
};
/**
* Fetches the current value to check against when executing listeners. If
* the listeners return value matches this one then it should be removed
* automatically. It will return true by default.
*
* @return {*|Boolean} The current value to check for or the default, true.
* @api private
*/
proto._getOnceReturnValue = function _getOnceReturnValue() {
if (this.hasOwnProperty('_onceReturnValue')) {
return this._onceReturnValue;
}
else {
return true;
}
};
/**
* Fetches the events object and creates one if required.
*
* @return {Object} The events storage object.
* @api private
*/
proto._getEvents = function _getEvents() {
return this._events || (this._events = {});
};
/**
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
*
* @return {Function} Non conflicting EventEmitter class.
*/
EventEmitter.noConflict = function noConflict() {
exports.EventEmitter = originalGlobalValue;
return EventEmitter;
};
// Expose the class either via AMD, CommonJS or the global object
if (typeof define === 'function' && define.amd) {
define(function () {
return EventEmitter;
});
}
else if (typeof module === 'object' && module.exports){
module.exports = EventEmitter;
}
else {
exports.EventEmitter = EventEmitter;
}
}.call(this));
... ...
/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
(function(){"use strict";function t(){}function i(t,n){for(var e=t.length;e--;)if(t[e].listener===n)return e;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var e=t.prototype,r=this,s=r.EventEmitter;e.getListeners=function(n){var r,e,t=this._getEvents();if(n instanceof RegExp){r={};for(e in t)t.hasOwnProperty(e)&&n.test(e)&&(r[e]=t[e])}else r=t[n]||(t[n]=[]);return r},e.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},e.getListenersAsObject=function(n){var e,t=this.getListeners(n);return t instanceof Array&&(e={},e[n]=t),e||t},e.addListener=function(r,e){var t,n=this.getListenersAsObject(r),s="object"==typeof e;for(t in n)n.hasOwnProperty(t)&&-1===i(n[t],e)&&n[t].push(s?e:{listener:e,once:!1});return this},e.on=n("addListener"),e.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},e.once=n("addOnceListener"),e.defineEvent=function(e){return this.getListeners(e),this},e.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},e.removeListener=function(r,s){var n,e,t=this.getListenersAsObject(r);for(e in t)t.hasOwnProperty(e)&&(n=i(t[e],s),-1!==n&&t[e].splice(n,1));return this},e.off=n("removeListener"),e.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},e.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},e.manipulateListeners=function(r,t,i){var e,n,s=r?this.removeListener:this.addListener,o=r?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(e=i.length;e--;)s.call(this,t,i[e]);else for(e in t)t.hasOwnProperty(e)&&(n=t[e])&&("function"==typeof n?s.call(this,e,n):o.call(this,e,n));return this},e.removeEvent=function(e){var t,r=typeof e,n=this._getEvents();if("string"===r)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},e.removeAllListeners=n("removeEvent"),e.emitEvent=function(t,u){var n,e,r,i,o,s=this.getListenersAsObject(t);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),r=n.length;r--;)e=n[r],e.once===!0&&this.removeListener(t,e.listener),o=e.listener.apply(this,u||[]),o===this._getOnceReturnValue()&&this.removeListener(t,e.listener);return this},e.trigger=n("emitEvent"),e.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},e.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},e._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},e._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return r.EventEmitter=s,t},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:r.EventEmitter=t}).call(this);
\ No newline at end of file
... ...
{
"root": true,
"extends": "@ljharb",
"rules": {
"camelcase": [0],
"complexity": [0, 10],
"dot-notation": [2, { "allowKeywords": false }],
"eqeqeq": [2, "allow-null"],
"id-length": [2, { "min": 1, "max": 40 }],
"max-nested-callbacks": [2, 5],
"max-params": [2, 7],
"max-statements": [1, 30],
"new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }],
"no-constant-condition": [1],
"no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}],
"no-extra-parens": [0],
"no-extra-semi": [1],
"no-func-assign": [1],
"no-implicit-coercion": [2, {
"boolean": false,
"number": false,
"string": true
}],
"no-invalid-this": [0],
"no-magic-numbers": [0],
"no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}],
"no-new-func": [1],
"no-plusplus": [1],
"no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
"no-shadow": [1],
"no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
"operator-linebreak": [2, "after"],
"quote-props": [1, "as-needed", { "keywords": true }],
"spaced-comment": [0],
"strict": [0]
}
}
{
"root": true,
"extends": "@ljharb",
"rules": {
"camelcase": [0],
"complexity": [0, 10],
"dot-notation": [2, { "allowKeywords": false }],
"eqeqeq": [2, "allow-null"],
"id-length": [2, { "min": 1, "max": 40 }],
"max-nested-callbacks": [2, 5],
"max-params": [2, 7],
"max-statements": [1, 30],
"new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }],
"no-constant-condition": [1],
"no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}],
"no-extra-parens": [0],
"no-extra-semi": [1],
"no-func-assign": [1],
"no-implicit-coercion": [2, {
"boolean": false,
"number": false,
"string": true
}],
"no-invalid-this": [0],
"no-magic-numbers": [0],
"no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}],
"no-new-func": [1],
"no-plusplus": [1],
"no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
"no-shadow": [1],
"no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
"operator-linebreak": [2, "after"],
"quote-props": [1, "as-needed", { "keywords": true }],
"spaced-comment": [0],
"strict": [0]
}
}
... ...
node_modules
.DS_Store
node_modules
.DS_Store
... ...
{
"es3": true,
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"disallowSpaceAfterKeywords": [],
"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,
"disallowNodeTypes": [
"DebuggerStatement",
"LabeledStatement",
"SwitchCase",
"SwitchStatement",
"WithStatement"
],
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
"requireSpaceBetweenArguments": true,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"requireSpaceAfterPrefixUnaryOperators": [],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforePostfixUnaryOperators": [],
"disallowSpaceBeforeBinaryOperators": [],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterBinaryOperators": [],
"disallowImplicitTypeConversion": ["binary", "string"],
"disallowKeywords": ["with", "eval"],
"requireKeywordsOnNewLine": [],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"excludeFiles": ["node_modules/**", "vendor/**"],
"disallowMultipleLineStrings": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireParenthesesAroundIIFE": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"escape": true,
"mark": "'"
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 200
},
"requirePaddingNewLinesAfterUseStrict": true,
"disallowArrowFunctions": true,
"disallowMultiLineTernary": false,
"validateOrderInObjectKeys": false,
"disallowIdenticalDestructuringNames": true,
"disallowNestedTernaries": { "maxLevel": 7 },
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,
"requireSpacesInGenerator": {
"afterStar": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowVar": false,
"requireArrayDestructuring": false,
"requireEnhancedObjectLiterals": false,
"requireObjectDestructuring": false,
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false
}
{
"es3": true,
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"disallowSpaceAfterKeywords": [],
"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,
"disallowNodeTypes": [
"DebuggerStatement",
"LabeledStatement",
"SwitchCase",
"SwitchStatement",
"WithStatement"
],
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
"requireSpaceBetweenArguments": true,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"requireSpaceAfterPrefixUnaryOperators": [],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforePostfixUnaryOperators": [],
"disallowSpaceBeforeBinaryOperators": [],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterBinaryOperators": [],
"disallowImplicitTypeConversion": ["binary", "string"],
"disallowKeywords": ["with", "eval"],
"requireKeywordsOnNewLine": [],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"excludeFiles": ["node_modules/**", "vendor/**"],
"disallowMultipleLineStrings": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireParenthesesAroundIIFE": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"escape": true,
"mark": "'"
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 200
},
"requirePaddingNewLinesAfterUseStrict": true,
"disallowArrowFunctions": true,
"disallowMultiLineTernary": false,
"validateOrderInObjectKeys": false,
"disallowIdenticalDestructuringNames": true,
"disallowNestedTernaries": { "maxLevel": 7 },
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,
"requireSpacesInGenerator": {
"afterStar": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowVar": false,
"requireArrayDestructuring": false,
"requireEnhancedObjectLiterals": false,
"requireObjectDestructuring": false,
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false
}
... ...
language: node_js
node_js:
- "5.9"
- "5.8"
- "5.7"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
- "5.1"
- "5.0"
- "4.4"
- "4.3"
- "4.2"
- "4.1"
- "4.0"
- "iojs-v3.3"
- "iojs-v3.2"
- "iojs-v3.1"
- "iojs-v3.0"
- "iojs-v2.5"
- "iojs-v2.4"
- "iojs-v2.3"
- "iojs-v2.2"
- "iojs-v2.1"
- "iojs-v2.0"
- "iojs-v1.8"
- "iojs-v1.7"
- "iojs-v1.6"
- "iojs-v1.5"
- "iojs-v1.4"
- "iojs-v1.3"
- "iojs-v1.2"
- "iojs-v1.1"
- "iojs-v1.0"
- "0.12"
- "0.11"
- "0.10"
- "0.9"
- "0.8"
- "0.6"
- "0.4"
before_install:
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
script:
- 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi'
sudo: false
matrix:
fast_finish: true
allow_failures:
- node_js: "5.8"
- node_js: "5.7"
- node_js: "5.6"
- node_js: "5.5"
- node_js: "5.4"
- node_js: "5.3"
- node_js: "5.2"
- node_js: "5.1"
- node_js: "5.0"
- node_js: "4.3"
- node_js: "4.2"
- node_js: "4.1"
- node_js: "4.0"
- node_js: "iojs-v3.2"
- node_js: "iojs-v3.1"
- node_js: "iojs-v3.0"
- node_js: "iojs-v2.4"
- node_js: "iojs-v2.3"
- node_js: "iojs-v2.2"
- node_js: "iojs-v2.1"
- node_js: "iojs-v2.0"
- node_js: "iojs-v1.7"
- node_js: "iojs-v1.6"
- node_js: "iojs-v1.5"
- node_js: "iojs-v1.4"
- node_js: "iojs-v1.3"
- node_js: "iojs-v1.2"
- node_js: "iojs-v1.1"
- node_js: "iojs-v1.0"
- node_js: "0.11"
- node_js: "0.9"
- node_js: "0.6"
- node_js: "0.4"
language: node_js
node_js:
- "5.9"
- "5.8"
- "5.7"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
- "5.1"
- "5.0"
- "4.4"
- "4.3"
- "4.2"
- "4.1"
- "4.0"
- "iojs-v3.3"
- "iojs-v3.2"
- "iojs-v3.1"
- "iojs-v3.0"
- "iojs-v2.5"
- "iojs-v2.4"
- "iojs-v2.3"
- "iojs-v2.2"
- "iojs-v2.1"
- "iojs-v2.0"
- "iojs-v1.8"
- "iojs-v1.7"
- "iojs-v1.6"
- "iojs-v1.5"
- "iojs-v1.4"
- "iojs-v1.3"
- "iojs-v1.2"
- "iojs-v1.1"
- "iojs-v1.0"
- "0.12"
- "0.11"
- "0.10"
- "0.9"
- "0.8"
- "0.6"
- "0.4"
before_install:
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
script:
- 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi'
sudo: false
matrix:
fast_finish: true
allow_failures:
- node_js: "5.8"
- node_js: "5.7"
- node_js: "5.6"
- node_js: "5.5"
- node_js: "5.4"
- node_js: "5.3"
- node_js: "5.2"
- node_js: "5.1"
- node_js: "5.0"
- node_js: "4.3"
- node_js: "4.2"
- node_js: "4.1"
- node_js: "4.0"
- node_js: "iojs-v3.2"
- node_js: "iojs-v3.1"
- node_js: "iojs-v3.0"
- node_js: "iojs-v2.4"
- node_js: "iojs-v2.3"
- node_js: "iojs-v2.2"
- node_js: "iojs-v2.1"
- node_js: "iojs-v2.0"
- node_js: "iojs-v1.7"
- node_js: "iojs-v1.6"
- node_js: "iojs-v1.5"
- node_js: "iojs-v1.4"
- node_js: "iojs-v1.3"
- node_js: "iojs-v1.2"
- node_js: "iojs-v1.1"
- node_js: "iojs-v1.0"
- node_js: "0.11"
- node_js: "0.9"
- node_js: "0.6"
- node_js: "0.4"
... ...
4.5.7
- [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390)
4.5.6
- [Fix] `new Date(new Date())` should work in IE 8 (#389)
- [Tests] on `node` `v5.7`
- [Dev Deps] update `uglify-js`
4.5.5
- [Fix] Adobe Photoshop’s JS engine bizarrely can have `+date !== date.getTime()` (#365)
- [Dev Deps] update `eslint`
- [Refactor] Update `is-callable` implementation to match latest
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
4.5.4
- [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42
4.5.3
- [Fix] Saturday is a day in the week (#386)
- [Robustness] improve Function#bind (#381)
- [Tests] on `node` `v5.6`, `v4.3`
- [Tests] use json3 (#382)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
- [Docs] add note about script order (#379)
4.5.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.5.1
- [Fix] Make sure preexisting + broken `Array#` methods that throw don’t break the runtime (#377)
- [Dev Deps] update `jscs`
4.5.0
- [New] `parseFloat('-0')` should return -0 in Opera 12 (#371)
- [New] Provide and replace Date UTC methods (#360)
- [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesn’t observably look them up on the receiver
- [Robustness] use a cached and shimmed `String#trim`
- [Tests] up to `node` `v5.5`
- [Tests] add `parallelshell` and use it in a few tasks
- [Refactor] rename cached methods to avoid linter warnings
- [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config'
- [Docs] Update license year to 2016 (#374)
4.4.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.4.1
- [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370)
- [Docs] add missing shimmed things
4.4.0
- [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364)
- [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354)
- [Fix] In IE 6, `window.external` makes `Object.keys` throw
- [Fix] `Array#slice`: boxed string access on IE <= 8 (#349)
- [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352)
- [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358)
- [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString`
- [Robustness] Use a bound form of `Array#slice.call`
- [Tests] Properly check for descriptor support in IE <= 8
- [Tests] on `node` `v5.1`
- [Tests] Add `Array#slice` tests (#346)
- [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver`
- [Docs] Fix broken UMD links (#344)
4.3.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.3.1
- [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits
4.3.0
- [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336)
- [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined`
- [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333)
- [New] `Error#toString`: prints out the proper message in IE 7 and below (#334)
- [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340)
- [Fix] `String#lastIndexOf`: ensure the correct length in IE 8
- [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332)
- [Robustness] Use a bound `Array#push` instead of relying on `Function#call`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Add some conditionals to avoid impossible-to-fix test failures in IE 6-8, due to it being unable to distinguish between `undefined` and an absent index (#114)
- [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114)
- [Tests] add additional `Array#shift` tests (#337)
- [Tests] Add additional `Array#splice` tests (#339)
- [Tests] Add `Array#pop` tests, just in case (#338)
- [Tests] include `global` tests in HTML test files
- [Tests] Make sure the HTML tests run with the right charset
- [Tests] ensure `node` `v0.8` tests stay passing.
- [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off
- [Tests] on `node` `v5.0`
- [Tests] fix npm upgrades for older nodes
4.2.1
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.2.0
- [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support.
- [Dev Deps] update `eslint`, `jscs`
4.1.16
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.1.15
- [shim: fix] new Date + Date.parse: Fix a Safari 8 & 9 bug where the `ms` arg is treated as a signed instead of unsigned int (#329)
- [shim: fix] add 'frame' to blacklisted keys (#330)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js`
- [Tests] on `node` `v4.2`
- [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off
4.1.14
- [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327)
- [Refactor] Use `ES.ToUint32` instead of inline `>>>`
- [Tests] up to `node` `v4.1`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs`
4.1.13
- [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326)
4.1.12
- [fix] Make sure uglify doesn't remove function names
- [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325)
- [Tests] up to `io.js` `v3.3`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.1.11
- [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly)
- [shim: fix] Omit !Date.parse check in the if statement (#323)
- [sham: fix] Fix Object.create sham to not set __proto__ (#301)
- [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320)
- [Tests] up to `io.js` `v3.1`
- [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics
- [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318)
- [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config
4.1.10
- [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322)
- [Tests] Consolidating `Date.parse` extended year tests
- [Tests] Account for a `Date.parse` precision variance in Safari 8
- [Tests] DRY up some Date.parse tests
- [Tests] Don't create globals in Date tests
- [Tests] Better failure output when an invalid date's toJSON throws
- [Tests] Also compare lengths of array-likes
- [Tests] Extra check on Object.keys(arguments)
- [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable
4.1.9
- [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6
- [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix.
- [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome.
- [Performance] Speed up blacklisted key check for Object.keys automation equality bug.
- [Tests] Test on `io.js` `v2.4`
- [Dev Deps] Update `eslint`, `semver`
4.1.8
- [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275)
- [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315)
- [Fix] Fix `Date#toISOString` in Safari 5.1 (#243)
- [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289)
- [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295)
- [Robustness] Safely use and reference many builtins internally (also see #313)
- [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs
- [Dev Deps] Update `eslint`
4.1.7
- Make sure `Date.parse` is not enumerable (#310)
4.1.6
- Support IE 8 when `document.domain` is set (#306, #150)
- Remove version from `bower.json` (#307)
4.1.5
- Add a failing runtime check for Safari 8 `Date.parse`
- Update `eslint`, `semver`
- Test on `io.js` `v2.2`
4.1.4
- Make sure copied `Date` properties remain non-enumerable.
- Using a more reliable check for supported property descriptors in non-IE ES3
- Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305)
- Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`.
- Test on `io.js` `v2.1`
- Clean up `Array.prototype` iteration methods
4.1.3
- Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license
- Update `uglify-js`, `eslint`
4.1.2
- In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303)
- Date: Ensure all code paths have the correct `constructor` property
- Date: Don't copy non-own properties from original `Date`
- Test up to `io.js` `v2.0.0`
- Simplify `isPrimitive` check.
- Adding sanity check tests for ES5 `Number` constants.
- Update `uglify-js`, `eslint`, `semver`
4.1.1
- Fix name of `parseInt` replacement.
- Update copyright year
- Update `eslint`, `jscs`
- Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change.
- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
- Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures.
- Ensure some Object tests don't fail in ES6
- Make sure `Date` instances don't have an enumerable `constructor` property, when possible.
4.1.0
- Update `eslint`
- Improve type checks: `Array.isArray`, `isRegex`
- Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules
- Note which ES abstract methods are replaceable via `es-abstract`
- Run `travis-ci` tests on `iojs`!
4.0.6
- Update `jscs`, `uglify-js`, add `eslint`
- es5-sham: fix Object.defineProperty to not check for own properties (#211)
- Fix Array#splice bug in Safari 5 (#284)
- Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285)
4.0.5
- Update `jscs` so tests pass
4.0.4
- Style/indentation/whitespace cleanups.
- README tweaks
4.0.3
- Fix keywords (#268)
- add some Date tests
- Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710)
4.0.2
- Start including version numbers in minified files (#267)
4.0.1
- Fix legacy arguments object detection in Object.keys (#260)
4.0.0
- No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255)
- Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250)
- lots of internal refactoring
- Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254)
3.4.0
- Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239)
- Fix Object.keys with Arguments objects in Safari 5.0
- Now shimming String#split in Opera 10.6
- Avoid using "toString" as a variable name, since that breaks Opera
- Internal implementation and test cleanups
3.3.2
- Remove an internal "bind" call, which should make the shim a bit faster
- Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6
3.3.1
- Fixing an Array#splice bug in IE 6/7
- cleaning up Array#splice tests
3.3.0
- Fix Array#reduceRight in node 0.6 and older browsers (#238)
3.2.0
- Fix es5-sham UMD definition to work properly with AMD (#237)
- Ensure that Array methods do not autobox context in strict mode (#233)
3.1.1
- Update minified files (#231)
3.1.0
- Fix String#replace in Firefox up through 29 (#228)
3.0.2
- Fix `Function#bind` in IE 7 and 8 (#224, #225, #226)
3.0.1
- Version bump to ensure npm has newest minified assets
3.0.0
- es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini
- Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim`
- Added spec-compliant shim for `parseInt`
- Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives
- Improve minification of builds
2.3.0
- parseInt is now properly shimmed in ES3 browsers to default the radix
- update URLs to point to the new organization
2.2.0
- Function.prototype.bind shim now reports correct length on a bound function
- fix node 0.6.x v8 bug in Array#forEach
- test improvements
2.1.0
- Object.create fixes
- tweaks to the Object.defineProperties shim
2.0.0
- Separate reliable shims from dubious shims (shams).
1.2.10
- Group-effort Style Cleanup
- Took a stab at fixing Object.defineProperty on IE8 without
bad side-effects. (@hax)
- Object.isExtensible no longer fakes it. (@xavierm)
- Date.prototype.toISOString no longer deals with partial
ISO dates, per spec (@kitcambridge)
- More (mostly from @bryanforbes)
1.2.9
- Corrections to toISOString by @kitcambridge
- Fixed three bugs in array methods revealed by Jasmine tests.
- Cleaned up Function.prototype.bind with more fixes and tests from
@bryanforbes.
1.2.8
- Actually fixed problems with Function.prototype.bind, and regressions
from 1.2.7 (@bryanforbes, @jdalton #36)
1.2.7 - REGRESSED
- Fixed problems with Function.prototype.bind when called as a constructor.
(@jdalton #36)
1.2.6
- Revised Date.parse to match ES 5.1 (kitcambridge)
1.2.5
- Fixed a bug for padding it Date..toISOString (tadfisher issue #33)
1.2.4
- Fixed a descriptor bug in Object.defineProperty (raynos)
1.2.3
- Cleaned up RequireJS and <script> boilerplate
1.2.2
- Changed reduce to follow the letter of the spec with regard to having and
owning properties.
- Fixed a bug where RegExps pass as Functions in some engines in reduce.
1.2.1
- Adding few fixes to make jshint happy.
- Fix for issue #12, function expressions can cause scoping issues in IE.
- NPM will minify on install or when `npm run-script install` is executed.
- Adding .gitignore to avoid publishing dev dependencies.
1.2.0
- Making script loadable as AMD module.
- Adding `indexOf` to the list of safe shims.
1.1.0
- Added support for accessor properties where possible (which is all browsers
except IE).
- Stop exposing bound function's (that are returned by
`Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`)
as in some cases (when using facade objects for example) capabilities of the
enclosed functions will be leaked.
- `Object.create` now explicitly sets `__proto__` property to guarantee
correct behavior of `Object.getPrototypeOf`'s on all objects created using
`Object.create`.
- Switched to `===` from `==` where possible as it's slightly faster on older
browsers that are target of this lib.
- Added names to all anonymous functions to have a better stack traces.
1.0.0
- fixed Date.toISODate, using UTC accessors, as in
http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986
(arian)
0.0.4
- Revised Object.getPrototypeOf to work in more cases
in response to http://ejohn.org/blog/objectgetprototypeof/
[issue #2] (fschaefer)
0.0.3
- Fixed typos in Object.keys (samsonjs)
0.0.2
Per kangax's recommendations:
- faster Object.create(null)
- fixed a function-scope function declaration statement in Object.create
0.0.1
- fixed Object.create(null), in so far as that's possible
- reworked Rhino Object.freeze(Function) bug detector and patcher
0.0.0
- forked from narwhal-lib
4.5.7
- [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390)
4.5.6
- [Fix] `new Date(new Date())` should work in IE 8 (#389)
- [Tests] on `node` `v5.7`
- [Dev Deps] update `uglify-js`
4.5.5
- [Fix] Adobe Photoshop’s JS engine bizarrely can have `+date !== date.getTime()` (#365)
- [Dev Deps] update `eslint`
- [Refactor] Update `is-callable` implementation to match latest
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
4.5.4
- [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42
4.5.3
- [Fix] Saturday is a day in the week (#386)
- [Robustness] improve Function#bind (#381)
- [Tests] on `node` `v5.6`, `v4.3`
- [Tests] use json3 (#382)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
- [Docs] add note about script order (#379)
4.5.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.5.1
- [Fix] Make sure preexisting + broken `Array#` methods that throw don’t break the runtime (#377)
- [Dev Deps] update `jscs`
4.5.0
- [New] `parseFloat('-0')` should return -0 in Opera 12 (#371)
- [New] Provide and replace Date UTC methods (#360)
- [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesn’t observably look them up on the receiver
- [Robustness] use a cached and shimmed `String#trim`
- [Tests] up to `node` `v5.5`
- [Tests] add `parallelshell` and use it in a few tasks
- [Refactor] rename cached methods to avoid linter warnings
- [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config'
- [Docs] Update license year to 2016 (#374)
4.4.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.4.1
- [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370)
- [Docs] add missing shimmed things
4.4.0
- [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364)
- [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354)
- [Fix] In IE 6, `window.external` makes `Object.keys` throw
- [Fix] `Array#slice`: boxed string access on IE <= 8 (#349)
- [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352)
- [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358)
- [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString`
- [Robustness] Use a bound form of `Array#slice.call`
- [Tests] Properly check for descriptor support in IE <= 8
- [Tests] on `node` `v5.1`
- [Tests] Add `Array#slice` tests (#346)
- [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver`
- [Docs] Fix broken UMD links (#344)
4.3.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.3.1
- [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits
4.3.0
- [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336)
- [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined`
- [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333)
- [New] `Error#toString`: prints out the proper message in IE 7 and below (#334)
- [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340)
- [Fix] `String#lastIndexOf`: ensure the correct length in IE 8
- [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332)
- [Robustness] Use a bound `Array#push` instead of relying on `Function#call`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Add some conditionals to avoid impossible-to-fix test failures in IE 6-8, due to it being unable to distinguish between `undefined` and an absent index (#114)
- [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114)
- [Tests] add additional `Array#shift` tests (#337)
- [Tests] Add additional `Array#splice` tests (#339)
- [Tests] Add `Array#pop` tests, just in case (#338)
- [Tests] include `global` tests in HTML test files
- [Tests] Make sure the HTML tests run with the right charset
- [Tests] ensure `node` `v0.8` tests stay passing.
- [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off
- [Tests] on `node` `v5.0`
- [Tests] fix npm upgrades for older nodes
4.2.1
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.2.0
- [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support.
- [Dev Deps] update `eslint`, `jscs`
4.1.16
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.1.15
- [shim: fix] new Date + Date.parse: Fix a Safari 8 & 9 bug where the `ms` arg is treated as a signed instead of unsigned int (#329)
- [shim: fix] add 'frame' to blacklisted keys (#330)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js`
- [Tests] on `node` `v4.2`
- [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off
4.1.14
- [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327)
- [Refactor] Use `ES.ToUint32` instead of inline `>>>`
- [Tests] up to `node` `v4.1`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs`
4.1.13
- [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326)
4.1.12
- [fix] Make sure uglify doesn't remove function names
- [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325)
- [Tests] up to `io.js` `v3.3`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.1.11
- [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly)
- [shim: fix] Omit !Date.parse check in the if statement (#323)
- [sham: fix] Fix Object.create sham to not set __proto__ (#301)
- [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320)
- [Tests] up to `io.js` `v3.1`
- [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics
- [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318)
- [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config
4.1.10
- [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322)
- [Tests] Consolidating `Date.parse` extended year tests
- [Tests] Account for a `Date.parse` precision variance in Safari 8
- [Tests] DRY up some Date.parse tests
- [Tests] Don't create globals in Date tests
- [Tests] Better failure output when an invalid date's toJSON throws
- [Tests] Also compare lengths of array-likes
- [Tests] Extra check on Object.keys(arguments)
- [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable
4.1.9
- [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6
- [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix.
- [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome.
- [Performance] Speed up blacklisted key check for Object.keys automation equality bug.
- [Tests] Test on `io.js` `v2.4`
- [Dev Deps] Update `eslint`, `semver`
4.1.8
- [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275)
- [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315)
- [Fix] Fix `Date#toISOString` in Safari 5.1 (#243)
- [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289)
- [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295)
- [Robustness] Safely use and reference many builtins internally (also see #313)
- [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs
- [Dev Deps] Update `eslint`
4.1.7
- Make sure `Date.parse` is not enumerable (#310)
4.1.6
- Support IE 8 when `document.domain` is set (#306, #150)
- Remove version from `bower.json` (#307)
4.1.5
- Add a failing runtime check for Safari 8 `Date.parse`
- Update `eslint`, `semver`
- Test on `io.js` `v2.2`
4.1.4
- Make sure copied `Date` properties remain non-enumerable.
- Using a more reliable check for supported property descriptors in non-IE ES3
- Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305)
- Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`.
- Test on `io.js` `v2.1`
- Clean up `Array.prototype` iteration methods
4.1.3
- Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license
- Update `uglify-js`, `eslint`
4.1.2
- In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303)
- Date: Ensure all code paths have the correct `constructor` property
- Date: Don't copy non-own properties from original `Date`
- Test up to `io.js` `v2.0.0`
- Simplify `isPrimitive` check.
- Adding sanity check tests for ES5 `Number` constants.
- Update `uglify-js`, `eslint`, `semver`
4.1.1
- Fix name of `parseInt` replacement.
- Update copyright year
- Update `eslint`, `jscs`
- Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change.
- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
- Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures.
- Ensure some Object tests don't fail in ES6
- Make sure `Date` instances don't have an enumerable `constructor` property, when possible.
4.1.0
- Update `eslint`
- Improve type checks: `Array.isArray`, `isRegex`
- Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules
- Note which ES abstract methods are replaceable via `es-abstract`
- Run `travis-ci` tests on `iojs`!
4.0.6
- Update `jscs`, `uglify-js`, add `eslint`
- es5-sham: fix Object.defineProperty to not check for own properties (#211)
- Fix Array#splice bug in Safari 5 (#284)
- Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285)
4.0.5
- Update `jscs` so tests pass
4.0.4
- Style/indentation/whitespace cleanups.
- README tweaks
4.0.3
- Fix keywords (#268)
- add some Date tests
- Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710)
4.0.2
- Start including version numbers in minified files (#267)
4.0.1
- Fix legacy arguments object detection in Object.keys (#260)
4.0.0
- No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255)
- Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250)
- lots of internal refactoring
- Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254)
3.4.0
- Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239)
- Fix Object.keys with Arguments objects in Safari 5.0
- Now shimming String#split in Opera 10.6
- Avoid using "toString" as a variable name, since that breaks Opera
- Internal implementation and test cleanups
3.3.2
- Remove an internal "bind" call, which should make the shim a bit faster
- Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6
3.3.1
- Fixing an Array#splice bug in IE 6/7
- cleaning up Array#splice tests
3.3.0
- Fix Array#reduceRight in node 0.6 and older browsers (#238)
3.2.0
- Fix es5-sham UMD definition to work properly with AMD (#237)
- Ensure that Array methods do not autobox context in strict mode (#233)
3.1.1
- Update minified files (#231)
3.1.0
- Fix String#replace in Firefox up through 29 (#228)
3.0.2
- Fix `Function#bind` in IE 7 and 8 (#224, #225, #226)
3.0.1
- Version bump to ensure npm has newest minified assets
3.0.0
- es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini
- Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim`
- Added spec-compliant shim for `parseInt`
- Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives
- Improve minification of builds
2.3.0
- parseInt is now properly shimmed in ES3 browsers to default the radix
- update URLs to point to the new organization
2.2.0
- Function.prototype.bind shim now reports correct length on a bound function
- fix node 0.6.x v8 bug in Array#forEach
- test improvements
2.1.0
- Object.create fixes
- tweaks to the Object.defineProperties shim
2.0.0
- Separate reliable shims from dubious shims (shams).
1.2.10
- Group-effort Style Cleanup
- Took a stab at fixing Object.defineProperty on IE8 without
bad side-effects. (@hax)
- Object.isExtensible no longer fakes it. (@xavierm)
- Date.prototype.toISOString no longer deals with partial
ISO dates, per spec (@kitcambridge)
- More (mostly from @bryanforbes)
1.2.9
- Corrections to toISOString by @kitcambridge
- Fixed three bugs in array methods revealed by Jasmine tests.
- Cleaned up Function.prototype.bind with more fixes and tests from
@bryanforbes.
1.2.8
- Actually fixed problems with Function.prototype.bind, and regressions
from 1.2.7 (@bryanforbes, @jdalton #36)
1.2.7 - REGRESSED
- Fixed problems with Function.prototype.bind when called as a constructor.
(@jdalton #36)
1.2.6
- Revised Date.parse to match ES 5.1 (kitcambridge)
1.2.5
- Fixed a bug for padding it Date..toISOString (tadfisher issue #33)
1.2.4
- Fixed a descriptor bug in Object.defineProperty (raynos)
1.2.3
- Cleaned up RequireJS and <script> boilerplate
1.2.2
- Changed reduce to follow the letter of the spec with regard to having and
owning properties.
- Fixed a bug where RegExps pass as Functions in some engines in reduce.
1.2.1
- Adding few fixes to make jshint happy.
- Fix for issue #12, function expressions can cause scoping issues in IE.
- NPM will minify on install or when `npm run-script install` is executed.
- Adding .gitignore to avoid publishing dev dependencies.
1.2.0
- Making script loadable as AMD module.
- Adding `indexOf` to the list of safe shims.
1.1.0
- Added support for accessor properties where possible (which is all browsers
except IE).
- Stop exposing bound function's (that are returned by
`Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`)
as in some cases (when using facade objects for example) capabilities of the
enclosed functions will be leaked.
- `Object.create` now explicitly sets `__proto__` property to guarantee
correct behavior of `Object.getPrototypeOf`'s on all objects created using
`Object.create`.
- Switched to `===` from `==` where possible as it's slightly faster on older
browsers that are target of this lib.
- Added names to all anonymous functions to have a better stack traces.
1.0.0
- fixed Date.toISODate, using UTC accessors, as in
http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986
(arian)
0.0.4
- Revised Object.getPrototypeOf to work in more cases
in response to http://ejohn.org/blog/objectgetprototypeof/
[issue #2] (fschaefer)
0.0.3
- Fixed typos in Object.keys (samsonjs)
0.0.2
Per kangax's recommendations:
- faster Object.create(null)
- fixed a function-scope function declaration statement in Object.create
0.0.1
- fixed Object.create(null), in so far as that's possible
- reworked Rhino Object.freeze(Function) bug detector and patcher
0.0.0
- forked from narwhal-lib
... ...
- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
Project)
- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
- kossnocorp Sasha Koss XXX TODO License or CLA
- bryanforbes Bryan Forbes XXX TODO License or CLA
- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
License
- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
- iwyg XXX TODO License or CLA
- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
- rwldrn Rick Waldron Copyright (C) 2011 MIT License
- lexer Alexey Zakharov XXX TODO License or CLA
- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
Copyright (C) 2009 MIT License
- Steven Levithan Copyright (C) 2012 MIT License
- Jordan Harband (C) 2013 MIT License
- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
Project)
- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
- kossnocorp Sasha Koss XXX TODO License or CLA
- bryanforbes Bryan Forbes XXX TODO License or CLA
- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
License
- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
- iwyg XXX TODO License or CLA
- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
- rwldrn Rick Waldron Copyright (C) 2011 MIT License
- lexer Alexey Zakharov XXX TODO License or CLA
- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
Copyright (C) 2009 MIT License
- Steven Levithan Copyright (C) 2012 MIT License
- Jordan Harband (C) 2013 MIT License
... ...
The MIT License (MIT)
Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
The MIT License (MIT)
Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
... ...
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
# The files that need updating when incrementing the version number.
VERSIONED_FILES := *.js *.json *.map README*
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
UTILS := semver
# Make sure that all required utilities can be located.
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
# Default target (by virtue of being the first non '.'-prefixed in the file).
.PHONY: _no-target-specified
_no-target-specified:
$(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests)
# Lists all targets defined in this makefile.
.PHONY: list
list:
@$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
.PHONY: test
test:
@npm test
.PHONY: _ensure-tag
_ensure-tag:
ifndef TAG
$(error Please invoke with `make TAG=<new-version> release`, where <new-version> is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number)
endif
CHANGELOG_ERROR = $(error No CHANGES specified)
.PHONY: _ensure-changelog
_ensure-changelog:
@ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2)
# Ensures that the git workspace is clean.
.PHONY: _ensure-clean
_ensure-clean:
@[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGES')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; }
# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`.
.PHONY: release
release: _ensure-tag _ensure-changelog _ensure-clean
@old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \
new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \
if printf "$$new_ver" | command grep -q '^[0-9]'; then \
semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \
semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \
else \
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
fi; \
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
npm run minify; \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
replace "blob/master" "blob/v$$new_ver" -- *.min.js && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \
git tag -a -m "v$$new_ver" "v$$new_ver"
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
# The files that need updating when incrementing the version number.
VERSIONED_FILES := *.js *.json *.map README*
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
UTILS := semver
# Make sure that all required utilities can be located.
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
# Default target (by virtue of being the first non '.'-prefixed in the file).
.PHONY: _no-target-specified
_no-target-specified:
$(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests)
# Lists all targets defined in this makefile.
.PHONY: list
list:
@$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
.PHONY: test
test:
@npm test
.PHONY: _ensure-tag
_ensure-tag:
ifndef TAG
$(error Please invoke with `make TAG=<new-version> release`, where <new-version> is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number)
endif
CHANGELOG_ERROR = $(error No CHANGES specified)
.PHONY: _ensure-changelog
_ensure-changelog:
@ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2)
# Ensures that the git workspace is clean.
.PHONY: _ensure-clean
_ensure-clean:
@[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGES')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; }
# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`.
.PHONY: release
release: _ensure-tag _ensure-changelog _ensure-clean
@old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \
new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \
if printf "$$new_ver" | command grep -q '^[0-9]'; then \
semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \
semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \
else \
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
fi; \
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
npm run minify; \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
replace "blob/master" "blob/v$$new_ver" -- *.min.js && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \
git tag -a -m "v$$new_ver" "v$$new_ver"
... ...
#es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
[![npm badge][npm-badge-png]][npm-url]
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
contain all EcmaScript 5 methods that can be faithfully emulated with a
legacy JavaScript engine.
**Note:** As `es5-shim.js` is designed to patch the native Javascript
engine, it should be the library that is loaded first.
`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
closely as possible. For these methods, as closely as possible to ES5
is not very close. Many of these shams are intended only to allow code
to be written to ES5 without causing run-time errors in older engines.
In many cases, this means that these shams cause many ES5 methods to
silently fail. Decide carefully whether this is what you want.
**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly.
## Tests
The tests are written with the Jasmine BDD test framework.
To run the tests, navigate to <root-folder>/tests/ , or,
simply `npm install` and `npm test`.
## Shims
### Complete tests ###
* Array.prototype.every
* Array.prototype.filter
* Array.prototype.forEach
* Array.prototype.indexOf
* Array.prototype.lastIndexOf
* Array.prototype.map
* Array.prototype.slice
* Array.prototype.some
* Array.prototype.sort
* Array.prototype.reduce
* Array.prototype.reduceRight
* Array.prototype.push
* Array.prototype.join
* Array.isArray
* Date.now
* Date.prototype.toJSON
* Function.prototype.bind
* :warning: Caveat: the bound function has a prototype property.
* :warning: Caveat: bound functions do not try too hard to keep you
from manipulating their ``arguments`` and ``caller`` properties.
* :warning: Caveat: bound functions don't have checks in ``call`` and
``apply`` to avoid executing as a constructor.
* Number.prototype.toFixed
* Number.prototype.toPrecision
* Object.keys
* String.prototype.split
* String.prototype.trim
* String.prototype.lastIndexOf
* String.prototype.replace
* Firefox (through v29) natively handles capturing groups incorrectly.
* Date.parse (for ISO parsing)
* Date.prototype.toISOString
* parseInt
* parseFloat
* Error.prototype.toString
* Error.prototype.name
* Error.prototype.message
* RegExp.prototype.toString
## Shams
* :warning: Object.create
For the case of simply "begetting" an object that inherits
prototypically from another, this should work fine across legacy
engines.
:warning: The second argument is passed to Object.defineProperties
which will probably fail either silently or with extreme prejudice.
* :warning: Object.getPrototypeOf
This will return "undefined" in some cases. It uses `__proto__` if
it's available. Failing that, it uses constructor.prototype, which
depends on the constructor property of the object's prototype having
not been replaced. If your object was created like this, it won't
work:
function Foo() {
}
Foo.prototype = {};
Because the prototype reassignment destroys the constructor
property.
This will work for all objects that were created using
`Object.create` implemented with this library.
* :warning: Object.getOwnPropertyNames
This method uses Object.keys, so it will not be accurate on legacy
engines.
* Object.isSealed
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isFrozen
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isExtensible
Works like a charm, by trying very hard to extend the object then
redacting the extension.
### May fail
* :warning: Object.getOwnPropertyDescriptor
The behavior of this shim does not conform to ES5. It should
probably not be used at this time, until its behavior has been
reviewed and been confirmed to be useful in legacy engines.
* :warning: Object.defineProperty
In the worst of circumstances, IE 8 provides a version of this
method that only works on DOM objects. This sham will not be
installed. The given version of `defineProperty` will throw an
exception if used on non-DOM objects.
In slightly better circumstances, this method will silently fail to
set "writable", "enumerable", and "configurable" properties.
Providing a getter or setter with "get" or "set" on a descriptor
will silently fail on engines that lack "__defineGetter__" and
"__defineSetter__", which include all versions of IE.
https://github.com/es-shims/es5-shim/issues#issue/5
* :warning: Object.defineProperties
This uses the Object.defineProperty shim.
* Object.seal
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.freeze
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.preventExtensions
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
### Example of applying ES compatability shims in a browser project
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script>
<script src="https://wzrd.in/standalone/es7-shim@latest"></script>
<script src="other-libs.js"></script>
```
[npm-url]: https://npmjs.org/package/es5-shim
[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg
[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg
[travis-url]: https://travis-ci.org/es-shims/es5-shim
[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg
[deps-url]: https://david-dm.org/es-shims/es5-shim
[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true
#es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
[![npm badge][npm-badge-png]][npm-url]
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
contain all EcmaScript 5 methods that can be faithfully emulated with a
legacy JavaScript engine.
**Note:** As `es5-shim.js` is designed to patch the native Javascript
engine, it should be the library that is loaded first.
`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
closely as possible. For these methods, as closely as possible to ES5
is not very close. Many of these shams are intended only to allow code
to be written to ES5 without causing run-time errors in older engines.
In many cases, this means that these shams cause many ES5 methods to
silently fail. Decide carefully whether this is what you want.
**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly.
## Tests
The tests are written with the Jasmine BDD test framework.
To run the tests, navigate to <root-folder>/tests/ , or,
simply `npm install` and `npm test`.
## Shims
### Complete tests ###
* Array.prototype.every
* Array.prototype.filter
* Array.prototype.forEach
* Array.prototype.indexOf
* Array.prototype.lastIndexOf
* Array.prototype.map
* Array.prototype.slice
* Array.prototype.some
* Array.prototype.sort
* Array.prototype.reduce
* Array.prototype.reduceRight
* Array.prototype.push
* Array.prototype.join
* Array.isArray
* Date.now
* Date.prototype.toJSON
* Function.prototype.bind
* :warning: Caveat: the bound function has a prototype property.
* :warning: Caveat: bound functions do not try too hard to keep you
from manipulating their ``arguments`` and ``caller`` properties.
* :warning: Caveat: bound functions don't have checks in ``call`` and
``apply`` to avoid executing as a constructor.
* Number.prototype.toFixed
* Number.prototype.toPrecision
* Object.keys
* String.prototype.split
* String.prototype.trim
* String.prototype.lastIndexOf
* String.prototype.replace
* Firefox (through v29) natively handles capturing groups incorrectly.
* Date.parse (for ISO parsing)
* Date.prototype.toISOString
* parseInt
* parseFloat
* Error.prototype.toString
* Error.prototype.name
* Error.prototype.message
* RegExp.prototype.toString
## Shams
* :warning: Object.create
For the case of simply "begetting" an object that inherits
prototypically from another, this should work fine across legacy
engines.
:warning: The second argument is passed to Object.defineProperties
which will probably fail either silently or with extreme prejudice.
* :warning: Object.getPrototypeOf
This will return "undefined" in some cases. It uses `__proto__` if
it's available. Failing that, it uses constructor.prototype, which
depends on the constructor property of the object's prototype having
not been replaced. If your object was created like this, it won't
work:
function Foo() {
}
Foo.prototype = {};
Because the prototype reassignment destroys the constructor
property.
This will work for all objects that were created using
`Object.create` implemented with this library.
* :warning: Object.getOwnPropertyNames
This method uses Object.keys, so it will not be accurate on legacy
engines.
* Object.isSealed
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isFrozen
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isExtensible
Works like a charm, by trying very hard to extend the object then
redacting the extension.
### May fail
* :warning: Object.getOwnPropertyDescriptor
The behavior of this shim does not conform to ES5. It should
probably not be used at this time, until its behavior has been
reviewed and been confirmed to be useful in legacy engines.
* :warning: Object.defineProperty
In the worst of circumstances, IE 8 provides a version of this
method that only works on DOM objects. This sham will not be
installed. The given version of `defineProperty` will throw an
exception if used on non-DOM objects.
In slightly better circumstances, this method will silently fail to
set "writable", "enumerable", and "configurable" properties.
Providing a getter or setter with "get" or "set" on a descriptor
will silently fail on engines that lack "__defineGetter__" and
"__defineSetter__", which include all versions of IE.
https://github.com/es-shims/es5-shim/issues#issue/5
* :warning: Object.defineProperties
This uses the Object.defineProperty shim.
* Object.seal
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.freeze
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.preventExtensions
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
### Example of applying ES compatability shims in a browser project
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script>
<script src="https://wzrd.in/standalone/es7-shim@latest"></script>
<script src="other-libs.js"></script>
```
[npm-url]: https://npmjs.org/package/es5-shim
[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg
[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg
[travis-url]: https://travis-ci.org/es-shims/es5-shim
[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg
[deps-url]: https://david-dm.org/es-shims/es5-shim
[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true
... ...
{
"name": "es5-shim",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/es5-shim"
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
]
}
{
"name": "es5-shim",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/es5-shim"
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
]
}
... ...
{
"name": "es5-shim",
"repo": "es-shims/es5-shim",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"version": "v4.5.1",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"main": "es5-shim.js",
"scripts": [
"es5-shim.js"
]
}
{
"name": "es5-shim",
"repo": "es-shims/es5-shim",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"version": "v4.5.1",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"main": "es5-shim.js",
"scripts": [
"es5-shim.js"
]
}
... ...
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
var call = Function.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable);
var toStr = call.bind(prototypeOfObject.toString);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors = owns(prototypeOfObject, '__defineGetter__');
if (supportsAccessors) {
/* eslint-disable no-underscore-dangle */
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
/* eslint-enable no-underscore-dangle */
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
// ... this will nerever possibly return null
// ... Opera Mini breaks here with infinite loops
Object.getPrototypeOf = function getPrototypeOf(object) {
/* eslint-disable no-proto */
var proto = object.__proto__;
/* eslint-enable no-proto */
if (proto || proto === null) {
return proto;
} else if (toStr(object.constructor) === '[object Function]') {
return object.constructor.prototype;
} else if (object instanceof Object) {
return prototypeOfObject;
} else {
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
}
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially.
if (Object.defineProperty) {
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' ||
doesGetOwnPropertyDescriptorWork(document.createElement('div'));
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: ';
/* eslint-disable no-proto */
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
var descriptor;
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return descriptor;
}
// If object has a property then it's for sure `configurable`, and
// probably `enumerable`. Detect enumerability though.
descriptor = {
enumerable: isEnumerable(object, property),
configurable: true
};
// If JS engine supports accessor properties then property may be a
// getter or setter.
if (supportsAccessors) {
// Unfortunately `__lookupGetter__` will return a getter even
// if object has own non getter property along with a same named
// inherited getter. To avoid misbehavior we temporary remove
// `__proto__` so that `__lookupGetter__` will return getter only
// if it's owned by an object.
var prototype = object.__proto__;
var notPrototypeOfObject = object !== prototypeOfObject;
// avoid recursion problem, breaking in Opera Mini when
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject;
}
var getter = lookupGetter(object, property);
var setter = lookupSetter(object, property);
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype;
}
if (getter || setter) {
if (getter) {
descriptor.get = getter;
}
if (setter) {
descriptor.set = setter;
}
// If it was accessor property we're done and return here
// in order to avoid adding `value` to the descriptor.
return descriptor;
}
}
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
/* eslint-enable no-proto */
}
// ES5 15.2.3.4
// http://es5.github.com/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
};
}
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = !({ __proto__: null } instanceof Object);
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
/* global ActiveXObject */
var shouldUseActiveX = function shouldUseActiveX() {
// return early if document.domain not set
if (!document.domain) {
return false;
}
try {
return !!new ActiveXObject('htmlfile');
} catch (exception) {
return false;
}
};
// This supports IE8 when document.domain is used
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
var getEmptyViaActiveX = function getEmptyViaActiveX() {
var empty;
var xDoc;
xDoc = new ActiveXObject('htmlfile');
var script = 'script';
xDoc.write('<' + script + '></' + script + '>');
xDoc.close();
empty = xDoc.parentWindow.Object.prototype;
xDoc = null;
return empty;
};
// The original implementation using an iframe
// before the activex approach was added
// see https://github.com/es-shims/es5-shim/issues/150
var getEmptyViaIFrame = function getEmptyViaIFrame() {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
var empty;
iframe.style.display = 'none';
parent.appendChild(iframe);
/* eslint-disable no-script-url */
iframe.src = 'javascript:';
/* eslint-enable no-script-url */
empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
return empty;
};
/* global document */
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
return { __proto__: null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
// Determine which approach to use
// see https://github.com/es-shims/es5-shim/issues/150
var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
var Empty = function Empty() {};
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
var Type = function Type() {}; // An empty constructor.
if (prototype === null) {
object = createEmpty();
} else {
if (typeof prototype !== 'object' && typeof prototype !== 'function') {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
// neither `__proto__`, but this manually setting `__proto__` will
// guarantee that `Object.getPrototypeOf` will work as expected with
// objects created using `Object.create`
/* eslint-disable no-proto */
object.__proto__ = prototype;
/* eslint-enable no-proto */
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
// ES5 15.2.3.6
// http://es5.github.com/#x15.2.3.6
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
// WebKit Bugs:
// https://bugs.webkit.org/show_bug.cgi?id=36423
var doesDefinePropertyWork = function doesDefinePropertyWork(object) {
try {
Object.defineProperty(object, 'sentinel', {});
return 'sentinel' in object;
} catch (exception) {
return false;
}
};
// check whether defineProperty works if it's given. Otherwise,
// shim partially.
if (Object.defineProperty) {
var definePropertyWorksOnObject = doesDefinePropertyWork({});
var definePropertyWorksOnDom = typeof document === 'undefined' ||
doesDefinePropertyWork(document.createElement('div'));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
if (!Object.defineProperty || definePropertyFallback) {
var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: ';
var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ';
var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';
Object.defineProperty = function defineProperty(object, property, descriptor) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) {
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
}
// make a valiant attempt to use the real defineProperty
// for I8's DOM elements.
if (definePropertyFallback) {
try {
return definePropertyFallback.call(Object, object, property, descriptor);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If it's a data property.
if ('value' in descriptor) {
// fail silently if 'writable', 'enumerable', or 'configurable'
// are requested but not supported
/*
// alternate approach:
if ( // can't implement these features; allow false but not true
('writable' in descriptor && !descriptor.writable) ||
('enumerable' in descriptor && !descriptor.enumerable) ||
('configurable' in descriptor && !descriptor.configurable)
))
throw new RangeError(
'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.'
);
*/
if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {
// As accessors are supported only on engines implementing
// `__proto__` we can safely override `__proto__` while defining
// a property to make sure that we don't hit an inherited
// accessor.
/* eslint-disable no-proto */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
// defined on object itself.
delete object[property];
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto */
} else {
object[property] = descriptor.value;
}
} else {
if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) {
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
}
// If we got that far then getters and setters can be defined !!
if ('get' in descriptor) {
defineGetter(object, property, descriptor.get);
}
if ('set' in descriptor) {
defineSetter(object, property, descriptor.set);
}
}
return object;
};
}
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
Object.keys(properties).forEach(function (property) {
if (property !== '__proto__') {
Object.defineProperty(object, property, properties[property]);
}
});
return object;
};
}
// ES5 15.2.3.8
// http://es5.github.com/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
throw new TypeError('Object.seal can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.9
// http://es5.github.com/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// detect a Rhino bug and patch it
try {
Object.freeze(function () {});
} catch (exception) {
Object.freeze = (function (freezeObject) {
return function freeze(object) {
if (typeof object === 'function') {
return object;
} else {
return freezeObject(object);
}
};
}(Object.freeze));
}
// ES5 15.2.3.10
// http://es5.github.com/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
throw new TypeError('Object.preventExtensions can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.11
// http://es5.github.com/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isSealed can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.12
// http://es5.github.com/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isFrozen can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.13
// http://es5.github.com/#x15.2.3.13
if (!Object.isExtensible) {
Object.isExtensible = function isExtensible(object) {
// 1. If Type(O) is not Object throw a TypeError exception.
if (Object(object) !== object) {
throw new TypeError('Object.isExtensible can only be called on Objects.');
}
// 2. Return the Boolean value of the [[Extensible]] internal property of O.
var name = '';
while (owns(object, name)) {
name += '?';
}
object[name] = true;
var returnValue = owns(object, name);
delete object[name];
return returnValue;
};
}
}));
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
var call = Function.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable);
var toStr = call.bind(prototypeOfObject.toString);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors = owns(prototypeOfObject, '__defineGetter__');
if (supportsAccessors) {
/* eslint-disable no-underscore-dangle */
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
/* eslint-enable no-underscore-dangle */
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
// ... this will nerever possibly return null
// ... Opera Mini breaks here with infinite loops
Object.getPrototypeOf = function getPrototypeOf(object) {
/* eslint-disable no-proto */
var proto = object.__proto__;
/* eslint-enable no-proto */
if (proto || proto === null) {
return proto;
} else if (toStr(object.constructor) === '[object Function]') {
return object.constructor.prototype;
} else if (object instanceof Object) {
return prototypeOfObject;
} else {
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
}
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially.
if (Object.defineProperty) {
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' ||
doesGetOwnPropertyDescriptorWork(document.createElement('div'));
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: ';
/* eslint-disable no-proto */
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
var descriptor;
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return descriptor;
}
// If object has a property then it's for sure `configurable`, and
// probably `enumerable`. Detect enumerability though.
descriptor = {
enumerable: isEnumerable(object, property),
configurable: true
};
// If JS engine supports accessor properties then property may be a
// getter or setter.
if (supportsAccessors) {
// Unfortunately `__lookupGetter__` will return a getter even
// if object has own non getter property along with a same named
// inherited getter. To avoid misbehavior we temporary remove
// `__proto__` so that `__lookupGetter__` will return getter only
// if it's owned by an object.
var prototype = object.__proto__;
var notPrototypeOfObject = object !== prototypeOfObject;
// avoid recursion problem, breaking in Opera Mini when
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject;
}
var getter = lookupGetter(object, property);
var setter = lookupSetter(object, property);
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype;
}
if (getter || setter) {
if (getter) {
descriptor.get = getter;
}
if (setter) {
descriptor.set = setter;
}
// If it was accessor property we're done and return here
// in order to avoid adding `value` to the descriptor.
return descriptor;
}
}
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
/* eslint-enable no-proto */
}
// ES5 15.2.3.4
// http://es5.github.com/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
};
}
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = !({ __proto__: null } instanceof Object);
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
/* global ActiveXObject */
var shouldUseActiveX = function shouldUseActiveX() {
// return early if document.domain not set
if (!document.domain) {
return false;
}
try {
return !!new ActiveXObject('htmlfile');
} catch (exception) {
return false;
}
};
// This supports IE8 when document.domain is used
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
var getEmptyViaActiveX = function getEmptyViaActiveX() {
var empty;
var xDoc;
xDoc = new ActiveXObject('htmlfile');
var script = 'script';
xDoc.write('<' + script + '></' + script + '>');
xDoc.close();
empty = xDoc.parentWindow.Object.prototype;
xDoc = null;
return empty;
};
// The original implementation using an iframe
// before the activex approach was added
// see https://github.com/es-shims/es5-shim/issues/150
var getEmptyViaIFrame = function getEmptyViaIFrame() {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
var empty;
iframe.style.display = 'none';
parent.appendChild(iframe);
/* eslint-disable no-script-url */
iframe.src = 'javascript:';
/* eslint-enable no-script-url */
empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
return empty;
};
/* global document */
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
return { __proto__: null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
// Determine which approach to use
// see https://github.com/es-shims/es5-shim/issues/150
var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
var Empty = function Empty() {};
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
var Type = function Type() {}; // An empty constructor.
if (prototype === null) {
object = createEmpty();
} else {
if (typeof prototype !== 'object' && typeof prototype !== 'function') {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
// neither `__proto__`, but this manually setting `__proto__` will
// guarantee that `Object.getPrototypeOf` will work as expected with
// objects created using `Object.create`
/* eslint-disable no-proto */
object.__proto__ = prototype;
/* eslint-enable no-proto */
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
// ES5 15.2.3.6
// http://es5.github.com/#x15.2.3.6
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
// WebKit Bugs:
// https://bugs.webkit.org/show_bug.cgi?id=36423
var doesDefinePropertyWork = function doesDefinePropertyWork(object) {
try {
Object.defineProperty(object, 'sentinel', {});
return 'sentinel' in object;
} catch (exception) {
return false;
}
};
// check whether defineProperty works if it's given. Otherwise,
// shim partially.
if (Object.defineProperty) {
var definePropertyWorksOnObject = doesDefinePropertyWork({});
var definePropertyWorksOnDom = typeof document === 'undefined' ||
doesDefinePropertyWork(document.createElement('div'));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
if (!Object.defineProperty || definePropertyFallback) {
var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: ';
var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ';
var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';
Object.defineProperty = function defineProperty(object, property, descriptor) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) {
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
}
// make a valiant attempt to use the real defineProperty
// for I8's DOM elements.
if (definePropertyFallback) {
try {
return definePropertyFallback.call(Object, object, property, descriptor);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If it's a data property.
if ('value' in descriptor) {
// fail silently if 'writable', 'enumerable', or 'configurable'
// are requested but not supported
/*
// alternate approach:
if ( // can't implement these features; allow false but not true
('writable' in descriptor && !descriptor.writable) ||
('enumerable' in descriptor && !descriptor.enumerable) ||
('configurable' in descriptor && !descriptor.configurable)
))
throw new RangeError(
'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.'
);
*/
if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {
// As accessors are supported only on engines implementing
// `__proto__` we can safely override `__proto__` while defining
// a property to make sure that we don't hit an inherited
// accessor.
/* eslint-disable no-proto */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
// defined on object itself.
delete object[property];
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto */
} else {
object[property] = descriptor.value;
}
} else {
if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) {
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
}
// If we got that far then getters and setters can be defined !!
if ('get' in descriptor) {
defineGetter(object, property, descriptor.get);
}
if ('set' in descriptor) {
defineSetter(object, property, descriptor.set);
}
}
return object;
};
}
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
Object.keys(properties).forEach(function (property) {
if (property !== '__proto__') {
Object.defineProperty(object, property, properties[property]);
}
});
return object;
};
}
// ES5 15.2.3.8
// http://es5.github.com/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
throw new TypeError('Object.seal can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.9
// http://es5.github.com/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// detect a Rhino bug and patch it
try {
Object.freeze(function () {});
} catch (exception) {
Object.freeze = (function (freezeObject) {
return function freeze(object) {
if (typeof object === 'function') {
return object;
} else {
return freezeObject(object);
}
};
}(Object.freeze));
}
// ES5 15.2.3.10
// http://es5.github.com/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
throw new TypeError('Object.preventExtensions can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.11
// http://es5.github.com/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isSealed can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.12
// http://es5.github.com/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isFrozen can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.13
// http://es5.github.com/#x15.2.3.13
if (!Object.isExtensible) {
Object.isExtensible = function isExtensible(object) {
// 1. If Type(O) is not Object throw a TypeError exception.
if (Object(object) !== object) {
throw new TypeError('Object.isExtensible can only be called on Objects.');
}
// 2. Return the Boolean value of the [[Extensible]] internal property of O.
var name = '';
while (owns(object, name)) {
name += '?';
}
object[name] = true;
var returnValue = owns(object, name);
delete object[name];
return returnValue;
};
}
}));
... ...
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r===null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}var u=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var p=u({});var s=typeof document==="undefined"||u(document.createElement("div"));if(!s||!p){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var O="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(O+e)}if(b){try{return b.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var s=f(e,o);var y=a(e,o);if(p){e.__proto__=u}if(s||y){if(s){c.get=s}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var d=!({__proto__:null}instanceof Object);var j=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var v=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");t.write("<script></script>");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var _=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(d||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=j()?v():_();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else{if(typeof e!=="object"&&typeof e!=="function"){throw new TypeError("Object prototype may only be an Object or null")}n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var w=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var m=w({});var P=typeof document==="undefined"||w(document.createElement("div"));if(!m||!P){var E=Object.defineProperty,h=Object.defineProperties}}if(!Object.defineProperty||E){var g="Property description must be an object: ";var z="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(z+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(g+n)}if(E){try{return E.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=u}else{e[r]=n.value}}else{if(!l&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){i(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||h){Object.defineProperties=function defineProperties(e,t){if(h){try{return h.call(Object,e,t)}catch(r){}}Object.keys(t).forEach(function(r){if(r!=="__proto__"){Object.defineProperty(e,r,t[r])}});return e}}if(!Object.seal){Object.seal=function seal(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function freeze(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(x){Object.freeze=function(e){return function freeze(t){if(typeof t==="function"){return t}else{return e(t)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function isSealed(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(e){if(Object(e)!==e){throw new TypeError("Object.isExtensible can only be called on Objects.")}var t="";while(r(e,t)){t+="?"}e[t]=true;var n=r(e,t);delete e[t];return n}}});
//# sourceMappingURL=es5-sham.map
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r===null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}var u=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var p=u({});var s=typeof document==="undefined"||u(document.createElement("div"));if(!s||!p){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var O="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(O+e)}if(b){try{return b.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var s=f(e,o);var y=a(e,o);if(p){e.__proto__=u}if(s||y){if(s){c.get=s}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var d=!({__proto__:null}instanceof Object);var j=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var v=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");t.write("<script></script>");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var _=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(d||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=j()?v():_();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else{if(typeof e!=="object"&&typeof e!=="function"){throw new TypeError("Object prototype may only be an Object or null")}n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var w=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var m=w({});var P=typeof document==="undefined"||w(document.createElement("div"));if(!m||!P){var E=Object.defineProperty,h=Object.defineProperties}}if(!Object.defineProperty||E){var g="Property description must be an object: ";var z="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(z+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(g+n)}if(E){try{return E.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=u}else{e[r]=n.value}}else{if(!l&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){i(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||h){Object.defineProperties=function defineProperties(e,t){if(h){try{return h.call(Object,e,t)}catch(r){}}Object.keys(t).forEach(function(r){if(r!=="__proto__"){Object.defineProperty(e,r,t[r])}});return e}}if(!Object.seal){Object.seal=function seal(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function freeze(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(x){Object.freeze=function(e){return function freeze(t){if(typeof t==="function"){return t}else{return e(t)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function isSealed(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(e){if(Object(e)!==e){throw new TypeError("Object.isExtensible can only be called on Objects.")}var t="";while(r(e,t)){t+="?"}e[t]=true;var n=r(e,t);delete e[t];return n}}});
//# sourceMappingURL=es5-sham.map
... ...
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Array;var r=t.prototype;var e=Object;var n=e.prototype;var i=Function;var a=i.prototype;var o=String;var f=o.prototype;var u=Number;var l=u.prototype;var s=r.slice;var c=r.splice;var v=r.push;var h=r.unshift;var p=r.concat;var y=r.join;var d=a.call;var g=a.apply;var w=Math.max;var b=Math.min;var T=n.toString;var m=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var D;var x=Function.prototype.toString,S=/^\s*class /,O=function isES6ClassFn(t){try{var r=x.call(t);var e=r.replace(/\/\/.*\n/g,"");var n=e.replace(/\/\*[.\s\S]*\*\//g,"");var i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return S.test(i)}catch(a){return false}},E=function tryFunctionObject(t){try{if(O(t)){return false}x.call(t);return true}catch(r){return false}},j="[object Function]",I="[object GeneratorFunction]",D=function isCallable(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(m){return E(t)}if(O(t)){return false}var r=T.call(t);return r===j||r===I};var M;var U=RegExp.prototype.exec,F=function tryRegexExec(t){try{U.call(t);return true}catch(r){return false}},N="[object RegExp]";M=function isRegex(t){if(typeof t!=="object"){return false}return m?F(t):T.call(t)===N};var C;var k=String.prototype.valueOf,R=function tryStringObject(t){try{k.call(t);return true}catch(r){return false}},A="[object String]";C=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return m?R(t):T.call(t)===A};var P=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:false,value:t});for(var r in t){return false}return t.x===t}catch(n){return false}}();var $=function(t){var r;if(P){r=function(t,r,n,i){if(!i&&r in t){return}e.defineProperty(t,r,{configurable:true,enumerable:false,writable:true,value:n})}}else{r=function(t,r,e,n){if(!n&&r in t){return}t[r]=e}}return function defineProperties(e,n,i){for(var a in n){if(t.call(n,a)){r(e,a,n[a],i)}}}}(n.hasOwnProperty);var J=function isPrimitive(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"};var Y=u.isNaN||function(t){return t!==t};var Z={ToInteger:function ToInteger(t){var r=+t;if(Y(r)){r=0}else if(r!==0&&r!==1/0&&r!==-(1/0)){r=(r>0||-1)*Math.floor(Math.abs(r))}return r},ToPrimitive:function ToPrimitive(t){var r,e,n;if(J(t)){return t}e=t.valueOf;if(D(e)){r=e.call(t);if(J(r)){return r}}n=t.toString;if(D(n)){r=n.call(t);if(J(r)){return r}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return e(t)},ToUint32:function ToUint32(t){return t>>>0}};var z=function Empty(){};$(a,{bind:function bind(t){var r=this;if(!D(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var n=s.call(arguments,1);var a;var o=function(){if(this instanceof a){var i=g.call(r,this,p.call(n,s.call(arguments)));if(e(i)===i){return i}return this}else{return g.call(r,t,p.call(n,s.call(arguments)))}};var f=w(0,r.length-n.length);var u=[];for(var l=0;l<f;l++){v.call(u,"$"+l)}a=i("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(o);if(r.prototype){z.prototype=r.prototype;a.prototype=new z;z.prototype=null}return a}});var G=d.bind(n.hasOwnProperty);var B=d.bind(n.toString);var H=d.bind(s);var W=g.bind(s);var L=d.bind(f.slice);var X=d.bind(f.split);var q=d.bind(f.indexOf);var K=d.bind(v);var Q=d.bind(n.propertyIsEnumerable);var V=d.bind(r.sort);var _=t.isArray||function isArray(t){return B(t)==="[object Array]"};var tt=[].unshift(0)!==1;$(r,{unshift:function(){h.apply(this,arguments);return this.length}},tt);$(t,{isArray:_});var rt=e("a");var et=rt[0]!=="a"||!(0 in rt);var nt=function properlyBoxed(t){var r=true;var e=true;var n=false;if(t){try{t.call("foo",function(t,e,n){if(typeof n!=="object"){r=false}});t.call([1],function(){"use strict";e=typeof this==="string"},"x")}catch(i){n=true}}return!!t&&!n&&r&&e};$(r,{forEach:function forEach(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=-1;var i=Z.ToUint32(e.length);var a;if(arguments.length>1){a=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in e){if(typeof a==="undefined"){t(e[n],n,r)}else{t.call(a,e[n],n,r)}}}}},!nt(r.forEach));$(r,{map:function map(r){var e=Z.ToObject(this);var n=et&&C(this)?X(this,""):e;var i=Z.ToUint32(n.length);var a=t(i);var o;if(arguments.length>1){o=arguments[1]}if(!D(r)){throw new TypeError("Array.prototype.map callback must be a function")}for(var f=0;f<i;f++){if(f in n){if(typeof o==="undefined"){a[f]=r(n[f],f,e)}else{a[f]=r.call(o,n[f],f,e)}}}return a}},!nt(r.map));$(r,{filter:function filter(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var f=0;f<n;f++){if(f in e){a=e[f];if(typeof o==="undefined"?t(a,f,r):t.call(o,a,f,r)){K(i,a)}}}return i}},!nt(r.filter));$(r,{every:function every(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in e&&!(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return false}}return true}},!nt(r.every));$(r,{some:function some(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in e&&(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return true}}return false}},!nt(r.some));var it=false;if(r.reduce){it=typeof r.reduce.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduce:function reduce(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduce callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var a;if(arguments.length>=2){a=arguments[1]}else{do{if(i in e){a=e[i++];break}if(++i>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i<n;i++){if(i in e){a=t(a,e[i],i,r)}}return a}},!it);var at=false;if(r.reduceRight){at=typeof r.reduceRight.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduceRight:function reduceRight(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduceRight callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i;var a=n-1;if(arguments.length>=2){i=arguments[1]}else{do{if(a in e){i=e[a--];break}if(--a<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(a<0){return i}do{if(a in e){i=t(i,e[a],a,r)}}while(a--);return i}},!at);var ot=r.indexOf&&[0,1].indexOf(1,2)!==-1;$(r,{indexOf:function indexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=Z.ToInteger(arguments[1])}n=n>=0?n:w(0,e+n);for(;n<e;n++){if(n in r&&r[n]===t){return n}}return-1}},ot);var ft=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;$(r,{lastIndexOf:function lastIndexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=e-1;if(arguments.length>1){n=b(n,Z.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in r&&t===r[n]){return n}}return-1}},ft);var ut=function(){var t=[1,2];var r=t.splice();return t.length===2&&_(r)&&r.length===0}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}else{return c.apply(this,arguments)}}},!ut);var lt=function(){var t={};r.splice.call(t,0,0,1);return t.length===1}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}var e=arguments;this.length=w(Z.ToInteger(this.length),0);if(arguments.length>0&&typeof r!=="number"){e=H(arguments);if(e.length<2){K(e,this.length-t)}else{e[1]=Z.ToInteger(r)}}return c.apply(this,e)}},!lt);var st=function(){var r=new t(1e5);r[8]="x";r.splice(1,1);return r.indexOf("x")===7}();var ct=function(){var t=256;var r=[];r[t]="a";r.splice(t+1,0,"b");return r[t]==="a"}();$(r,{splice:function splice(t,r){var e=Z.ToObject(this);var n=[];var i=Z.ToUint32(e.length);var a=Z.ToInteger(t);var f=a<0?w(i+a,0):b(a,i);var u=b(w(Z.ToInteger(r),0),i-f);var l=0;var s;while(l<u){s=o(f+l);if(G(e,s)){n[l]=e[s]}l+=1}var c=H(arguments,2);var v=c.length;var h;if(v<u){l=f;var p=i-u;while(l<p){s=o(l+u);h=o(l+v);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l+=1}l=i;var y=i-u+v;while(l>y){delete e[l-1];l-=1}}else if(v>u){l=i-u;while(l>f){s=o(l+u-1);h=o(l+v-1);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l-=1}}l=f;for(var d=0;d<c.length;++d){e[l]=c[d];l+=1}e.length=i-u+v;return n}},!st||!ct);var vt=r.join;var ht;try{ht=Array.prototype.join.call("123",",")!=="1,2,3"}catch(pt){ht=true}if(ht){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(C(this)?X(this,""):this,r)}},ht)}var yt=[1,2].join(undefined)!=="1,2";if(yt){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(this,r)}},yt)}var dt=function push(t){var r=Z.ToObject(this);var e=Z.ToUint32(r.length);var n=0;while(n<arguments.length){r[e+n]=arguments[n];n+=1}r.length=e+n;return e+n};var gt=function(){var t={};var r=Array.prototype.push.call(t,undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:function push(t){if(_(this)){return v.apply(this,arguments)}return dt.apply(this,arguments)}},gt);var wt=function(){var t=[];var r=t.push(undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:dt},wt);$(r,{slice:function(t,r){var e=C(this)?X(this,""):this;return W(e,arguments)}},et);var bt=function(){try{[1,2].sort(null);[1,2].sort({});return true}catch(t){}return false}();var Tt=function(){try{[1,2].sort(/a/);return false}catch(t){}return true}();var mt=function(){try{[1,2].sort(undefined);return true}catch(t){}return false}();$(r,{sort:function sort(t){if(typeof t==="undefined"){return V(this)}if(!D(t)){throw new TypeError("Array.prototype.sort callback must be a function")}return V(this,t)}},bt||!mt||!Tt);var Dt=!{toString:null}.propertyIsEnumerable("toString");var xt=function(){}.propertyIsEnumerable("prototype");var St=!G("x","0");var Ot=function(t){var r=t.constructor;return r&&r.prototype===t};var Et={$window:true,$console:true,$parent:true,$self:true,$frame:true,$frames:true,$frameElement:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$external:true};var jt=function(){if(typeof window==="undefined"){return false}for(var t in window){try{if(!Et["$"+t]&&G(window,t)&&window[t]!==null&&typeof window[t]==="object"){Ot(window[t])}}catch(r){return true}}return false}();var It=function(t){if(typeof window==="undefined"||!jt){return Ot(t)}try{return Ot(t)}catch(r){return false}};var Mt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var Ut=Mt.length;var Ft=function isArguments(t){return B(t)==="[object Arguments]"};var Nt=function isArguments(t){return t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&!_(t)&&D(t.callee)};var Ct=Ft(arguments)?Ft:Nt;$(e,{keys:function keys(t){var r=D(t);var e=Ct(t);var n=t!==null&&typeof t==="object";var i=n&&C(t);if(!n&&!r&&!e){throw new TypeError("Object.keys called on a non-object")}var a=[];var f=xt&&r;if(i&&St||e){for(var u=0;u<t.length;++u){K(a,o(u))}}if(!e){for(var l in t){if(!(f&&l==="prototype")&&G(t,l)){K(a,o(l))}}}if(Dt){var s=It(t);for(var c=0;c<Ut;c++){var v=Mt[c];if(!(s&&v==="constructor")&&G(t,v)){K(a,v)}}}return a}});var kt=e.keys&&function(){return e.keys(arguments).length===2}(1,2);var Rt=e.keys&&function(){var t=e.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1);var At=e.keys;$(e,{keys:function keys(t){if(Ct(t)){return At(H(t))}else{return At(t)}}},!kt||Rt);var Pt=new Date(-0xc782b5b342b24).getUTCMonth()!==0;var $t=new Date(-0x55d318d56a724);var Jt=new Date(14496624e5);var Yt=$t.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT";var Zt;var zt;var Gt=$t.getTimezoneOffset();if(Gt<-720){Zt=$t.toDateString()!=="Tue Jan 02 -45875";zt=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}else{Zt=$t.toDateString()!=="Mon Jan 01 -45875";zt=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}var Bt=d.bind(Date.prototype.getFullYear);var Ht=d.bind(Date.prototype.getMonth);var Wt=d.bind(Date.prototype.getDate);var Lt=d.bind(Date.prototype.getUTCFullYear);var Xt=d.bind(Date.prototype.getUTCMonth);var qt=d.bind(Date.prototype.getUTCDate);var Kt=d.bind(Date.prototype.getUTCDay);var Qt=d.bind(Date.prototype.getUTCHours);var Vt=d.bind(Date.prototype.getUTCMinutes);var _t=d.bind(Date.prototype.getUTCSeconds);var tr=d.bind(Date.prototype.getUTCMilliseconds);var rr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var er=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var nr=function daysInMonth(t,r){return Wt(new Date(r,t,0))};$(Date.prototype,{getFullYear:function getFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);if(t<0&&Ht(this)>11){return t+1}return t},getMonth:function getMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);if(t<0&&r>11){return 0}return r},getDate:function getDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);var e=Wt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e},getUTCFullYear:function getUTCFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);if(t<0&&Xt(this)>11){return t+1}return t},getUTCMonth:function getUTCMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);if(t<0&&r>11){return 0}return r},getUTCDate:function getUTCDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);var e=qt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e}},Pt);$(Date.prototype,{toUTCString:function toUTCString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Kt(this);var r=qt(this);var e=Xt(this);var n=Lt(this);var i=Qt(this);var a=Vt(this);var o=_t(this);return rr[t]+", "+(r<10?"0"+r:r)+" "+er[e]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},Pt||Yt);$(Date.prototype,{toDateString:function toDateString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n}},Pt||Zt);if(Pt||zt){Date.prototype.toString=function toString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();var i=this.getHours();var a=this.getMinutes();var o=this.getSeconds();var f=this.getTimezoneOffset();var u=Math.floor(Math.abs(f)/60);var l=Math.floor(Math.abs(f)%60);return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(f>0?"-":"+")+(u<10?"0"+u:u)+(l<10?"0"+l:l)};if(P){e.defineProperty(Date.prototype,"toString",{configurable:true,enumerable:false,writable:true})}}var ir=-621987552e5;var ar="-000001";var or=Date.prototype.toISOString&&new Date(ir).toISOString().indexOf(ar)===-1;var fr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";var ur=d.bind(Date.prototype.getTime);$(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)||!isFinite(ur(this))){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}var t=Lt(this);var r=Xt(this);t+=Math.floor(r/12);r=(r%12+12)%12;var e=[r+1,qt(this),Qt(this),Vt(this),_t(this)];t=(t<0?"-":t>9999?"+":"")+L("00000"+Math.abs(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<e.length;++n){e[n]=L("00"+e[n],-2)}return t+"-"+H(e,0,2).join("-")+"T"+H(e,2).join(":")+"."+L("000"+tr(this),-3)+"Z"}},or||fr);var lr=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(ir).toJSON().indexOf(ar)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!lr){Date.prototype.toJSON=function toJSON(t){var r=e(this);var n=Z.ToPrimitive(r);if(typeof n==="number"&&!isFinite(n)){return null}var i=r.toISOString;if(!D(i)){throw new TypeError("toISOString property is not callable")}return i.call(r)}}var sr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var cr=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));var vr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(vr||cr||!sr){var hr=Math.pow(2,31)-1;var pr=Y(new Date(1970,0,1,0,0,0,hr+1).getTime());Date=function(t){var r=function Date(e,n,i,a,f,u,l){var s=arguments.length;var c;if(this instanceof t){var v=u;var h=l;if(pr&&s>=7&&l>hr){var p=Math.floor(l/hr)*hr;var y=Math.floor(p/1e3);v+=y;h-=y*1e3}c=s===1&&o(e)===e?new t(r.parse(e)):s>=7?new t(e,n,i,a,f,v,h):s>=6?new t(e,n,i,a,f,v):s>=5?new t(e,n,i,a,f):s>=4?new t(e,n,i,a):s>=3?new t(e,n,i):s>=2?new t(e,n):s>=1?new t(e instanceof t?+e:e):new t}else{c=t.apply(this,arguments)}if(!J(c)){$(c,{constructor:r},true)}return c};var e=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var n=[0,31,59,90,120,151,181,212,243,273,304,334,365];var i=function dayFromMonth(t,r){var e=r>1?1:0;return n[r]+Math.floor((t-1969+e)/4)-Math.floor((t-1901+e)/100)+Math.floor((t-1601+e)/400)+365*(t-1970)};var a=function toUTC(r){var e=0;var n=r;if(pr&&n>hr){var i=Math.floor(n/hr)*hr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new t(1970,0,1,0,0,e,n))};for(var f in t){if(G(t,f)){r[f]=t[f]}}$(r,{now:t.now,UTC:t.UTC},true);r.prototype=t.prototype;$(r.prototype,{constructor:r},true);var l=function parse(r){var n=e.exec(r);if(n){var o=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),h=Math.floor(u(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,d=u(n[10]||0),g=u(n[11]||0),w;var b=c>0||v>0||h>0;if(s<(b?24:25)&&c<60&&v<60&&h<1e3&&f>-1&&f<12&&d<24&&g<60&&l>-1&&l<i(o,f+1)-i(o,f)){w=((i(o,f)+l)*24+s+d*y)*60;w=((w+c+g*y)*60+v)*1e3+h;if(p){w=a(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return t.parse.apply(this,arguments)};$(r,{parse:l});return r}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var yr=l.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var dr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(t,r){var e=-1;var n=r;while(++e<dr.size){n+=t*dr.data[e];dr.data[e]=n%dr.base;n=Math.floor(n/dr.base)}},divide:function divide(t){var r=dr.size;var e=0;while(--r>=0){e+=dr.data[r];dr.data[r]=Math.floor(e/t);e=e%t*dr.base}},numToString:function numToString(){var t=dr.size;var r="";while(--t>=0){if(r!==""||t===0||dr.data[t]!==0){var e=o(dr.data[t]);if(r===""){r=e}else{r+=L("0000000",0,7-e.length)+e}}}return r},pow:function pow(t,r,e){return r===0?e:r%2===1?pow(t,r-1,e*t):pow(t*t,r/2,e)},log:function log(t){var r=0;var e=t;while(e>=4096){r+=12;e/=4096}while(e>=2){r+=1;e/=2}return r}};var gr=function toFixed(t){var r,e,n,i,a,f,l,s;r=u(t);r=Y(r)?0:Math.floor(r);if(r<0||r>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(Y(e)){return"NaN"}if(e<=-1e21||e>=1e21){return o(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){a=dr.log(e*dr.pow(2,69,1))-69;f=a<0?e*dr.pow(2,-a,1):e/dr.pow(2,a,1);f*=4503599627370496;a=52-a;if(a>0){dr.multiply(0,f);l=r;while(l>=7){dr.multiply(1e7,0);l-=7}dr.multiply(dr.pow(10,l,1),0);l=a-1;while(l>=23){dr.divide(1<<23);l-=23}dr.divide(1<<l);dr.multiply(1,1);dr.divide(2);i=dr.numToString()}else{dr.multiply(0,f);dr.multiply(1<<-a,0);i=dr.numToString()+L("0.00000000000000000000",2,2+r)}}if(r>0){s=i.length;if(s<=r){i=n+L("0.0000000000000000000",0,r-s+2)+i}else{i=n+L(i,0,s-r)+"."+L(i,s-r)}}else{i=n+i}return i};$(l,{toFixed:gr},yr);var wr=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return true}}();var br=l.toPrecision;$(l,{toPrecision:function toPrecision(t){return typeof t==="undefined"?br.call(this):br.call(this,t)}},wr);if("ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1){(function(){var t=typeof/()??/.exec("")[1]==="undefined";var r=Math.pow(2,32)-1;f.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!M(e)){return X(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,u,l,s,c;var h=new RegExp(e.source,o+"g");if(!t){u=new RegExp("^"+h.source+"$(?!\\s)",o)}var p=typeof n==="undefined"?r:Z.ToUint32(n);l=h.exec(i);while(l){s=l.index+l[0].length;if(s>f){K(a,L(i,f,l.index));if(!t&&l.length>1){l[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){l[t]=void 0}}})}if(l.length>1&&l.index<i.length){v.apply(a,H(l,1))}c=l[0].length;f=s;if(a.length>=p){break}}if(h.lastIndex===l.index){h.lastIndex++}l=h.exec(i)}if(f===i.length){if(c||!h.test("")){K(a,"")}}else{K(a,L(i,f))}return a.length>p?H(a,0,p):a}})()}else if("0".split(void 0,0).length){f.split=function split(t,r){if(typeof t==="undefined"&&r===0){return[]}return X(this,t,r)}}var Tr=f.replace;var mr=function(){var t=[];"x".replace(/x(.)?/g,function(r,e){K(t,e)});return t.length===1&&typeof t[0]==="undefined"}();if(!mr){f.replace=function replace(t,r){var e=D(r);var n=M(t)&&/\)[*?]/.test(t.source);if(!e||!n){return Tr.call(this,t,r)}else{var i=function(e){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var a=t.exec(e)||[];t.lastIndex=i;K(a,arguments[n-2],arguments[n-1]);return r.apply(this,a)};return Tr.call(this,t,i)}}}var Dr=f.substr;var xr="".substr&&"0b".substr(-1)!=="b";$(f,{substr:function substr(t,r){var e=t;if(t<0){e=w(this.length+t,0)}return Dr.call(this,e,r)}},xr);var Sr=" \n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var Or="\u200b";var Er="["+Sr+"]";var jr=new RegExp("^"+Er+Er+"*");var Ir=new RegExp(Er+Er+"*$");var Mr=f.trim&&(Sr.trim()||!Or.trim());$(f,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return o(this).replace(jr,"").replace(Ir,"")}},Mr);var Ur=d.bind(String.prototype.trim);var Fr=f.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;$(f,{lastIndexOf:function lastIndexOf(t){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=o(this);var e=o(t);var n=arguments.length>1?u(arguments[1]):NaN;var i=Y(n)?Infinity:Z.ToInteger(n);var a=b(w(i,0),r.length);var f=e.length;var l=a+f;while(l>0){l=w(0,l-f);var s=q(L(r,l,a+f),e);if(s!==-1){return l+s}}return-1}},Fr);var Nr=f.lastIndexOf;$(f,{lastIndexOf:function lastIndexOf(t){return Nr.apply(this,arguments)}},f.lastIndexOf.length!==1);if(parseInt(Sr+"08")!==8||parseInt(Sr+"0x16")!==22){parseInt=function(t){var r=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=Ur(e);var a=u(n)||(r.test(i)?16:10);return t(i,a)}}(parseInt)}if(1/parseFloat("-0")!==-Infinity){parseFloat=function(t){return function parseFloat(r){var e=Ur(r);var n=t(e);return n===0&&L(e,0,1)==="-"?-0:n}}(parseFloat)}if(String(new RangeError("test"))!=="RangeError: test"){var Cr=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=this.name;if(typeof t==="undefined"){t="Error"}else if(typeof t!=="string"){t=o(t)}var r=this.message;if(typeof r==="undefined"){r=""}else if(typeof r!=="string"){r=o(r)}if(!t){return r}if(!r){return t}return t+": "+r};Error.prototype.toString=Cr}if(P){var kr=function(t,r){if(Q(t,r)){var e=Object.getOwnPropertyDescriptor(t,r);e.enumerable=false;Object.defineProperty(t,r,e)}};kr(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}kr(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Rr=function toString(){var t="/"+this.source+"/";if(this.global){t+="g"}if(this.ignoreCase){t+="i"}if(this.multiline){t+="m"}return t};RegExp.prototype.toString=Rr}});
//# sourceMappingURL=es5-shim.map
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Array;var r=t.prototype;var e=Object;var n=e.prototype;var i=Function;var a=i.prototype;var o=String;var f=o.prototype;var u=Number;var l=u.prototype;var s=r.slice;var c=r.splice;var v=r.push;var h=r.unshift;var p=r.concat;var y=r.join;var d=a.call;var g=a.apply;var w=Math.max;var b=Math.min;var T=n.toString;var m=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var D;var x=Function.prototype.toString,S=/^\s*class /,O=function isES6ClassFn(t){try{var r=x.call(t);var e=r.replace(/\/\/.*\n/g,"");var n=e.replace(/\/\*[.\s\S]*\*\//g,"");var i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return S.test(i)}catch(a){return false}},E=function tryFunctionObject(t){try{if(O(t)){return false}x.call(t);return true}catch(r){return false}},j="[object Function]",I="[object GeneratorFunction]",D=function isCallable(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(m){return E(t)}if(O(t)){return false}var r=T.call(t);return r===j||r===I};var M;var U=RegExp.prototype.exec,F=function tryRegexExec(t){try{U.call(t);return true}catch(r){return false}},N="[object RegExp]";M=function isRegex(t){if(typeof t!=="object"){return false}return m?F(t):T.call(t)===N};var C;var k=String.prototype.valueOf,R=function tryStringObject(t){try{k.call(t);return true}catch(r){return false}},A="[object String]";C=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return m?R(t):T.call(t)===A};var P=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:false,value:t});for(var r in t){return false}return t.x===t}catch(n){return false}}();var $=function(t){var r;if(P){r=function(t,r,n,i){if(!i&&r in t){return}e.defineProperty(t,r,{configurable:true,enumerable:false,writable:true,value:n})}}else{r=function(t,r,e,n){if(!n&&r in t){return}t[r]=e}}return function defineProperties(e,n,i){for(var a in n){if(t.call(n,a)){r(e,a,n[a],i)}}}}(n.hasOwnProperty);var J=function isPrimitive(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"};var Y=u.isNaN||function(t){return t!==t};var Z={ToInteger:function ToInteger(t){var r=+t;if(Y(r)){r=0}else if(r!==0&&r!==1/0&&r!==-(1/0)){r=(r>0||-1)*Math.floor(Math.abs(r))}return r},ToPrimitive:function ToPrimitive(t){var r,e,n;if(J(t)){return t}e=t.valueOf;if(D(e)){r=e.call(t);if(J(r)){return r}}n=t.toString;if(D(n)){r=n.call(t);if(J(r)){return r}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return e(t)},ToUint32:function ToUint32(t){return t>>>0}};var z=function Empty(){};$(a,{bind:function bind(t){var r=this;if(!D(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var n=s.call(arguments,1);var a;var o=function(){if(this instanceof a){var i=g.call(r,this,p.call(n,s.call(arguments)));if(e(i)===i){return i}return this}else{return g.call(r,t,p.call(n,s.call(arguments)))}};var f=w(0,r.length-n.length);var u=[];for(var l=0;l<f;l++){v.call(u,"$"+l)}a=i("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(o);if(r.prototype){z.prototype=r.prototype;a.prototype=new z;z.prototype=null}return a}});var G=d.bind(n.hasOwnProperty);var B=d.bind(n.toString);var H=d.bind(s);var W=g.bind(s);var L=d.bind(f.slice);var X=d.bind(f.split);var q=d.bind(f.indexOf);var K=d.bind(v);var Q=d.bind(n.propertyIsEnumerable);var V=d.bind(r.sort);var _=t.isArray||function isArray(t){return B(t)==="[object Array]"};var tt=[].unshift(0)!==1;$(r,{unshift:function(){h.apply(this,arguments);return this.length}},tt);$(t,{isArray:_});var rt=e("a");var et=rt[0]!=="a"||!(0 in rt);var nt=function properlyBoxed(t){var r=true;var e=true;var n=false;if(t){try{t.call("foo",function(t,e,n){if(typeof n!=="object"){r=false}});t.call([1],function(){"use strict";e=typeof this==="string"},"x")}catch(i){n=true}}return!!t&&!n&&r&&e};$(r,{forEach:function forEach(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=-1;var i=Z.ToUint32(e.length);var a;if(arguments.length>1){a=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in e){if(typeof a==="undefined"){t(e[n],n,r)}else{t.call(a,e[n],n,r)}}}}},!nt(r.forEach));$(r,{map:function map(r){var e=Z.ToObject(this);var n=et&&C(this)?X(this,""):e;var i=Z.ToUint32(n.length);var a=t(i);var o;if(arguments.length>1){o=arguments[1]}if(!D(r)){throw new TypeError("Array.prototype.map callback must be a function")}for(var f=0;f<i;f++){if(f in n){if(typeof o==="undefined"){a[f]=r(n[f],f,e)}else{a[f]=r.call(o,n[f],f,e)}}}return a}},!nt(r.map));$(r,{filter:function filter(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var f=0;f<n;f++){if(f in e){a=e[f];if(typeof o==="undefined"?t(a,f,r):t.call(o,a,f,r)){K(i,a)}}}return i}},!nt(r.filter));$(r,{every:function every(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in e&&!(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return false}}return true}},!nt(r.every));$(r,{some:function some(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in e&&(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return true}}return false}},!nt(r.some));var it=false;if(r.reduce){it=typeof r.reduce.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduce:function reduce(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduce callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var a;if(arguments.length>=2){a=arguments[1]}else{do{if(i in e){a=e[i++];break}if(++i>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i<n;i++){if(i in e){a=t(a,e[i],i,r)}}return a}},!it);var at=false;if(r.reduceRight){at=typeof r.reduceRight.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduceRight:function reduceRight(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduceRight callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i;var a=n-1;if(arguments.length>=2){i=arguments[1]}else{do{if(a in e){i=e[a--];break}if(--a<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(a<0){return i}do{if(a in e){i=t(i,e[a],a,r)}}while(a--);return i}},!at);var ot=r.indexOf&&[0,1].indexOf(1,2)!==-1;$(r,{indexOf:function indexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=Z.ToInteger(arguments[1])}n=n>=0?n:w(0,e+n);for(;n<e;n++){if(n in r&&r[n]===t){return n}}return-1}},ot);var ft=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;$(r,{lastIndexOf:function lastIndexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=e-1;if(arguments.length>1){n=b(n,Z.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in r&&t===r[n]){return n}}return-1}},ft);var ut=function(){var t=[1,2];var r=t.splice();return t.length===2&&_(r)&&r.length===0}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}else{return c.apply(this,arguments)}}},!ut);var lt=function(){var t={};r.splice.call(t,0,0,1);return t.length===1}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}var e=arguments;this.length=w(Z.ToInteger(this.length),0);if(arguments.length>0&&typeof r!=="number"){e=H(arguments);if(e.length<2){K(e,this.length-t)}else{e[1]=Z.ToInteger(r)}}return c.apply(this,e)}},!lt);var st=function(){var r=new t(1e5);r[8]="x";r.splice(1,1);return r.indexOf("x")===7}();var ct=function(){var t=256;var r=[];r[t]="a";r.splice(t+1,0,"b");return r[t]==="a"}();$(r,{splice:function splice(t,r){var e=Z.ToObject(this);var n=[];var i=Z.ToUint32(e.length);var a=Z.ToInteger(t);var f=a<0?w(i+a,0):b(a,i);var u=b(w(Z.ToInteger(r),0),i-f);var l=0;var s;while(l<u){s=o(f+l);if(G(e,s)){n[l]=e[s]}l+=1}var c=H(arguments,2);var v=c.length;var h;if(v<u){l=f;var p=i-u;while(l<p){s=o(l+u);h=o(l+v);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l+=1}l=i;var y=i-u+v;while(l>y){delete e[l-1];l-=1}}else if(v>u){l=i-u;while(l>f){s=o(l+u-1);h=o(l+v-1);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l-=1}}l=f;for(var d=0;d<c.length;++d){e[l]=c[d];l+=1}e.length=i-u+v;return n}},!st||!ct);var vt=r.join;var ht;try{ht=Array.prototype.join.call("123",",")!=="1,2,3"}catch(pt){ht=true}if(ht){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(C(this)?X(this,""):this,r)}},ht)}var yt=[1,2].join(undefined)!=="1,2";if(yt){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(this,r)}},yt)}var dt=function push(t){var r=Z.ToObject(this);var e=Z.ToUint32(r.length);var n=0;while(n<arguments.length){r[e+n]=arguments[n];n+=1}r.length=e+n;return e+n};var gt=function(){var t={};var r=Array.prototype.push.call(t,undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:function push(t){if(_(this)){return v.apply(this,arguments)}return dt.apply(this,arguments)}},gt);var wt=function(){var t=[];var r=t.push(undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:dt},wt);$(r,{slice:function(t,r){var e=C(this)?X(this,""):this;return W(e,arguments)}},et);var bt=function(){try{[1,2].sort(null);[1,2].sort({});return true}catch(t){}return false}();var Tt=function(){try{[1,2].sort(/a/);return false}catch(t){}return true}();var mt=function(){try{[1,2].sort(undefined);return true}catch(t){}return false}();$(r,{sort:function sort(t){if(typeof t==="undefined"){return V(this)}if(!D(t)){throw new TypeError("Array.prototype.sort callback must be a function")}return V(this,t)}},bt||!mt||!Tt);var Dt=!{toString:null}.propertyIsEnumerable("toString");var xt=function(){}.propertyIsEnumerable("prototype");var St=!G("x","0");var Ot=function(t){var r=t.constructor;return r&&r.prototype===t};var Et={$window:true,$console:true,$parent:true,$self:true,$frame:true,$frames:true,$frameElement:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$external:true};var jt=function(){if(typeof window==="undefined"){return false}for(var t in window){try{if(!Et["$"+t]&&G(window,t)&&window[t]!==null&&typeof window[t]==="object"){Ot(window[t])}}catch(r){return true}}return false}();var It=function(t){if(typeof window==="undefined"||!jt){return Ot(t)}try{return Ot(t)}catch(r){return false}};var Mt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var Ut=Mt.length;var Ft=function isArguments(t){return B(t)==="[object Arguments]"};var Nt=function isArguments(t){return t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&!_(t)&&D(t.callee)};var Ct=Ft(arguments)?Ft:Nt;$(e,{keys:function keys(t){var r=D(t);var e=Ct(t);var n=t!==null&&typeof t==="object";var i=n&&C(t);if(!n&&!r&&!e){throw new TypeError("Object.keys called on a non-object")}var a=[];var f=xt&&r;if(i&&St||e){for(var u=0;u<t.length;++u){K(a,o(u))}}if(!e){for(var l in t){if(!(f&&l==="prototype")&&G(t,l)){K(a,o(l))}}}if(Dt){var s=It(t);for(var c=0;c<Ut;c++){var v=Mt[c];if(!(s&&v==="constructor")&&G(t,v)){K(a,v)}}}return a}});var kt=e.keys&&function(){return e.keys(arguments).length===2}(1,2);var Rt=e.keys&&function(){var t=e.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1);var At=e.keys;$(e,{keys:function keys(t){if(Ct(t)){return At(H(t))}else{return At(t)}}},!kt||Rt);var Pt=new Date(-0xc782b5b342b24).getUTCMonth()!==0;var $t=new Date(-0x55d318d56a724);var Jt=new Date(14496624e5);var Yt=$t.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT";var Zt;var zt;var Gt=$t.getTimezoneOffset();if(Gt<-720){Zt=$t.toDateString()!=="Tue Jan 02 -45875";zt=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}else{Zt=$t.toDateString()!=="Mon Jan 01 -45875";zt=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}var Bt=d.bind(Date.prototype.getFullYear);var Ht=d.bind(Date.prototype.getMonth);var Wt=d.bind(Date.prototype.getDate);var Lt=d.bind(Date.prototype.getUTCFullYear);var Xt=d.bind(Date.prototype.getUTCMonth);var qt=d.bind(Date.prototype.getUTCDate);var Kt=d.bind(Date.prototype.getUTCDay);var Qt=d.bind(Date.prototype.getUTCHours);var Vt=d.bind(Date.prototype.getUTCMinutes);var _t=d.bind(Date.prototype.getUTCSeconds);var tr=d.bind(Date.prototype.getUTCMilliseconds);var rr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var er=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var nr=function daysInMonth(t,r){return Wt(new Date(r,t,0))};$(Date.prototype,{getFullYear:function getFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);if(t<0&&Ht(this)>11){return t+1}return t},getMonth:function getMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);if(t<0&&r>11){return 0}return r},getDate:function getDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);var e=Wt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e},getUTCFullYear:function getUTCFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);if(t<0&&Xt(this)>11){return t+1}return t},getUTCMonth:function getUTCMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);if(t<0&&r>11){return 0}return r},getUTCDate:function getUTCDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);var e=qt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e}},Pt);$(Date.prototype,{toUTCString:function toUTCString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Kt(this);var r=qt(this);var e=Xt(this);var n=Lt(this);var i=Qt(this);var a=Vt(this);var o=_t(this);return rr[t]+", "+(r<10?"0"+r:r)+" "+er[e]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},Pt||Yt);$(Date.prototype,{toDateString:function toDateString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n}},Pt||Zt);if(Pt||zt){Date.prototype.toString=function toString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();var i=this.getHours();var a=this.getMinutes();var o=this.getSeconds();var f=this.getTimezoneOffset();var u=Math.floor(Math.abs(f)/60);var l=Math.floor(Math.abs(f)%60);return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(f>0?"-":"+")+(u<10?"0"+u:u)+(l<10?"0"+l:l)};if(P){e.defineProperty(Date.prototype,"toString",{configurable:true,enumerable:false,writable:true})}}var ir=-621987552e5;var ar="-000001";var or=Date.prototype.toISOString&&new Date(ir).toISOString().indexOf(ar)===-1;var fr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";var ur=d.bind(Date.prototype.getTime);$(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)||!isFinite(ur(this))){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}var t=Lt(this);var r=Xt(this);t+=Math.floor(r/12);r=(r%12+12)%12;var e=[r+1,qt(this),Qt(this),Vt(this),_t(this)];t=(t<0?"-":t>9999?"+":"")+L("00000"+Math.abs(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<e.length;++n){e[n]=L("00"+e[n],-2)}return t+"-"+H(e,0,2).join("-")+"T"+H(e,2).join(":")+"."+L("000"+tr(this),-3)+"Z"}},or||fr);var lr=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(ir).toJSON().indexOf(ar)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!lr){Date.prototype.toJSON=function toJSON(t){var r=e(this);var n=Z.ToPrimitive(r);if(typeof n==="number"&&!isFinite(n)){return null}var i=r.toISOString;if(!D(i)){throw new TypeError("toISOString property is not callable")}return i.call(r)}}var sr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var cr=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));var vr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(vr||cr||!sr){var hr=Math.pow(2,31)-1;var pr=Y(new Date(1970,0,1,0,0,0,hr+1).getTime());Date=function(t){var r=function Date(e,n,i,a,f,u,l){var s=arguments.length;var c;if(this instanceof t){var v=u;var h=l;if(pr&&s>=7&&l>hr){var p=Math.floor(l/hr)*hr;var y=Math.floor(p/1e3);v+=y;h-=y*1e3}c=s===1&&o(e)===e?new t(r.parse(e)):s>=7?new t(e,n,i,a,f,v,h):s>=6?new t(e,n,i,a,f,v):s>=5?new t(e,n,i,a,f):s>=4?new t(e,n,i,a):s>=3?new t(e,n,i):s>=2?new t(e,n):s>=1?new t(e instanceof t?+e:e):new t}else{c=t.apply(this,arguments)}if(!J(c)){$(c,{constructor:r},true)}return c};var e=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var n=[0,31,59,90,120,151,181,212,243,273,304,334,365];var i=function dayFromMonth(t,r){var e=r>1?1:0;return n[r]+Math.floor((t-1969+e)/4)-Math.floor((t-1901+e)/100)+Math.floor((t-1601+e)/400)+365*(t-1970)};var a=function toUTC(r){var e=0;var n=r;if(pr&&n>hr){var i=Math.floor(n/hr)*hr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new t(1970,0,1,0,0,e,n))};for(var f in t){if(G(t,f)){r[f]=t[f]}}$(r,{now:t.now,UTC:t.UTC},true);r.prototype=t.prototype;$(r.prototype,{constructor:r},true);var l=function parse(r){var n=e.exec(r);if(n){var o=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),h=Math.floor(u(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,d=u(n[10]||0),g=u(n[11]||0),w;var b=c>0||v>0||h>0;if(s<(b?24:25)&&c<60&&v<60&&h<1e3&&f>-1&&f<12&&d<24&&g<60&&l>-1&&l<i(o,f+1)-i(o,f)){w=((i(o,f)+l)*24+s+d*y)*60;w=((w+c+g*y)*60+v)*1e3+h;if(p){w=a(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return t.parse.apply(this,arguments)};$(r,{parse:l});return r}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var yr=l.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var dr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(t,r){var e=-1;var n=r;while(++e<dr.size){n+=t*dr.data[e];dr.data[e]=n%dr.base;n=Math.floor(n/dr.base)}},divide:function divide(t){var r=dr.size;var e=0;while(--r>=0){e+=dr.data[r];dr.data[r]=Math.floor(e/t);e=e%t*dr.base}},numToString:function numToString(){var t=dr.size;var r="";while(--t>=0){if(r!==""||t===0||dr.data[t]!==0){var e=o(dr.data[t]);if(r===""){r=e}else{r+=L("0000000",0,7-e.length)+e}}}return r},pow:function pow(t,r,e){return r===0?e:r%2===1?pow(t,r-1,e*t):pow(t*t,r/2,e)},log:function log(t){var r=0;var e=t;while(e>=4096){r+=12;e/=4096}while(e>=2){r+=1;e/=2}return r}};var gr=function toFixed(t){var r,e,n,i,a,f,l,s;r=u(t);r=Y(r)?0:Math.floor(r);if(r<0||r>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(Y(e)){return"NaN"}if(e<=-1e21||e>=1e21){return o(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){a=dr.log(e*dr.pow(2,69,1))-69;f=a<0?e*dr.pow(2,-a,1):e/dr.pow(2,a,1);f*=4503599627370496;a=52-a;if(a>0){dr.multiply(0,f);l=r;while(l>=7){dr.multiply(1e7,0);l-=7}dr.multiply(dr.pow(10,l,1),0);l=a-1;while(l>=23){dr.divide(1<<23);l-=23}dr.divide(1<<l);dr.multiply(1,1);dr.divide(2);i=dr.numToString()}else{dr.multiply(0,f);dr.multiply(1<<-a,0);i=dr.numToString()+L("0.00000000000000000000",2,2+r)}}if(r>0){s=i.length;if(s<=r){i=n+L("0.0000000000000000000",0,r-s+2)+i}else{i=n+L(i,0,s-r)+"."+L(i,s-r)}}else{i=n+i}return i};$(l,{toFixed:gr},yr);var wr=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return true}}();var br=l.toPrecision;$(l,{toPrecision:function toPrecision(t){return typeof t==="undefined"?br.call(this):br.call(this,t)}},wr);if("ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1){(function(){var t=typeof/()??/.exec("")[1]==="undefined";var r=Math.pow(2,32)-1;f.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!M(e)){return X(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,u,l,s,c;var h=new RegExp(e.source,o+"g");if(!t){u=new RegExp("^"+h.source+"$(?!\\s)",o)}var p=typeof n==="undefined"?r:Z.ToUint32(n);l=h.exec(i);while(l){s=l.index+l[0].length;if(s>f){K(a,L(i,f,l.index));if(!t&&l.length>1){l[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){l[t]=void 0}}})}if(l.length>1&&l.index<i.length){v.apply(a,H(l,1))}c=l[0].length;f=s;if(a.length>=p){break}}if(h.lastIndex===l.index){h.lastIndex++}l=h.exec(i)}if(f===i.length){if(c||!h.test("")){K(a,"")}}else{K(a,L(i,f))}return a.length>p?H(a,0,p):a}})()}else if("0".split(void 0,0).length){f.split=function split(t,r){if(typeof t==="undefined"&&r===0){return[]}return X(this,t,r)}}var Tr=f.replace;var mr=function(){var t=[];"x".replace(/x(.)?/g,function(r,e){K(t,e)});return t.length===1&&typeof t[0]==="undefined"}();if(!mr){f.replace=function replace(t,r){var e=D(r);var n=M(t)&&/\)[*?]/.test(t.source);if(!e||!n){return Tr.call(this,t,r)}else{var i=function(e){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var a=t.exec(e)||[];t.lastIndex=i;K(a,arguments[n-2],arguments[n-1]);return r.apply(this,a)};return Tr.call(this,t,i)}}}var Dr=f.substr;var xr="".substr&&"0b".substr(-1)!=="b";$(f,{substr:function substr(t,r){var e=t;if(t<0){e=w(this.length+t,0)}return Dr.call(this,e,r)}},xr);var Sr=" \n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var Or="\u200b";var Er="["+Sr+"]";var jr=new RegExp("^"+Er+Er+"*");var Ir=new RegExp(Er+Er+"*$");var Mr=f.trim&&(Sr.trim()||!Or.trim());$(f,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return o(this).replace(jr,"").replace(Ir,"")}},Mr);var Ur=d.bind(String.prototype.trim);var Fr=f.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;$(f,{lastIndexOf:function lastIndexOf(t){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=o(this);var e=o(t);var n=arguments.length>1?u(arguments[1]):NaN;var i=Y(n)?Infinity:Z.ToInteger(n);var a=b(w(i,0),r.length);var f=e.length;var l=a+f;while(l>0){l=w(0,l-f);var s=q(L(r,l,a+f),e);if(s!==-1){return l+s}}return-1}},Fr);var Nr=f.lastIndexOf;$(f,{lastIndexOf:function lastIndexOf(t){return Nr.apply(this,arguments)}},f.lastIndexOf.length!==1);if(parseInt(Sr+"08")!==8||parseInt(Sr+"0x16")!==22){parseInt=function(t){var r=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=Ur(e);var a=u(n)||(r.test(i)?16:10);return t(i,a)}}(parseInt)}if(1/parseFloat("-0")!==-Infinity){parseFloat=function(t){return function parseFloat(r){var e=Ur(r);var n=t(e);return n===0&&L(e,0,1)==="-"?-0:n}}(parseFloat)}if(String(new RangeError("test"))!=="RangeError: test"){var Cr=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=this.name;if(typeof t==="undefined"){t="Error"}else if(typeof t!=="string"){t=o(t)}var r=this.message;if(typeof r==="undefined"){r=""}else if(typeof r!=="string"){r=o(r)}if(!t){return r}if(!r){return t}return t+": "+r};Error.prototype.toString=Cr}if(P){var kr=function(t,r){if(Q(t,r)){var e=Object.getOwnPropertyDescriptor(t,r);e.enumerable=false;Object.defineProperty(t,r,e)}};kr(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}kr(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Rr=function toString(){var t="/"+this.source+"/";if(this.global){t+="g"}if(this.ignoreCase){t+="i"}if(this.multiline){t+="m"}return t};RegExp.prototype.toString=Rr}});
//# sourceMappingURL=es5-shim.map
... ...
{
"name": "es5-shim",
"version": "4.5.7",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"homepage": "http://github.com/es-shims/es5-shim/",
"contributors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"bugs": {
"mail": "ljharb@gmail.com",
"url": "http://github.com/es-shims/es5-shim/issues"
},
"license": "MIT",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "http://github.com/es-shims/es5-shim.git"
},
"scripts": {
"minify": "concurrently --raw 'npm run --silent minify-shim' 'npm run --silent minify-sham'",
"minify-shim": "uglifyjs es5-shim.js --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false > es5-shim.min.js",
"minify-sham": "uglifyjs es5-sham.js --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"tests-only": "jasmine-node --matchall ./ tests/spec/",
"test-native": "jasmine-node --matchall tests/spec/",
"lint": "concurrently --raw 'npm run --silent jscs' 'npm run --silent eslint'",
"eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js",
"jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js"
},
"devDependencies": {
"eslint": "^2.5.3",
"@ljharb/eslint-config": "^2.2.0",
"jasmine-node": "^1.14.5",
"jscs": "^2.11.0",
"uglify-js": "^2.6.2",
"replace": "^0.3.0",
"semver": "^5.1.0",
"concurrently": "^2.0.0"
},
"engines": {
"node": ">=0.4.0"
},
"testling": {
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/18.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/25.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
]
}
{
"name": "es5-shim",
"version": "4.5.7",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"homepage": "http://github.com/es-shims/es5-shim/",
"contributors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"bugs": {
"mail": "ljharb@gmail.com",
"url": "http://github.com/es-shims/es5-shim/issues"
},
"license": "MIT",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "http://github.com/es-shims/es5-shim.git"
},
"scripts": {
"minify": "concurrently --raw 'npm run --silent minify-shim' 'npm run --silent minify-sham'",
"minify-shim": "uglifyjs es5-shim.js --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false > es5-shim.min.js",
"minify-sham": "uglifyjs es5-sham.js --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"tests-only": "jasmine-node --matchall ./ tests/spec/",
"test-native": "jasmine-node --matchall tests/spec/",
"lint": "concurrently --raw 'npm run --silent jscs' 'npm run --silent eslint'",
"eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js",
"jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js"
},
"devDependencies": {
"eslint": "^2.5.3",
"@ljharb/eslint-config": "^2.2.0",
"jasmine-node": "^1.14.5",
"jscs": "^2.11.0",
"uglify-js": "^2.6.2",
"replace": "^0.3.0",
"semver": "^5.1.0",
"concurrently": "^2.0.0"
},
"engines": {
"node": ">=0.4.0"
},
"testling": {
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/18.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/25.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
]
}
... ...
{
"Object": {
"prototype": {},
"keys": "object-keys"
}
}
{
"Object": {
"prototype": {},
"keys": "object-keys"
}
}
... ...
{
"rules": {
"max-statements-per-line": [2, { "max": 2 }]
}
}
{
"rules": {
"max-statements-per-line": [2, { "max": 2 }]
}
}
... ...
/* global beforeEach, expect */
var has = Object.prototype.hasOwnProperty;
var getKeys = function (o) {
'use strict';
var key;
var a = [];
for (key in o) {
if (has.call(o, key)) {
a.push(key);
}
}
return a;
};
beforeEach(function () {
'use strict';
this.addMatchers({
toExactlyMatch: function (expected) {
var a1, a2, l, i, key;
var actual = this.actual;
a1 = getKeys(actual);
a2 = getKeys(expected);
l = a1.length;
if (l !== a2.length) {
return false;
}
for (i = 0; i < l; i++) {
key = a1[i];
expect(key).toEqual(a2[i]);
expect(actual[key]).toEqual(expected[key]);
}
return true;
}
});
});
/* global beforeEach, expect */
var has = Object.prototype.hasOwnProperty;
var getKeys = function (o) {
'use strict';
var key;
var a = [];
for (key in o) {
if (has.call(o, key)) {
a.push(key);
}
}
return a;
};
beforeEach(function () {
'use strict';
this.addMatchers({
toExactlyMatch: function (expected) {
var a1, a2, l, i, key;
var actual = this.actual;
a1 = getKeys(actual);
a2 = getKeys(expected);
l = a1.length;
if (l !== a2.length) {
return false;
}
for (i = 0; i < l; i++) {
key = a1[i];
expect(key).toEqual(a2[i]);
expect(actual[key]).toEqual(expected[key]);
}
return true;
}
});
});
... ...
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.js"></script>
<script src="../es5-sham.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script src="spec/s-regexp.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.js"></script>
<script src="../es5-sham.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script src="spec/s-regexp.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
... ...
<!DOCTYPE HTML>
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.min.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.min.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
... ...