正在显示
29 个修改的文件
包含
2350 行增加
和
2350 行删除
1 | -/*! | ||
2 | - * EventEmitter v4.2.11 - git.io/ee | ||
3 | - * Unlicense - http://unlicense.org/ | ||
4 | - * Oliver Caldwell - http://oli.me.uk/ | ||
5 | - * @preserve | ||
6 | - */ | ||
7 | - | ||
8 | -;(function () { | ||
9 | - 'use strict'; | ||
10 | - | ||
11 | - /** | ||
12 | - * Class for managing events. | ||
13 | - * Can be extended to provide event functionality in other classes. | ||
14 | - * | ||
15 | - * @class EventEmitter Manages event registering and emitting. | ||
16 | - */ | ||
17 | - function EventEmitter() {} | ||
18 | - | ||
19 | - // Shortcuts to improve speed and size | ||
20 | - var proto = EventEmitter.prototype; | ||
21 | - var exports = this; | ||
22 | - var originalGlobalValue = exports.EventEmitter; | ||
23 | - | ||
24 | - /** | ||
25 | - * Finds the index of the listener for the event in its storage array. | ||
26 | - * | ||
27 | - * @param {Function[]} listeners Array of listeners to search through. | ||
28 | - * @param {Function} listener Method to look for. | ||
29 | - * @return {Number} Index of the specified listener, -1 if not found | ||
30 | - * @api private | ||
31 | - */ | ||
32 | - function indexOfListener(listeners, listener) { | ||
33 | - var i = listeners.length; | ||
34 | - while (i--) { | ||
35 | - if (listeners[i].listener === listener) { | ||
36 | - return i; | ||
37 | - } | ||
38 | - } | ||
39 | - | ||
40 | - return -1; | ||
41 | - } | ||
42 | - | ||
43 | - /** | ||
44 | - * Alias a method while keeping the context correct, to allow for overwriting of target method. | ||
45 | - * | ||
46 | - * @param {String} name The name of the target method. | ||
47 | - * @return {Function} The aliased method | ||
48 | - * @api private | ||
49 | - */ | ||
50 | - function alias(name) { | ||
51 | - return function aliasClosure() { | ||
52 | - return this[name].apply(this, arguments); | ||
53 | - }; | ||
54 | - } | ||
55 | - | ||
56 | - /** | ||
57 | - * Returns the listener array for the specified event. | ||
58 | - * Will initialise the event object and listener arrays if required. | ||
59 | - * 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. | ||
60 | - * Each property in the object response is an array of listener functions. | ||
61 | - * | ||
62 | - * @param {String|RegExp} evt Name of the event to return the listeners from. | ||
63 | - * @return {Function[]|Object} All listener functions for the event. | ||
64 | - */ | ||
65 | - proto.getListeners = function getListeners(evt) { | ||
66 | - var events = this._getEvents(); | ||
67 | - var response; | ||
68 | - var key; | ||
69 | - | ||
70 | - // Return a concatenated array of all matching events if | ||
71 | - // the selector is a regular expression. | ||
72 | - if (evt instanceof RegExp) { | ||
73 | - response = {}; | ||
74 | - for (key in events) { | ||
75 | - if (events.hasOwnProperty(key) && evt.test(key)) { | ||
76 | - response[key] = events[key]; | ||
77 | - } | ||
78 | - } | ||
79 | - } | ||
80 | - else { | ||
81 | - response = events[evt] || (events[evt] = []); | ||
82 | - } | ||
83 | - | ||
84 | - return response; | ||
85 | - }; | ||
86 | - | ||
87 | - /** | ||
88 | - * Takes a list of listener objects and flattens it into a list of listener functions. | ||
89 | - * | ||
90 | - * @param {Object[]} listeners Raw listener objects. | ||
91 | - * @return {Function[]} Just the listener functions. | ||
92 | - */ | ||
93 | - proto.flattenListeners = function flattenListeners(listeners) { | ||
94 | - var flatListeners = []; | ||
95 | - var i; | ||
96 | - | ||
97 | - for (i = 0; i < listeners.length; i += 1) { | ||
98 | - flatListeners.push(listeners[i].listener); | ||
99 | - } | ||
100 | - | ||
101 | - return flatListeners; | ||
102 | - }; | ||
103 | - | ||
104 | - /** | ||
105 | - * 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. | ||
106 | - * | ||
107 | - * @param {String|RegExp} evt Name of the event to return the listeners from. | ||
108 | - * @return {Object} All listener functions for an event in an object. | ||
109 | - */ | ||
110 | - proto.getListenersAsObject = function getListenersAsObject(evt) { | ||
111 | - var listeners = this.getListeners(evt); | ||
112 | - var response; | ||
113 | - | ||
114 | - if (listeners instanceof Array) { | ||
115 | - response = {}; | ||
116 | - response[evt] = listeners; | ||
117 | - } | ||
118 | - | ||
119 | - return response || listeners; | ||
120 | - }; | ||
121 | - | ||
122 | - /** | ||
123 | - * Adds a listener function to the specified event. | ||
124 | - * The listener will not be added if it is a duplicate. | ||
125 | - * If the listener returns true then it will be removed after it is called. | ||
126 | - * If you pass a regular expression as the event name then the listener will be added to all events that match it. | ||
127 | - * | ||
128 | - * @param {String|RegExp} evt Name of the event to attach the listener to. | ||
129 | - * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. | ||
130 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
131 | - */ | ||
132 | - proto.addListener = function addListener(evt, listener) { | ||
133 | - var listeners = this.getListenersAsObject(evt); | ||
134 | - var listenerIsWrapped = typeof listener === 'object'; | ||
135 | - var key; | ||
136 | - | ||
137 | - for (key in listeners) { | ||
138 | - if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { | ||
139 | - listeners[key].push(listenerIsWrapped ? listener : { | ||
140 | - listener: listener, | ||
141 | - once: false | ||
142 | - }); | ||
143 | - } | ||
144 | - } | ||
145 | - | ||
146 | - return this; | ||
147 | - }; | ||
148 | - | ||
149 | - /** | ||
150 | - * Alias of addListener | ||
151 | - */ | ||
152 | - proto.on = alias('addListener'); | ||
153 | - | ||
154 | - /** | ||
155 | - * Semi-alias of addListener. It will add a listener that will be | ||
156 | - * automatically removed after its first execution. | ||
157 | - * | ||
158 | - * @param {String|RegExp} evt Name of the event to attach the listener to. | ||
159 | - * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. | ||
160 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
161 | - */ | ||
162 | - proto.addOnceListener = function addOnceListener(evt, listener) { | ||
163 | - return this.addListener(evt, { | ||
164 | - listener: listener, | ||
165 | - once: true | ||
166 | - }); | ||
167 | - }; | ||
168 | - | ||
169 | - /** | ||
170 | - * Alias of addOnceListener. | ||
171 | - */ | ||
172 | - proto.once = alias('addOnceListener'); | ||
173 | - | ||
174 | - /** | ||
175 | - * 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. | ||
176 | - * You need to tell it what event names should be matched by a regex. | ||
177 | - * | ||
178 | - * @param {String} evt Name of the event to create. | ||
179 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
180 | - */ | ||
181 | - proto.defineEvent = function defineEvent(evt) { | ||
182 | - this.getListeners(evt); | ||
183 | - return this; | ||
184 | - }; | ||
185 | - | ||
186 | - /** | ||
187 | - * Uses defineEvent to define multiple events. | ||
188 | - * | ||
189 | - * @param {String[]} evts An array of event names to define. | ||
190 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
191 | - */ | ||
192 | - proto.defineEvents = function defineEvents(evts) { | ||
193 | - for (var i = 0; i < evts.length; i += 1) { | ||
194 | - this.defineEvent(evts[i]); | ||
195 | - } | ||
196 | - return this; | ||
197 | - }; | ||
198 | - | ||
199 | - /** | ||
200 | - * Removes a listener function from the specified event. | ||
201 | - * When passed a regular expression as the event name, it will remove the listener from all events that match it. | ||
202 | - * | ||
203 | - * @param {String|RegExp} evt Name of the event to remove the listener from. | ||
204 | - * @param {Function} listener Method to remove from the event. | ||
205 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
206 | - */ | ||
207 | - proto.removeListener = function removeListener(evt, listener) { | ||
208 | - var listeners = this.getListenersAsObject(evt); | ||
209 | - var index; | ||
210 | - var key; | ||
211 | - | ||
212 | - for (key in listeners) { | ||
213 | - if (listeners.hasOwnProperty(key)) { | ||
214 | - index = indexOfListener(listeners[key], listener); | ||
215 | - | ||
216 | - if (index !== -1) { | ||
217 | - listeners[key].splice(index, 1); | ||
218 | - } | ||
219 | - } | ||
220 | - } | ||
221 | - | ||
222 | - return this; | ||
223 | - }; | ||
224 | - | ||
225 | - /** | ||
226 | - * Alias of removeListener | ||
227 | - */ | ||
228 | - proto.off = alias('removeListener'); | ||
229 | - | ||
230 | - /** | ||
231 | - * Adds listeners in bulk using the manipulateListeners method. | ||
232 | - * 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. | ||
233 | - * You can also pass it a regular expression to add the array of listeners to all events that match it. | ||
234 | - * Yeah, this function does quite a bit. That's probably a bad thing. | ||
235 | - * | ||
236 | - * @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. | ||
237 | - * @param {Function[]} [listeners] An optional array of listener functions to add. | ||
238 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
239 | - */ | ||
240 | - proto.addListeners = function addListeners(evt, listeners) { | ||
241 | - // Pass through to manipulateListeners | ||
242 | - return this.manipulateListeners(false, evt, listeners); | ||
243 | - }; | ||
244 | - | ||
245 | - /** | ||
246 | - * Removes listeners in bulk using the manipulateListeners method. | ||
247 | - * 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. | ||
248 | - * You can also pass it an event name and an array of listeners to be removed. | ||
249 | - * You can also pass it a regular expression to remove the listeners from all events that match it. | ||
250 | - * | ||
251 | - * @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. | ||
252 | - * @param {Function[]} [listeners] An optional array of listener functions to remove. | ||
253 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
254 | - */ | ||
255 | - proto.removeListeners = function removeListeners(evt, listeners) { | ||
256 | - // Pass through to manipulateListeners | ||
257 | - return this.manipulateListeners(true, evt, listeners); | ||
258 | - }; | ||
259 | - | ||
260 | - /** | ||
261 | - * 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. | ||
262 | - * The first argument will determine if the listeners are removed (true) or added (false). | ||
263 | - * 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. | ||
264 | - * You can also pass it an event name and an array of listeners to be added/removed. | ||
265 | - * You can also pass it a regular expression to manipulate the listeners of all events that match it. | ||
266 | - * | ||
267 | - * @param {Boolean} remove True if you want to remove listeners, false if you want to add. | ||
268 | - * @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. | ||
269 | - * @param {Function[]} [listeners] An optional array of listener functions to add/remove. | ||
270 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
271 | - */ | ||
272 | - proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { | ||
273 | - var i; | ||
274 | - var value; | ||
275 | - var single = remove ? this.removeListener : this.addListener; | ||
276 | - var multiple = remove ? this.removeListeners : this.addListeners; | ||
277 | - | ||
278 | - // If evt is an object then pass each of its properties to this method | ||
279 | - if (typeof evt === 'object' && !(evt instanceof RegExp)) { | ||
280 | - for (i in evt) { | ||
281 | - if (evt.hasOwnProperty(i) && (value = evt[i])) { | ||
282 | - // Pass the single listener straight through to the singular method | ||
283 | - if (typeof value === 'function') { | ||
284 | - single.call(this, i, value); | ||
285 | - } | ||
286 | - else { | ||
287 | - // Otherwise pass back to the multiple function | ||
288 | - multiple.call(this, i, value); | ||
289 | - } | ||
290 | - } | ||
291 | - } | ||
292 | - } | ||
293 | - else { | ||
294 | - // So evt must be a string | ||
295 | - // And listeners must be an array of listeners | ||
296 | - // Loop over it and pass each one to the multiple method | ||
297 | - i = listeners.length; | ||
298 | - while (i--) { | ||
299 | - single.call(this, evt, listeners[i]); | ||
300 | - } | ||
301 | - } | ||
302 | - | ||
303 | - return this; | ||
304 | - }; | ||
305 | - | ||
306 | - /** | ||
307 | - * Removes all listeners from a specified event. | ||
308 | - * If you do not specify an event then all listeners will be removed. | ||
309 | - * That means every event will be emptied. | ||
310 | - * You can also pass a regex to remove all events that match it. | ||
311 | - * | ||
312 | - * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. | ||
313 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
314 | - */ | ||
315 | - proto.removeEvent = function removeEvent(evt) { | ||
316 | - var type = typeof evt; | ||
317 | - var events = this._getEvents(); | ||
318 | - var key; | ||
319 | - | ||
320 | - // Remove different things depending on the state of evt | ||
321 | - if (type === 'string') { | ||
322 | - // Remove all listeners for the specified event | ||
323 | - delete events[evt]; | ||
324 | - } | ||
325 | - else if (evt instanceof RegExp) { | ||
326 | - // Remove all events matching the regex. | ||
327 | - for (key in events) { | ||
328 | - if (events.hasOwnProperty(key) && evt.test(key)) { | ||
329 | - delete events[key]; | ||
330 | - } | ||
331 | - } | ||
332 | - } | ||
333 | - else { | ||
334 | - // Remove all listeners in all events | ||
335 | - delete this._events; | ||
336 | - } | ||
337 | - | ||
338 | - return this; | ||
339 | - }; | ||
340 | - | ||
341 | - /** | ||
342 | - * Alias of removeEvent. | ||
343 | - * | ||
344 | - * Added to mirror the node API. | ||
345 | - */ | ||
346 | - proto.removeAllListeners = alias('removeEvent'); | ||
347 | - | ||
348 | - /** | ||
349 | - * Emits an event of your choice. | ||
350 | - * When emitted, every listener attached to that event will be executed. | ||
351 | - * If you pass the optional argument array then those arguments will be passed to every listener upon execution. | ||
352 | - * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. | ||
353 | - * So they will not arrive within the array on the other side, they will be separate. | ||
354 | - * You can also pass a regular expression to emit to all events that match it. | ||
355 | - * | ||
356 | - * @param {String|RegExp} evt Name of the event to emit and execute listeners for. | ||
357 | - * @param {Array} [args] Optional array of arguments to be passed to each listener. | ||
358 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
359 | - */ | ||
360 | - proto.emitEvent = function emitEvent(evt, args) { | ||
361 | - var listenersMap = this.getListenersAsObject(evt); | ||
362 | - var listeners; | ||
363 | - var listener; | ||
364 | - var i; | ||
365 | - var key; | ||
366 | - var response; | ||
367 | - | ||
368 | - for (key in listenersMap) { | ||
369 | - if (listenersMap.hasOwnProperty(key)) { | ||
370 | - listeners = listenersMap[key].slice(0); | ||
371 | - i = listeners.length; | ||
372 | - | ||
373 | - while (i--) { | ||
374 | - // If the listener returns true then it shall be removed from the event | ||
375 | - // The function is executed either with a basic call or an apply if there is an args array | ||
376 | - listener = listeners[i]; | ||
377 | - | ||
378 | - if (listener.once === true) { | ||
379 | - this.removeListener(evt, listener.listener); | ||
380 | - } | ||
381 | - | ||
382 | - response = listener.listener.apply(this, args || []); | ||
383 | - | ||
384 | - if (response === this._getOnceReturnValue()) { | ||
385 | - this.removeListener(evt, listener.listener); | ||
386 | - } | ||
387 | - } | ||
388 | - } | ||
389 | - } | ||
390 | - | ||
391 | - return this; | ||
392 | - }; | ||
393 | - | ||
394 | - /** | ||
395 | - * Alias of emitEvent | ||
396 | - */ | ||
397 | - proto.trigger = alias('emitEvent'); | ||
398 | - | ||
399 | - /** | ||
400 | - * 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. | ||
401 | - * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. | ||
402 | - * | ||
403 | - * @param {String|RegExp} evt Name of the event to emit and execute listeners for. | ||
404 | - * @param {...*} Optional additional arguments to be passed to each listener. | ||
405 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
406 | - */ | ||
407 | - proto.emit = function emit(evt) { | ||
408 | - var args = Array.prototype.slice.call(arguments, 1); | ||
409 | - return this.emitEvent(evt, args); | ||
410 | - }; | ||
411 | - | ||
412 | - /** | ||
413 | - * Sets the current value to check against when executing listeners. If a | ||
414 | - * listeners return value matches the one set here then it will be removed | ||
415 | - * after execution. This value defaults to true. | ||
416 | - * | ||
417 | - * @param {*} value The new value to check for when executing listeners. | ||
418 | - * @return {Object} Current instance of EventEmitter for chaining. | ||
419 | - */ | ||
420 | - proto.setOnceReturnValue = function setOnceReturnValue(value) { | ||
421 | - this._onceReturnValue = value; | ||
422 | - return this; | ||
423 | - }; | ||
424 | - | ||
425 | - /** | ||
426 | - * Fetches the current value to check against when executing listeners. If | ||
427 | - * the listeners return value matches this one then it should be removed | ||
428 | - * automatically. It will return true by default. | ||
429 | - * | ||
430 | - * @return {*|Boolean} The current value to check for or the default, true. | ||
431 | - * @api private | ||
432 | - */ | ||
433 | - proto._getOnceReturnValue = function _getOnceReturnValue() { | ||
434 | - if (this.hasOwnProperty('_onceReturnValue')) { | ||
435 | - return this._onceReturnValue; | ||
436 | - } | ||
437 | - else { | ||
438 | - return true; | ||
439 | - } | ||
440 | - }; | ||
441 | - | ||
442 | - /** | ||
443 | - * Fetches the events object and creates one if required. | ||
444 | - * | ||
445 | - * @return {Object} The events storage object. | ||
446 | - * @api private | ||
447 | - */ | ||
448 | - proto._getEvents = function _getEvents() { | ||
449 | - return this._events || (this._events = {}); | ||
450 | - }; | ||
451 | - | ||
452 | - /** | ||
453 | - * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. | ||
454 | - * | ||
455 | - * @return {Function} Non conflicting EventEmitter class. | ||
456 | - */ | ||
457 | - EventEmitter.noConflict = function noConflict() { | ||
458 | - exports.EventEmitter = originalGlobalValue; | ||
459 | - return EventEmitter; | ||
460 | - }; | ||
461 | - | ||
462 | - // Expose the class either via AMD, CommonJS or the global object | ||
463 | - if (typeof define === 'function' && define.amd) { | ||
464 | - define(function () { | ||
465 | - return EventEmitter; | ||
466 | - }); | ||
467 | - } | ||
468 | - else if (typeof module === 'object' && module.exports){ | ||
469 | - module.exports = EventEmitter; | ||
470 | - } | ||
471 | - else { | ||
472 | - exports.EventEmitter = EventEmitter; | ||
473 | - } | ||
474 | -}.call(this)); | 1 | +/*! |
2 | + * EventEmitter v4.2.11 - git.io/ee | ||
3 | + * Unlicense - http://unlicense.org/ | ||
4 | + * Oliver Caldwell - http://oli.me.uk/ | ||
5 | + * @preserve | ||
6 | + */ | ||
7 | + | ||
8 | +;(function () { | ||
9 | + 'use strict'; | ||
10 | + | ||
11 | + /** | ||
12 | + * Class for managing events. | ||
13 | + * Can be extended to provide event functionality in other classes. | ||
14 | + * | ||
15 | + * @class EventEmitter Manages event registering and emitting. | ||
16 | + */ | ||
17 | + function EventEmitter() {} | ||
18 | + | ||
19 | + // Shortcuts to improve speed and size | ||
20 | + var proto = EventEmitter.prototype; | ||
21 | + var exports = this; | ||
22 | + var originalGlobalValue = exports.EventEmitter; | ||
23 | + | ||
24 | + /** | ||
25 | + * Finds the index of the listener for the event in its storage array. | ||
26 | + * | ||
27 | + * @param {Function[]} listeners Array of listeners to search through. | ||
28 | + * @param {Function} listener Method to look for. | ||
29 | + * @return {Number} Index of the specified listener, -1 if not found | ||
30 | + * @api private | ||
31 | + */ | ||
32 | + function indexOfListener(listeners, listener) { | ||
33 | + var i = listeners.length; | ||
34 | + while (i--) { | ||
35 | + if (listeners[i].listener === listener) { | ||
36 | + return i; | ||
37 | + } | ||
38 | + } | ||
39 | + | ||
40 | + return -1; | ||
41 | + } | ||
42 | + | ||
43 | + /** | ||
44 | + * Alias a method while keeping the context correct, to allow for overwriting of target method. | ||
45 | + * | ||
46 | + * @param {String} name The name of the target method. | ||
47 | + * @return {Function} The aliased method | ||
48 | + * @api private | ||
49 | + */ | ||
50 | + function alias(name) { | ||
51 | + return function aliasClosure() { | ||
52 | + return this[name].apply(this, arguments); | ||
53 | + }; | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * Returns the listener array for the specified event. | ||
58 | + * Will initialise the event object and listener arrays if required. | ||
59 | + * 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. | ||
60 | + * Each property in the object response is an array of listener functions. | ||
61 | + * | ||
62 | + * @param {String|RegExp} evt Name of the event to return the listeners from. | ||
63 | + * @return {Function[]|Object} All listener functions for the event. | ||
64 | + */ | ||
65 | + proto.getListeners = function getListeners(evt) { | ||
66 | + var events = this._getEvents(); | ||
67 | + var response; | ||
68 | + var key; | ||
69 | + | ||
70 | + // Return a concatenated array of all matching events if | ||
71 | + // the selector is a regular expression. | ||
72 | + if (evt instanceof RegExp) { | ||
73 | + response = {}; | ||
74 | + for (key in events) { | ||
75 | + if (events.hasOwnProperty(key) && evt.test(key)) { | ||
76 | + response[key] = events[key]; | ||
77 | + } | ||
78 | + } | ||
79 | + } | ||
80 | + else { | ||
81 | + response = events[evt] || (events[evt] = []); | ||
82 | + } | ||
83 | + | ||
84 | + return response; | ||
85 | + }; | ||
86 | + | ||
87 | + /** | ||
88 | + * Takes a list of listener objects and flattens it into a list of listener functions. | ||
89 | + * | ||
90 | + * @param {Object[]} listeners Raw listener objects. | ||
91 | + * @return {Function[]} Just the listener functions. | ||
92 | + */ | ||
93 | + proto.flattenListeners = function flattenListeners(listeners) { | ||
94 | + var flatListeners = []; | ||
95 | + var i; | ||
96 | + | ||
97 | + for (i = 0; i < listeners.length; i += 1) { | ||
98 | + flatListeners.push(listeners[i].listener); | ||
99 | + } | ||
100 | + | ||
101 | + return flatListeners; | ||
102 | + }; | ||
103 | + | ||
104 | + /** | ||
105 | + * 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. | ||
106 | + * | ||
107 | + * @param {String|RegExp} evt Name of the event to return the listeners from. | ||
108 | + * @return {Object} All listener functions for an event in an object. | ||
109 | + */ | ||
110 | + proto.getListenersAsObject = function getListenersAsObject(evt) { | ||
111 | + var listeners = this.getListeners(evt); | ||
112 | + var response; | ||
113 | + | ||
114 | + if (listeners instanceof Array) { | ||
115 | + response = {}; | ||
116 | + response[evt] = listeners; | ||
117 | + } | ||
118 | + | ||
119 | + return response || listeners; | ||
120 | + }; | ||
121 | + | ||
122 | + /** | ||
123 | + * Adds a listener function to the specified event. | ||
124 | + * The listener will not be added if it is a duplicate. | ||
125 | + * If the listener returns true then it will be removed after it is called. | ||
126 | + * If you pass a regular expression as the event name then the listener will be added to all events that match it. | ||
127 | + * | ||
128 | + * @param {String|RegExp} evt Name of the event to attach the listener to. | ||
129 | + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. | ||
130 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
131 | + */ | ||
132 | + proto.addListener = function addListener(evt, listener) { | ||
133 | + var listeners = this.getListenersAsObject(evt); | ||
134 | + var listenerIsWrapped = typeof listener === 'object'; | ||
135 | + var key; | ||
136 | + | ||
137 | + for (key in listeners) { | ||
138 | + if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { | ||
139 | + listeners[key].push(listenerIsWrapped ? listener : { | ||
140 | + listener: listener, | ||
141 | + once: false | ||
142 | + }); | ||
143 | + } | ||
144 | + } | ||
145 | + | ||
146 | + return this; | ||
147 | + }; | ||
148 | + | ||
149 | + /** | ||
150 | + * Alias of addListener | ||
151 | + */ | ||
152 | + proto.on = alias('addListener'); | ||
153 | + | ||
154 | + /** | ||
155 | + * Semi-alias of addListener. It will add a listener that will be | ||
156 | + * automatically removed after its first execution. | ||
157 | + * | ||
158 | + * @param {String|RegExp} evt Name of the event to attach the listener to. | ||
159 | + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. | ||
160 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
161 | + */ | ||
162 | + proto.addOnceListener = function addOnceListener(evt, listener) { | ||
163 | + return this.addListener(evt, { | ||
164 | + listener: listener, | ||
165 | + once: true | ||
166 | + }); | ||
167 | + }; | ||
168 | + | ||
169 | + /** | ||
170 | + * Alias of addOnceListener. | ||
171 | + */ | ||
172 | + proto.once = alias('addOnceListener'); | ||
173 | + | ||
174 | + /** | ||
175 | + * 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. | ||
176 | + * You need to tell it what event names should be matched by a regex. | ||
177 | + * | ||
178 | + * @param {String} evt Name of the event to create. | ||
179 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
180 | + */ | ||
181 | + proto.defineEvent = function defineEvent(evt) { | ||
182 | + this.getListeners(evt); | ||
183 | + return this; | ||
184 | + }; | ||
185 | + | ||
186 | + /** | ||
187 | + * Uses defineEvent to define multiple events. | ||
188 | + * | ||
189 | + * @param {String[]} evts An array of event names to define. | ||
190 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
191 | + */ | ||
192 | + proto.defineEvents = function defineEvents(evts) { | ||
193 | + for (var i = 0; i < evts.length; i += 1) { | ||
194 | + this.defineEvent(evts[i]); | ||
195 | + } | ||
196 | + return this; | ||
197 | + }; | ||
198 | + | ||
199 | + /** | ||
200 | + * Removes a listener function from the specified event. | ||
201 | + * When passed a regular expression as the event name, it will remove the listener from all events that match it. | ||
202 | + * | ||
203 | + * @param {String|RegExp} evt Name of the event to remove the listener from. | ||
204 | + * @param {Function} listener Method to remove from the event. | ||
205 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
206 | + */ | ||
207 | + proto.removeListener = function removeListener(evt, listener) { | ||
208 | + var listeners = this.getListenersAsObject(evt); | ||
209 | + var index; | ||
210 | + var key; | ||
211 | + | ||
212 | + for (key in listeners) { | ||
213 | + if (listeners.hasOwnProperty(key)) { | ||
214 | + index = indexOfListener(listeners[key], listener); | ||
215 | + | ||
216 | + if (index !== -1) { | ||
217 | + listeners[key].splice(index, 1); | ||
218 | + } | ||
219 | + } | ||
220 | + } | ||
221 | + | ||
222 | + return this; | ||
223 | + }; | ||
224 | + | ||
225 | + /** | ||
226 | + * Alias of removeListener | ||
227 | + */ | ||
228 | + proto.off = alias('removeListener'); | ||
229 | + | ||
230 | + /** | ||
231 | + * Adds listeners in bulk using the manipulateListeners method. | ||
232 | + * 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. | ||
233 | + * You can also pass it a regular expression to add the array of listeners to all events that match it. | ||
234 | + * Yeah, this function does quite a bit. That's probably a bad thing. | ||
235 | + * | ||
236 | + * @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. | ||
237 | + * @param {Function[]} [listeners] An optional array of listener functions to add. | ||
238 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
239 | + */ | ||
240 | + proto.addListeners = function addListeners(evt, listeners) { | ||
241 | + // Pass through to manipulateListeners | ||
242 | + return this.manipulateListeners(false, evt, listeners); | ||
243 | + }; | ||
244 | + | ||
245 | + /** | ||
246 | + * Removes listeners in bulk using the manipulateListeners method. | ||
247 | + * 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. | ||
248 | + * You can also pass it an event name and an array of listeners to be removed. | ||
249 | + * You can also pass it a regular expression to remove the listeners from all events that match it. | ||
250 | + * | ||
251 | + * @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. | ||
252 | + * @param {Function[]} [listeners] An optional array of listener functions to remove. | ||
253 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
254 | + */ | ||
255 | + proto.removeListeners = function removeListeners(evt, listeners) { | ||
256 | + // Pass through to manipulateListeners | ||
257 | + return this.manipulateListeners(true, evt, listeners); | ||
258 | + }; | ||
259 | + | ||
260 | + /** | ||
261 | + * 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. | ||
262 | + * The first argument will determine if the listeners are removed (true) or added (false). | ||
263 | + * 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. | ||
264 | + * You can also pass it an event name and an array of listeners to be added/removed. | ||
265 | + * You can also pass it a regular expression to manipulate the listeners of all events that match it. | ||
266 | + * | ||
267 | + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. | ||
268 | + * @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. | ||
269 | + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. | ||
270 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
271 | + */ | ||
272 | + proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { | ||
273 | + var i; | ||
274 | + var value; | ||
275 | + var single = remove ? this.removeListener : this.addListener; | ||
276 | + var multiple = remove ? this.removeListeners : this.addListeners; | ||
277 | + | ||
278 | + // If evt is an object then pass each of its properties to this method | ||
279 | + if (typeof evt === 'object' && !(evt instanceof RegExp)) { | ||
280 | + for (i in evt) { | ||
281 | + if (evt.hasOwnProperty(i) && (value = evt[i])) { | ||
282 | + // Pass the single listener straight through to the singular method | ||
283 | + if (typeof value === 'function') { | ||
284 | + single.call(this, i, value); | ||
285 | + } | ||
286 | + else { | ||
287 | + // Otherwise pass back to the multiple function | ||
288 | + multiple.call(this, i, value); | ||
289 | + } | ||
290 | + } | ||
291 | + } | ||
292 | + } | ||
293 | + else { | ||
294 | + // So evt must be a string | ||
295 | + // And listeners must be an array of listeners | ||
296 | + // Loop over it and pass each one to the multiple method | ||
297 | + i = listeners.length; | ||
298 | + while (i--) { | ||
299 | + single.call(this, evt, listeners[i]); | ||
300 | + } | ||
301 | + } | ||
302 | + | ||
303 | + return this; | ||
304 | + }; | ||
305 | + | ||
306 | + /** | ||
307 | + * Removes all listeners from a specified event. | ||
308 | + * If you do not specify an event then all listeners will be removed. | ||
309 | + * That means every event will be emptied. | ||
310 | + * You can also pass a regex to remove all events that match it. | ||
311 | + * | ||
312 | + * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. | ||
313 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
314 | + */ | ||
315 | + proto.removeEvent = function removeEvent(evt) { | ||
316 | + var type = typeof evt; | ||
317 | + var events = this._getEvents(); | ||
318 | + var key; | ||
319 | + | ||
320 | + // Remove different things depending on the state of evt | ||
321 | + if (type === 'string') { | ||
322 | + // Remove all listeners for the specified event | ||
323 | + delete events[evt]; | ||
324 | + } | ||
325 | + else if (evt instanceof RegExp) { | ||
326 | + // Remove all events matching the regex. | ||
327 | + for (key in events) { | ||
328 | + if (events.hasOwnProperty(key) && evt.test(key)) { | ||
329 | + delete events[key]; | ||
330 | + } | ||
331 | + } | ||
332 | + } | ||
333 | + else { | ||
334 | + // Remove all listeners in all events | ||
335 | + delete this._events; | ||
336 | + } | ||
337 | + | ||
338 | + return this; | ||
339 | + }; | ||
340 | + | ||
341 | + /** | ||
342 | + * Alias of removeEvent. | ||
343 | + * | ||
344 | + * Added to mirror the node API. | ||
345 | + */ | ||
346 | + proto.removeAllListeners = alias('removeEvent'); | ||
347 | + | ||
348 | + /** | ||
349 | + * Emits an event of your choice. | ||
350 | + * When emitted, every listener attached to that event will be executed. | ||
351 | + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. | ||
352 | + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. | ||
353 | + * So they will not arrive within the array on the other side, they will be separate. | ||
354 | + * You can also pass a regular expression to emit to all events that match it. | ||
355 | + * | ||
356 | + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. | ||
357 | + * @param {Array} [args] Optional array of arguments to be passed to each listener. | ||
358 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
359 | + */ | ||
360 | + proto.emitEvent = function emitEvent(evt, args) { | ||
361 | + var listenersMap = this.getListenersAsObject(evt); | ||
362 | + var listeners; | ||
363 | + var listener; | ||
364 | + var i; | ||
365 | + var key; | ||
366 | + var response; | ||
367 | + | ||
368 | + for (key in listenersMap) { | ||
369 | + if (listenersMap.hasOwnProperty(key)) { | ||
370 | + listeners = listenersMap[key].slice(0); | ||
371 | + i = listeners.length; | ||
372 | + | ||
373 | + while (i--) { | ||
374 | + // If the listener returns true then it shall be removed from the event | ||
375 | + // The function is executed either with a basic call or an apply if there is an args array | ||
376 | + listener = listeners[i]; | ||
377 | + | ||
378 | + if (listener.once === true) { | ||
379 | + this.removeListener(evt, listener.listener); | ||
380 | + } | ||
381 | + | ||
382 | + response = listener.listener.apply(this, args || []); | ||
383 | + | ||
384 | + if (response === this._getOnceReturnValue()) { | ||
385 | + this.removeListener(evt, listener.listener); | ||
386 | + } | ||
387 | + } | ||
388 | + } | ||
389 | + } | ||
390 | + | ||
391 | + return this; | ||
392 | + }; | ||
393 | + | ||
394 | + /** | ||
395 | + * Alias of emitEvent | ||
396 | + */ | ||
397 | + proto.trigger = alias('emitEvent'); | ||
398 | + | ||
399 | + /** | ||
400 | + * 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. | ||
401 | + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. | ||
402 | + * | ||
403 | + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. | ||
404 | + * @param {...*} Optional additional arguments to be passed to each listener. | ||
405 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
406 | + */ | ||
407 | + proto.emit = function emit(evt) { | ||
408 | + var args = Array.prototype.slice.call(arguments, 1); | ||
409 | + return this.emitEvent(evt, args); | ||
410 | + }; | ||
411 | + | ||
412 | + /** | ||
413 | + * Sets the current value to check against when executing listeners. If a | ||
414 | + * listeners return value matches the one set here then it will be removed | ||
415 | + * after execution. This value defaults to true. | ||
416 | + * | ||
417 | + * @param {*} value The new value to check for when executing listeners. | ||
418 | + * @return {Object} Current instance of EventEmitter for chaining. | ||
419 | + */ | ||
420 | + proto.setOnceReturnValue = function setOnceReturnValue(value) { | ||
421 | + this._onceReturnValue = value; | ||
422 | + return this; | ||
423 | + }; | ||
424 | + | ||
425 | + /** | ||
426 | + * Fetches the current value to check against when executing listeners. If | ||
427 | + * the listeners return value matches this one then it should be removed | ||
428 | + * automatically. It will return true by default. | ||
429 | + * | ||
430 | + * @return {*|Boolean} The current value to check for or the default, true. | ||
431 | + * @api private | ||
432 | + */ | ||
433 | + proto._getOnceReturnValue = function _getOnceReturnValue() { | ||
434 | + if (this.hasOwnProperty('_onceReturnValue')) { | ||
435 | + return this._onceReturnValue; | ||
436 | + } | ||
437 | + else { | ||
438 | + return true; | ||
439 | + } | ||
440 | + }; | ||
441 | + | ||
442 | + /** | ||
443 | + * Fetches the events object and creates one if required. | ||
444 | + * | ||
445 | + * @return {Object} The events storage object. | ||
446 | + * @api private | ||
447 | + */ | ||
448 | + proto._getEvents = function _getEvents() { | ||
449 | + return this._events || (this._events = {}); | ||
450 | + }; | ||
451 | + | ||
452 | + /** | ||
453 | + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. | ||
454 | + * | ||
455 | + * @return {Function} Non conflicting EventEmitter class. | ||
456 | + */ | ||
457 | + EventEmitter.noConflict = function noConflict() { | ||
458 | + exports.EventEmitter = originalGlobalValue; | ||
459 | + return EventEmitter; | ||
460 | + }; | ||
461 | + | ||
462 | + // Expose the class either via AMD, CommonJS or the global object | ||
463 | + if (typeof define === 'function' && define.amd) { | ||
464 | + define(function () { | ||
465 | + return EventEmitter; | ||
466 | + }); | ||
467 | + } | ||
468 | + else if (typeof module === 'object' && module.exports){ | ||
469 | + module.exports = EventEmitter; | ||
470 | + } | ||
471 | + else { | ||
472 | + exports.EventEmitter = EventEmitter; | ||
473 | + } | ||
474 | +}.call(this)); |
1 | -/*! | ||
2 | - * EventEmitter v4.2.11 - git.io/ee | ||
3 | - * Unlicense - http://unlicense.org/ | ||
4 | - * Oliver Caldwell - http://oli.me.uk/ | ||
5 | - * @preserve | ||
6 | - */ | 1 | +/*! |
2 | + * EventEmitter v4.2.11 - git.io/ee | ||
3 | + * Unlicense - http://unlicense.org/ | ||
4 | + * Oliver Caldwell - http://oli.me.uk/ | ||
5 | + * @preserve | ||
6 | + */ | ||
7 | (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); | 7 | (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); |
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
1 | -{ | ||
2 | - "root": true, | ||
3 | - | ||
4 | - "extends": "@ljharb", | ||
5 | - | ||
6 | - "rules": { | ||
7 | - "camelcase": [0], | ||
8 | - "complexity": [0, 10], | ||
9 | - "dot-notation": [2, { "allowKeywords": false }], | ||
10 | - "eqeqeq": [2, "allow-null"], | ||
11 | - "id-length": [2, { "min": 1, "max": 40 }], | ||
12 | - "max-nested-callbacks": [2, 5], | ||
13 | - "max-params": [2, 7], | ||
14 | - "max-statements": [1, 30], | ||
15 | - "new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }], | ||
16 | - "no-constant-condition": [1], | ||
17 | - "no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}], | ||
18 | - "no-extra-parens": [0], | ||
19 | - "no-extra-semi": [1], | ||
20 | - "no-func-assign": [1], | ||
21 | - "no-implicit-coercion": [2, { | ||
22 | - "boolean": false, | ||
23 | - "number": false, | ||
24 | - "string": true | ||
25 | - }], | ||
26 | - "no-invalid-this": [0], | ||
27 | - "no-magic-numbers": [0], | ||
28 | - "no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}], | ||
29 | - "no-new-func": [1], | ||
30 | - "no-plusplus": [1], | ||
31 | - "no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], | ||
32 | - "no-shadow": [1], | ||
33 | - "no-unused-vars": [1, { "vars": "all", "args": "after-used" }], | ||
34 | - "operator-linebreak": [2, "after"], | ||
35 | - "quote-props": [1, "as-needed", { "keywords": true }], | ||
36 | - "spaced-comment": [0], | ||
37 | - "strict": [0] | ||
38 | - } | ||
39 | -} | 1 | +{ |
2 | + "root": true, | ||
3 | + | ||
4 | + "extends": "@ljharb", | ||
5 | + | ||
6 | + "rules": { | ||
7 | + "camelcase": [0], | ||
8 | + "complexity": [0, 10], | ||
9 | + "dot-notation": [2, { "allowKeywords": false }], | ||
10 | + "eqeqeq": [2, "allow-null"], | ||
11 | + "id-length": [2, { "min": 1, "max": 40 }], | ||
12 | + "max-nested-callbacks": [2, 5], | ||
13 | + "max-params": [2, 7], | ||
14 | + "max-statements": [1, 30], | ||
15 | + "new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }], | ||
16 | + "no-constant-condition": [1], | ||
17 | + "no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}], | ||
18 | + "no-extra-parens": [0], | ||
19 | + "no-extra-semi": [1], | ||
20 | + "no-func-assign": [1], | ||
21 | + "no-implicit-coercion": [2, { | ||
22 | + "boolean": false, | ||
23 | + "number": false, | ||
24 | + "string": true | ||
25 | + }], | ||
26 | + "no-invalid-this": [0], | ||
27 | + "no-magic-numbers": [0], | ||
28 | + "no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}], | ||
29 | + "no-new-func": [1], | ||
30 | + "no-plusplus": [1], | ||
31 | + "no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], | ||
32 | + "no-shadow": [1], | ||
33 | + "no-unused-vars": [1, { "vars": "all", "args": "after-used" }], | ||
34 | + "operator-linebreak": [2, "after"], | ||
35 | + "quote-props": [1, "as-needed", { "keywords": true }], | ||
36 | + "spaced-comment": [0], | ||
37 | + "strict": [0] | ||
38 | + } | ||
39 | +} |
1 | -{ | ||
2 | - "es3": true, | ||
3 | - | ||
4 | - "additionalRules": [], | ||
5 | - | ||
6 | - "requireSemicolons": true, | ||
7 | - | ||
8 | - "disallowMultipleSpaces": true, | ||
9 | - | ||
10 | - "disallowIdentifierNames": [], | ||
11 | - | ||
12 | - "requireCurlyBraces": { | ||
13 | - "allExcept": [], | ||
14 | - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] | ||
15 | - }, | ||
16 | - | ||
17 | - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], | ||
18 | - | ||
19 | - "disallowSpaceAfterKeywords": [], | ||
20 | - | ||
21 | - "disallowSpaceBeforeComma": true, | ||
22 | - "disallowSpaceAfterComma": false, | ||
23 | - "disallowSpaceBeforeSemicolon": true, | ||
24 | - | ||
25 | - "disallowNodeTypes": [ | ||
26 | - "DebuggerStatement", | ||
27 | - "LabeledStatement", | ||
28 | - "SwitchCase", | ||
29 | - "SwitchStatement", | ||
30 | - "WithStatement" | ||
31 | - ], | ||
32 | - | ||
33 | - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, | ||
34 | - | ||
35 | - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, | ||
36 | - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
37 | - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, | ||
38 | - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, | ||
39 | - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, | ||
40 | - | ||
41 | - "requireSpaceBetweenArguments": true, | ||
42 | - | ||
43 | - "disallowSpacesInsideParentheses": true, | ||
44 | - | ||
45 | - "disallowSpacesInsideArrayBrackets": true, | ||
46 | - | ||
47 | - "disallowQuotedKeysInObjects": "allButReserved", | ||
48 | - | ||
49 | - "disallowSpaceAfterObjectKeys": true, | ||
50 | - | ||
51 | - "requireCommaBeforeLineBreak": true, | ||
52 | - | ||
53 | - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
54 | - "requireSpaceAfterPrefixUnaryOperators": [], | ||
55 | - | ||
56 | - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
57 | - "requireSpaceBeforePostfixUnaryOperators": [], | ||
58 | - | ||
59 | - "disallowSpaceBeforeBinaryOperators": [], | ||
60 | - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
61 | - | ||
62 | - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
63 | - "disallowSpaceAfterBinaryOperators": [], | ||
64 | - | ||
65 | - "disallowImplicitTypeConversion": ["binary", "string"], | ||
66 | - | ||
67 | - "disallowKeywords": ["with", "eval"], | ||
68 | - | ||
69 | - "requireKeywordsOnNewLine": [], | ||
70 | - "disallowKeywordsOnNewLine": ["else"], | ||
71 | - | ||
72 | - "requireLineFeedAtFileEnd": true, | ||
73 | - | ||
74 | - "disallowTrailingWhitespace": true, | ||
75 | - | ||
76 | - "disallowTrailingComma": true, | ||
77 | - | ||
78 | - "excludeFiles": ["node_modules/**", "vendor/**"], | ||
79 | - | ||
80 | - "disallowMultipleLineStrings": true, | ||
81 | - | ||
82 | - "requireDotNotation": { "allExcept": ["keywords"] }, | ||
83 | - | ||
84 | - "requireParenthesesAroundIIFE": true, | ||
85 | - | ||
86 | - "validateLineBreaks": "LF", | ||
87 | - | ||
88 | - "validateQuoteMarks": { | ||
89 | - "escape": true, | ||
90 | - "mark": "'" | ||
91 | - }, | ||
92 | - | ||
93 | - "disallowOperatorBeforeLineBreak": [], | ||
94 | - | ||
95 | - "requireSpaceBeforeKeywords": [ | ||
96 | - "do", | ||
97 | - "for", | ||
98 | - "if", | ||
99 | - "else", | ||
100 | - "switch", | ||
101 | - "case", | ||
102 | - "try", | ||
103 | - "catch", | ||
104 | - "finally", | ||
105 | - "while", | ||
106 | - "with", | ||
107 | - "return" | ||
108 | - ], | ||
109 | - | ||
110 | - "validateAlignedFunctionParameters": { | ||
111 | - "lineBreakAfterOpeningBraces": true, | ||
112 | - "lineBreakBeforeClosingBraces": true | ||
113 | - }, | ||
114 | - | ||
115 | - "requirePaddingNewLinesBeforeExport": true, | ||
116 | - | ||
117 | - "validateNewlineAfterArrayElements": { | ||
118 | - "maximum": 200 | ||
119 | - }, | ||
120 | - | ||
121 | - "requirePaddingNewLinesAfterUseStrict": true, | ||
122 | - | ||
123 | - "disallowArrowFunctions": true, | ||
124 | - | ||
125 | - "disallowMultiLineTernary": false, | ||
126 | - | ||
127 | - "validateOrderInObjectKeys": false, | ||
128 | - | ||
129 | - "disallowIdenticalDestructuringNames": true, | ||
130 | - | ||
131 | - "disallowNestedTernaries": { "maxLevel": 7 }, | ||
132 | - | ||
133 | - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, | ||
134 | - "requireAlignedMultilineParams": false, | ||
135 | - | ||
136 | - "requireSpacesInGenerator": { | ||
137 | - "afterStar": true | ||
138 | - }, | ||
139 | - | ||
140 | - "disallowSpacesInGenerator": { | ||
141 | - "beforeStar": true | ||
142 | - }, | ||
143 | - | ||
144 | - "disallowVar": false, | ||
145 | - | ||
146 | - "requireArrayDestructuring": false, | ||
147 | - | ||
148 | - "requireEnhancedObjectLiterals": false, | ||
149 | - | ||
150 | - "requireObjectDestructuring": false, | ||
151 | - | ||
152 | - "requireEarlyReturn": false, | ||
153 | - | ||
154 | - "requireCapitalizedConstructorsNew": { | ||
155 | - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] | ||
156 | - }, | ||
157 | - | ||
158 | - "requireImportAlphabetized": false, | ||
159 | - | ||
160 | - "requireSpaceBeforeObjectValues": true, | ||
161 | - "requireSpaceBeforeDestructuredValues": true, | ||
162 | - | ||
163 | - "disallowSpacesInsideTemplateStringPlaceholders": true, | ||
164 | - | ||
165 | - "disallowArrayDestructuringReturn": false, | ||
166 | - | ||
167 | - "requireNewlineBeforeSingleStatementsInIf": false | ||
168 | -} | ||
169 | - | 1 | +{ |
2 | + "es3": true, | ||
3 | + | ||
4 | + "additionalRules": [], | ||
5 | + | ||
6 | + "requireSemicolons": true, | ||
7 | + | ||
8 | + "disallowMultipleSpaces": true, | ||
9 | + | ||
10 | + "disallowIdentifierNames": [], | ||
11 | + | ||
12 | + "requireCurlyBraces": { | ||
13 | + "allExcept": [], | ||
14 | + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] | ||
15 | + }, | ||
16 | + | ||
17 | + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], | ||
18 | + | ||
19 | + "disallowSpaceAfterKeywords": [], | ||
20 | + | ||
21 | + "disallowSpaceBeforeComma": true, | ||
22 | + "disallowSpaceAfterComma": false, | ||
23 | + "disallowSpaceBeforeSemicolon": true, | ||
24 | + | ||
25 | + "disallowNodeTypes": [ | ||
26 | + "DebuggerStatement", | ||
27 | + "LabeledStatement", | ||
28 | + "SwitchCase", | ||
29 | + "SwitchStatement", | ||
30 | + "WithStatement" | ||
31 | + ], | ||
32 | + | ||
33 | + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, | ||
34 | + | ||
35 | + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, | ||
36 | + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
37 | + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, | ||
38 | + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, | ||
39 | + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, | ||
40 | + | ||
41 | + "requireSpaceBetweenArguments": true, | ||
42 | + | ||
43 | + "disallowSpacesInsideParentheses": true, | ||
44 | + | ||
45 | + "disallowSpacesInsideArrayBrackets": true, | ||
46 | + | ||
47 | + "disallowQuotedKeysInObjects": "allButReserved", | ||
48 | + | ||
49 | + "disallowSpaceAfterObjectKeys": true, | ||
50 | + | ||
51 | + "requireCommaBeforeLineBreak": true, | ||
52 | + | ||
53 | + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
54 | + "requireSpaceAfterPrefixUnaryOperators": [], | ||
55 | + | ||
56 | + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
57 | + "requireSpaceBeforePostfixUnaryOperators": [], | ||
58 | + | ||
59 | + "disallowSpaceBeforeBinaryOperators": [], | ||
60 | + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
61 | + | ||
62 | + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
63 | + "disallowSpaceAfterBinaryOperators": [], | ||
64 | + | ||
65 | + "disallowImplicitTypeConversion": ["binary", "string"], | ||
66 | + | ||
67 | + "disallowKeywords": ["with", "eval"], | ||
68 | + | ||
69 | + "requireKeywordsOnNewLine": [], | ||
70 | + "disallowKeywordsOnNewLine": ["else"], | ||
71 | + | ||
72 | + "requireLineFeedAtFileEnd": true, | ||
73 | + | ||
74 | + "disallowTrailingWhitespace": true, | ||
75 | + | ||
76 | + "disallowTrailingComma": true, | ||
77 | + | ||
78 | + "excludeFiles": ["node_modules/**", "vendor/**"], | ||
79 | + | ||
80 | + "disallowMultipleLineStrings": true, | ||
81 | + | ||
82 | + "requireDotNotation": { "allExcept": ["keywords"] }, | ||
83 | + | ||
84 | + "requireParenthesesAroundIIFE": true, | ||
85 | + | ||
86 | + "validateLineBreaks": "LF", | ||
87 | + | ||
88 | + "validateQuoteMarks": { | ||
89 | + "escape": true, | ||
90 | + "mark": "'" | ||
91 | + }, | ||
92 | + | ||
93 | + "disallowOperatorBeforeLineBreak": [], | ||
94 | + | ||
95 | + "requireSpaceBeforeKeywords": [ | ||
96 | + "do", | ||
97 | + "for", | ||
98 | + "if", | ||
99 | + "else", | ||
100 | + "switch", | ||
101 | + "case", | ||
102 | + "try", | ||
103 | + "catch", | ||
104 | + "finally", | ||
105 | + "while", | ||
106 | + "with", | ||
107 | + "return" | ||
108 | + ], | ||
109 | + | ||
110 | + "validateAlignedFunctionParameters": { | ||
111 | + "lineBreakAfterOpeningBraces": true, | ||
112 | + "lineBreakBeforeClosingBraces": true | ||
113 | + }, | ||
114 | + | ||
115 | + "requirePaddingNewLinesBeforeExport": true, | ||
116 | + | ||
117 | + "validateNewlineAfterArrayElements": { | ||
118 | + "maximum": 200 | ||
119 | + }, | ||
120 | + | ||
121 | + "requirePaddingNewLinesAfterUseStrict": true, | ||
122 | + | ||
123 | + "disallowArrowFunctions": true, | ||
124 | + | ||
125 | + "disallowMultiLineTernary": false, | ||
126 | + | ||
127 | + "validateOrderInObjectKeys": false, | ||
128 | + | ||
129 | + "disallowIdenticalDestructuringNames": true, | ||
130 | + | ||
131 | + "disallowNestedTernaries": { "maxLevel": 7 }, | ||
132 | + | ||
133 | + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, | ||
134 | + "requireAlignedMultilineParams": false, | ||
135 | + | ||
136 | + "requireSpacesInGenerator": { | ||
137 | + "afterStar": true | ||
138 | + }, | ||
139 | + | ||
140 | + "disallowSpacesInGenerator": { | ||
141 | + "beforeStar": true | ||
142 | + }, | ||
143 | + | ||
144 | + "disallowVar": false, | ||
145 | + | ||
146 | + "requireArrayDestructuring": false, | ||
147 | + | ||
148 | + "requireEnhancedObjectLiterals": false, | ||
149 | + | ||
150 | + "requireObjectDestructuring": false, | ||
151 | + | ||
152 | + "requireEarlyReturn": false, | ||
153 | + | ||
154 | + "requireCapitalizedConstructorsNew": { | ||
155 | + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] | ||
156 | + }, | ||
157 | + | ||
158 | + "requireImportAlphabetized": false, | ||
159 | + | ||
160 | + "requireSpaceBeforeObjectValues": true, | ||
161 | + "requireSpaceBeforeDestructuredValues": true, | ||
162 | + | ||
163 | + "disallowSpacesInsideTemplateStringPlaceholders": true, | ||
164 | + | ||
165 | + "disallowArrayDestructuringReturn": false, | ||
166 | + | ||
167 | + "requireNewlineBeforeSingleStatementsInIf": false | ||
168 | +} | ||
169 | + |
1 | -language: node_js | ||
2 | -node_js: | ||
3 | - - "5.9" | ||
4 | - - "5.8" | ||
5 | - - "5.7" | ||
6 | - - "5.6" | ||
7 | - - "5.5" | ||
8 | - - "5.4" | ||
9 | - - "5.3" | ||
10 | - - "5.2" | ||
11 | - - "5.1" | ||
12 | - - "5.0" | ||
13 | - - "4.4" | ||
14 | - - "4.3" | ||
15 | - - "4.2" | ||
16 | - - "4.1" | ||
17 | - - "4.0" | ||
18 | - - "iojs-v3.3" | ||
19 | - - "iojs-v3.2" | ||
20 | - - "iojs-v3.1" | ||
21 | - - "iojs-v3.0" | ||
22 | - - "iojs-v2.5" | ||
23 | - - "iojs-v2.4" | ||
24 | - - "iojs-v2.3" | ||
25 | - - "iojs-v2.2" | ||
26 | - - "iojs-v2.1" | ||
27 | - - "iojs-v2.0" | ||
28 | - - "iojs-v1.8" | ||
29 | - - "iojs-v1.7" | ||
30 | - - "iojs-v1.6" | ||
31 | - - "iojs-v1.5" | ||
32 | - - "iojs-v1.4" | ||
33 | - - "iojs-v1.3" | ||
34 | - - "iojs-v1.2" | ||
35 | - - "iojs-v1.1" | ||
36 | - - "iojs-v1.0" | ||
37 | - - "0.12" | ||
38 | - - "0.11" | ||
39 | - - "0.10" | ||
40 | - - "0.9" | ||
41 | - - "0.8" | ||
42 | - - "0.6" | ||
43 | - - "0.4" | ||
44 | -before_install: | ||
45 | - - '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' | ||
46 | - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' | ||
47 | -script: | ||
48 | - - 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi' | ||
49 | -sudo: false | ||
50 | -matrix: | ||
51 | - fast_finish: true | ||
52 | - allow_failures: | ||
53 | - - node_js: "5.8" | ||
54 | - - node_js: "5.7" | ||
55 | - - node_js: "5.6" | ||
56 | - - node_js: "5.5" | ||
57 | - - node_js: "5.4" | ||
58 | - - node_js: "5.3" | ||
59 | - - node_js: "5.2" | ||
60 | - - node_js: "5.1" | ||
61 | - - node_js: "5.0" | ||
62 | - - node_js: "4.3" | ||
63 | - - node_js: "4.2" | ||
64 | - - node_js: "4.1" | ||
65 | - - node_js: "4.0" | ||
66 | - - node_js: "iojs-v3.2" | ||
67 | - - node_js: "iojs-v3.1" | ||
68 | - - node_js: "iojs-v3.0" | ||
69 | - - node_js: "iojs-v2.4" | ||
70 | - - node_js: "iojs-v2.3" | ||
71 | - - node_js: "iojs-v2.2" | ||
72 | - - node_js: "iojs-v2.1" | ||
73 | - - node_js: "iojs-v2.0" | ||
74 | - - node_js: "iojs-v1.7" | ||
75 | - - node_js: "iojs-v1.6" | ||
76 | - - node_js: "iojs-v1.5" | ||
77 | - - node_js: "iojs-v1.4" | ||
78 | - - node_js: "iojs-v1.3" | ||
79 | - - node_js: "iojs-v1.2" | ||
80 | - - node_js: "iojs-v1.1" | ||
81 | - - node_js: "iojs-v1.0" | ||
82 | - - node_js: "0.11" | ||
83 | - - node_js: "0.9" | ||
84 | - - node_js: "0.6" | ||
85 | - - node_js: "0.4" | 1 | +language: node_js |
2 | +node_js: | ||
3 | + - "5.9" | ||
4 | + - "5.8" | ||
5 | + - "5.7" | ||
6 | + - "5.6" | ||
7 | + - "5.5" | ||
8 | + - "5.4" | ||
9 | + - "5.3" | ||
10 | + - "5.2" | ||
11 | + - "5.1" | ||
12 | + - "5.0" | ||
13 | + - "4.4" | ||
14 | + - "4.3" | ||
15 | + - "4.2" | ||
16 | + - "4.1" | ||
17 | + - "4.0" | ||
18 | + - "iojs-v3.3" | ||
19 | + - "iojs-v3.2" | ||
20 | + - "iojs-v3.1" | ||
21 | + - "iojs-v3.0" | ||
22 | + - "iojs-v2.5" | ||
23 | + - "iojs-v2.4" | ||
24 | + - "iojs-v2.3" | ||
25 | + - "iojs-v2.2" | ||
26 | + - "iojs-v2.1" | ||
27 | + - "iojs-v2.0" | ||
28 | + - "iojs-v1.8" | ||
29 | + - "iojs-v1.7" | ||
30 | + - "iojs-v1.6" | ||
31 | + - "iojs-v1.5" | ||
32 | + - "iojs-v1.4" | ||
33 | + - "iojs-v1.3" | ||
34 | + - "iojs-v1.2" | ||
35 | + - "iojs-v1.1" | ||
36 | + - "iojs-v1.0" | ||
37 | + - "0.12" | ||
38 | + - "0.11" | ||
39 | + - "0.10" | ||
40 | + - "0.9" | ||
41 | + - "0.8" | ||
42 | + - "0.6" | ||
43 | + - "0.4" | ||
44 | +before_install: | ||
45 | + - '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' | ||
46 | + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' | ||
47 | +script: | ||
48 | + - 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi' | ||
49 | +sudo: false | ||
50 | +matrix: | ||
51 | + fast_finish: true | ||
52 | + allow_failures: | ||
53 | + - node_js: "5.8" | ||
54 | + - node_js: "5.7" | ||
55 | + - node_js: "5.6" | ||
56 | + - node_js: "5.5" | ||
57 | + - node_js: "5.4" | ||
58 | + - node_js: "5.3" | ||
59 | + - node_js: "5.2" | ||
60 | + - node_js: "5.1" | ||
61 | + - node_js: "5.0" | ||
62 | + - node_js: "4.3" | ||
63 | + - node_js: "4.2" | ||
64 | + - node_js: "4.1" | ||
65 | + - node_js: "4.0" | ||
66 | + - node_js: "iojs-v3.2" | ||
67 | + - node_js: "iojs-v3.1" | ||
68 | + - node_js: "iojs-v3.0" | ||
69 | + - node_js: "iojs-v2.4" | ||
70 | + - node_js: "iojs-v2.3" | ||
71 | + - node_js: "iojs-v2.2" | ||
72 | + - node_js: "iojs-v2.1" | ||
73 | + - node_js: "iojs-v2.0" | ||
74 | + - node_js: "iojs-v1.7" | ||
75 | + - node_js: "iojs-v1.6" | ||
76 | + - node_js: "iojs-v1.5" | ||
77 | + - node_js: "iojs-v1.4" | ||
78 | + - node_js: "iojs-v1.3" | ||
79 | + - node_js: "iojs-v1.2" | ||
80 | + - node_js: "iojs-v1.1" | ||
81 | + - node_js: "iojs-v1.0" | ||
82 | + - node_js: "0.11" | ||
83 | + - node_js: "0.9" | ||
84 | + - node_js: "0.6" | ||
85 | + - node_js: "0.4" |
1 | -4.5.7 | ||
2 | - - [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390) | ||
3 | - | ||
4 | -4.5.6 | ||
5 | - - [Fix] `new Date(new Date())` should work in IE 8 (#389) | ||
6 | - - [Tests] on `node` `v5.7` | ||
7 | - - [Dev Deps] update `uglify-js` | ||
8 | - | ||
9 | -4.5.5 | ||
10 | - - [Fix] Adobe Photoshop’s JS engine bizarrely can have `+date !== date.getTime()` (#365) | ||
11 | - - [Dev Deps] update `eslint` | ||
12 | - - [Refactor] Update `is-callable` implementation to match latest | ||
13 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
14 | - | ||
15 | -4.5.4 | ||
16 | - - [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42 | ||
17 | - | ||
18 | -4.5.3 | ||
19 | - - [Fix] Saturday is a day in the week (#386) | ||
20 | - - [Robustness] improve Function#bind (#381) | ||
21 | - - [Tests] on `node` `v5.6`, `v4.3` | ||
22 | - - [Tests] use json3 (#382) | ||
23 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config` | ||
24 | - - [Docs] add note about script order (#379) | ||
25 | - | ||
26 | -4.5.2 | ||
27 | - - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
28 | - | ||
29 | -4.5.1 | ||
30 | - - [Fix] Make sure preexisting + broken `Array#` methods that throw don’t break the runtime (#377) | ||
31 | - - [Dev Deps] update `jscs` | ||
32 | - | ||
33 | -4.5.0 | ||
34 | - - [New] `parseFloat('-0')` should return -0 in Opera 12 (#371) | ||
35 | - - [New] Provide and replace Date UTC methods (#360) | ||
36 | - - [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesn’t observably look them up on the receiver | ||
37 | - - [Robustness] use a cached and shimmed `String#trim` | ||
38 | - - [Tests] up to `node` `v5.5` | ||
39 | - - [Tests] add `parallelshell` and use it in a few tasks | ||
40 | - - [Refactor] rename cached methods to avoid linter warnings | ||
41 | - - [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config' | ||
42 | - - [Docs] Update license year to 2016 (#374) | ||
43 | - | ||
44 | -4.4.2 | ||
45 | - - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
46 | - | ||
47 | -4.4.1 | ||
48 | - - [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370) | ||
49 | - - [Docs] add missing shimmed things | ||
50 | - | ||
51 | -4.4.0 | ||
52 | - - [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364) | ||
53 | - - [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354) | ||
54 | - - [Fix] In IE 6, `window.external` makes `Object.keys` throw | ||
55 | - - [Fix] `Array#slice`: boxed string access on IE <= 8 (#349) | ||
56 | - - [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352) | ||
57 | - - [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358) | ||
58 | - - [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString` | ||
59 | - - [Robustness] Use a bound form of `Array#slice.call` | ||
60 | - - [Tests] Properly check for descriptor support in IE <= 8 | ||
61 | - - [Tests] on `node` `v5.1` | ||
62 | - - [Tests] Add `Array#slice` tests (#346) | ||
63 | - - [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver` | ||
64 | - - [Docs] Fix broken UMD links (#344) | ||
65 | - | ||
66 | -4.3.2 | ||
67 | - - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
68 | - | ||
69 | -4.3.1 | ||
70 | - - [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342) | ||
71 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
72 | - - [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits | ||
73 | - | ||
74 | -4.3.0 | ||
75 | - - [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336) | ||
76 | - - [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined` | ||
77 | - - [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333) | ||
78 | - - [New] `Error#toString`: prints out the proper message in IE 7 and below (#334) | ||
79 | - - [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340) | ||
80 | - - [Fix] `String#lastIndexOf`: ensure the correct length in IE 8 | ||
81 | - - [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332) | ||
82 | - - [Robustness] Use a bound `Array#push` instead of relying on `Function#call` | ||
83 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
84 | - - [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) | ||
85 | - - [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114) | ||
86 | - - [Tests] add additional `Array#shift` tests (#337) | ||
87 | - - [Tests] Add additional `Array#splice` tests (#339) | ||
88 | - - [Tests] Add `Array#pop` tests, just in case (#338) | ||
89 | - - [Tests] include `global` tests in HTML test files | ||
90 | - - [Tests] Make sure the HTML tests run with the right charset | ||
91 | - - [Tests] ensure `node` `v0.8` tests stay passing. | ||
92 | - - [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off | ||
93 | - - [Tests] on `node` `v5.0` | ||
94 | - - [Tests] fix npm upgrades for older nodes | ||
95 | - | ||
96 | -4.2.1 | ||
97 | - - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
98 | - | ||
99 | -4.2.0 | ||
100 | - - [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support. | ||
101 | - - [Dev Deps] update `eslint`, `jscs` | ||
102 | - | ||
103 | -4.1.16 | ||
104 | - - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
105 | - | ||
106 | -4.1.15 | ||
107 | - - [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) | ||
108 | - - [shim: fix] add 'frame' to blacklisted keys (#330) | ||
109 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js` | ||
110 | - - [Tests] on `node` `v4.2` | ||
111 | - - [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off | ||
112 | - | ||
113 | -4.1.14 | ||
114 | - - [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327) | ||
115 | - - [Refactor] Use `ES.ToUint32` instead of inline `>>>` | ||
116 | - - [Tests] up to `node` `v4.1` | ||
117 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs` | ||
118 | - | ||
119 | -4.1.13 | ||
120 | - - [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326) | ||
121 | - | ||
122 | -4.1.12 | ||
123 | - - [fix] Make sure uglify doesn't remove function names | ||
124 | - - [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325) | ||
125 | - - [Tests] up to `io.js` `v3.3` | ||
126 | - - [Dev Deps] update `eslint`, `@ljharb/eslint-config` | ||
127 | - | ||
128 | -4.1.11 | ||
129 | - - [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly) | ||
130 | - - [shim: fix] Omit !Date.parse check in the if statement (#323) | ||
131 | - - [sham: fix] Fix Object.create sham to not set __proto__ (#301) | ||
132 | - - [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320) | ||
133 | - - [Tests] up to `io.js` `v3.1` | ||
134 | - - [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics | ||
135 | - - [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318) | ||
136 | - - [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config | ||
137 | - | ||
138 | -4.1.10 | ||
139 | - - [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322) | ||
140 | - - [Tests] Consolidating `Date.parse` extended year tests | ||
141 | - - [Tests] Account for a `Date.parse` precision variance in Safari 8 | ||
142 | - - [Tests] DRY up some Date.parse tests | ||
143 | - - [Tests] Don't create globals in Date tests | ||
144 | - - [Tests] Better failure output when an invalid date's toJSON throws | ||
145 | - - [Tests] Also compare lengths of array-likes | ||
146 | - - [Tests] Extra check on Object.keys(arguments) | ||
147 | - - [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable | ||
148 | - | ||
149 | -4.1.9 | ||
150 | - - [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6 | ||
151 | - - [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix. | ||
152 | - - [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome. | ||
153 | - - [Performance] Speed up blacklisted key check for Object.keys automation equality bug. | ||
154 | - - [Tests] Test on `io.js` `v2.4` | ||
155 | - - [Dev Deps] Update `eslint`, `semver` | ||
156 | - | ||
157 | -4.1.8 | ||
158 | - - [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275) | ||
159 | - - [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315) | ||
160 | - - [Fix] Fix `Date#toISOString` in Safari 5.1 (#243) | ||
161 | - - [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289) | ||
162 | - - [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295) | ||
163 | - - [Robustness] Safely use and reference many builtins internally (also see #313) | ||
164 | - - [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs | ||
165 | - - [Dev Deps] Update `eslint` | ||
166 | - | ||
167 | -4.1.7 | ||
168 | - - Make sure `Date.parse` is not enumerable (#310) | ||
169 | - | ||
170 | -4.1.6 | ||
171 | - - Support IE 8 when `document.domain` is set (#306, #150) | ||
172 | - - Remove version from `bower.json` (#307) | ||
173 | - | ||
174 | -4.1.5 | ||
175 | - - Add a failing runtime check for Safari 8 `Date.parse` | ||
176 | - - Update `eslint`, `semver` | ||
177 | - - Test on `io.js` `v2.2` | ||
178 | - | ||
179 | -4.1.4 | ||
180 | - - Make sure copied `Date` properties remain non-enumerable. | ||
181 | - - Using a more reliable check for supported property descriptors in non-IE ES3 | ||
182 | - - Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305) | ||
183 | - - Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`. | ||
184 | - - Test on `io.js` `v2.1` | ||
185 | - - Clean up `Array.prototype` iteration methods | ||
186 | - | ||
187 | -4.1.3 | ||
188 | - - Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license | ||
189 | - - Update `uglify-js`, `eslint` | ||
190 | - | ||
191 | -4.1.2 | ||
192 | - - In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303) | ||
193 | - - Date: Ensure all code paths have the correct `constructor` property | ||
194 | - - Date: Don't copy non-own properties from original `Date` | ||
195 | - - Test up to `io.js` `v2.0.0` | ||
196 | - - Simplify `isPrimitive` check. | ||
197 | - - Adding sanity check tests for ES5 `Number` constants. | ||
198 | - - Update `uglify-js`, `eslint`, `semver` | ||
199 | - | ||
200 | -4.1.1 | ||
201 | - - Fix name of `parseInt` replacement. | ||
202 | - - Update copyright year | ||
203 | - - Update `eslint`, `jscs` | ||
204 | - - Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change. | ||
205 | - - All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. | ||
206 | - - Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures. | ||
207 | - - Ensure some Object tests don't fail in ES6 | ||
208 | - - Make sure `Date` instances don't have an enumerable `constructor` property, when possible. | ||
209 | - | ||
210 | -4.1.0 | ||
211 | - - Update `eslint` | ||
212 | - - Improve type checks: `Array.isArray`, `isRegex` | ||
213 | - - Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules | ||
214 | - - Note which ES abstract methods are replaceable via `es-abstract` | ||
215 | - - Run `travis-ci` tests on `iojs`! | ||
216 | - | ||
217 | -4.0.6 | ||
218 | - - Update `jscs`, `uglify-js`, add `eslint` | ||
219 | - - es5-sham: fix Object.defineProperty to not check for own properties (#211) | ||
220 | - - Fix Array#splice bug in Safari 5 (#284) | ||
221 | - - Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285) | ||
222 | - | ||
223 | -4.0.5 | ||
224 | - - Update `jscs` so tests pass | ||
225 | - | ||
226 | -4.0.4 | ||
227 | - - Style/indentation/whitespace cleanups. | ||
228 | - - README tweaks | ||
229 | - | ||
230 | -4.0.3 | ||
231 | - - Fix keywords (#268) | ||
232 | - - add some Date tests | ||
233 | - - Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710) | ||
234 | - | ||
235 | -4.0.2 | ||
236 | - - Start including version numbers in minified files (#267) | ||
237 | - | ||
238 | -4.0.1 | ||
239 | - - Fix legacy arguments object detection in Object.keys (#260) | ||
240 | - | ||
241 | -4.0.0 | ||
242 | - - No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255) | ||
243 | - - Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250) | ||
244 | - - lots of internal refactoring | ||
245 | - - Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254) | ||
246 | - | ||
247 | -3.4.0 | ||
248 | - - Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239) | ||
249 | - - Fix Object.keys with Arguments objects in Safari 5.0 | ||
250 | - - Now shimming String#split in Opera 10.6 | ||
251 | - - Avoid using "toString" as a variable name, since that breaks Opera | ||
252 | - - Internal implementation and test cleanups | ||
253 | - | ||
254 | -3.3.2 | ||
255 | - - Remove an internal "bind" call, which should make the shim a bit faster | ||
256 | - - Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6 | ||
257 | - | ||
258 | -3.3.1 | ||
259 | - - Fixing an Array#splice bug in IE 6/7 | ||
260 | - - cleaning up Array#splice tests | ||
261 | - | ||
262 | -3.3.0 | ||
263 | - - Fix Array#reduceRight in node 0.6 and older browsers (#238) | ||
264 | - | ||
265 | -3.2.0 | ||
266 | - - Fix es5-sham UMD definition to work properly with AMD (#237) | ||
267 | - - Ensure that Array methods do not autobox context in strict mode (#233) | ||
268 | - | ||
269 | -3.1.1 | ||
270 | - - Update minified files (#231) | ||
271 | - | ||
272 | -3.1.0 | ||
273 | - - Fix String#replace in Firefox up through 29 (#228) | ||
274 | - | ||
275 | -3.0.2 | ||
276 | - - Fix `Function#bind` in IE 7 and 8 (#224, #225, #226) | ||
277 | - | ||
278 | -3.0.1 | ||
279 | - - Version bump to ensure npm has newest minified assets | ||
280 | - | ||
281 | -3.0.0 | ||
282 | - - es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini | ||
283 | - - Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim` | ||
284 | - - Added spec-compliant shim for `parseInt` | ||
285 | - - Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives | ||
286 | - - Improve minification of builds | ||
287 | - | ||
288 | -2.3.0 | ||
289 | - - parseInt is now properly shimmed in ES3 browsers to default the radix | ||
290 | - - update URLs to point to the new organization | ||
291 | - | ||
292 | -2.2.0 | ||
293 | - - Function.prototype.bind shim now reports correct length on a bound function | ||
294 | - - fix node 0.6.x v8 bug in Array#forEach | ||
295 | - - test improvements | ||
296 | - | ||
297 | -2.1.0 | ||
298 | - - Object.create fixes | ||
299 | - - tweaks to the Object.defineProperties shim | ||
300 | - | ||
301 | -2.0.0 | ||
302 | - - Separate reliable shims from dubious shims (shams). | ||
303 | - | ||
304 | -1.2.10 | ||
305 | - - Group-effort Style Cleanup | ||
306 | - - Took a stab at fixing Object.defineProperty on IE8 without | ||
307 | - bad side-effects. (@hax) | ||
308 | - - Object.isExtensible no longer fakes it. (@xavierm) | ||
309 | - - Date.prototype.toISOString no longer deals with partial | ||
310 | - ISO dates, per spec (@kitcambridge) | ||
311 | - - More (mostly from @bryanforbes) | ||
312 | - | ||
313 | -1.2.9 | ||
314 | - - Corrections to toISOString by @kitcambridge | ||
315 | - - Fixed three bugs in array methods revealed by Jasmine tests. | ||
316 | - - Cleaned up Function.prototype.bind with more fixes and tests from | ||
317 | - @bryanforbes. | ||
318 | - | ||
319 | -1.2.8 | ||
320 | - - Actually fixed problems with Function.prototype.bind, and regressions | ||
321 | - from 1.2.7 (@bryanforbes, @jdalton #36) | ||
322 | - | ||
323 | -1.2.7 - REGRESSED | ||
324 | - - Fixed problems with Function.prototype.bind when called as a constructor. | ||
325 | - (@jdalton #36) | ||
326 | - | ||
327 | -1.2.6 | ||
328 | - - Revised Date.parse to match ES 5.1 (kitcambridge) | ||
329 | - | ||
330 | -1.2.5 | ||
331 | - - Fixed a bug for padding it Date..toISOString (tadfisher issue #33) | ||
332 | - | ||
333 | -1.2.4 | ||
334 | - - Fixed a descriptor bug in Object.defineProperty (raynos) | ||
335 | - | ||
336 | -1.2.3 | ||
337 | - - Cleaned up RequireJS and <script> boilerplate | ||
338 | - | ||
339 | -1.2.2 | ||
340 | - - Changed reduce to follow the letter of the spec with regard to having and | ||
341 | - owning properties. | ||
342 | - - Fixed a bug where RegExps pass as Functions in some engines in reduce. | ||
343 | - | ||
344 | -1.2.1 | ||
345 | - - Adding few fixes to make jshint happy. | ||
346 | - - Fix for issue #12, function expressions can cause scoping issues in IE. | ||
347 | - - NPM will minify on install or when `npm run-script install` is executed. | ||
348 | - - Adding .gitignore to avoid publishing dev dependencies. | ||
349 | - | ||
350 | -1.2.0 | ||
351 | - - Making script loadable as AMD module. | ||
352 | - - Adding `indexOf` to the list of safe shims. | ||
353 | - | ||
354 | -1.1.0 | ||
355 | - - Added support for accessor properties where possible (which is all browsers | ||
356 | - except IE). | ||
357 | - - Stop exposing bound function's (that are returned by | ||
358 | - `Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`) | ||
359 | - as in some cases (when using facade objects for example) capabilities of the | ||
360 | - enclosed functions will be leaked. | ||
361 | - - `Object.create` now explicitly sets `__proto__` property to guarantee | ||
362 | - correct behavior of `Object.getPrototypeOf`'s on all objects created using | ||
363 | - `Object.create`. | ||
364 | - - Switched to `===` from `==` where possible as it's slightly faster on older | ||
365 | - browsers that are target of this lib. | ||
366 | - - Added names to all anonymous functions to have a better stack traces. | ||
367 | - | ||
368 | -1.0.0 | ||
369 | - - fixed Date.toISODate, using UTC accessors, as in | ||
370 | - http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986 | ||
371 | - (arian) | ||
372 | - | ||
373 | -0.0.4 | ||
374 | - - Revised Object.getPrototypeOf to work in more cases | ||
375 | - in response to http://ejohn.org/blog/objectgetprototypeof/ | ||
376 | - [issue #2] (fschaefer) | ||
377 | - | ||
378 | -0.0.3 | ||
379 | - - Fixed typos in Object.keys (samsonjs) | ||
380 | - | ||
381 | -0.0.2 | ||
382 | - Per kangax's recommendations: | ||
383 | - - faster Object.create(null) | ||
384 | - - fixed a function-scope function declaration statement in Object.create | ||
385 | - | ||
386 | -0.0.1 | ||
387 | - - fixed Object.create(null), in so far as that's possible | ||
388 | - - reworked Rhino Object.freeze(Function) bug detector and patcher | ||
389 | - | ||
390 | -0.0.0 | ||
391 | - - forked from narwhal-lib | ||
392 | - | 1 | +4.5.7 |
2 | + - [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390) | ||
3 | + | ||
4 | +4.5.6 | ||
5 | + - [Fix] `new Date(new Date())` should work in IE 8 (#389) | ||
6 | + - [Tests] on `node` `v5.7` | ||
7 | + - [Dev Deps] update `uglify-js` | ||
8 | + | ||
9 | +4.5.5 | ||
10 | + - [Fix] Adobe Photoshop’s JS engine bizarrely can have `+date !== date.getTime()` (#365) | ||
11 | + - [Dev Deps] update `eslint` | ||
12 | + - [Refactor] Update `is-callable` implementation to match latest | ||
13 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
14 | + | ||
15 | +4.5.4 | ||
16 | + - [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42 | ||
17 | + | ||
18 | +4.5.3 | ||
19 | + - [Fix] Saturday is a day in the week (#386) | ||
20 | + - [Robustness] improve Function#bind (#381) | ||
21 | + - [Tests] on `node` `v5.6`, `v4.3` | ||
22 | + - [Tests] use json3 (#382) | ||
23 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config` | ||
24 | + - [Docs] add note about script order (#379) | ||
25 | + | ||
26 | +4.5.2 | ||
27 | + - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
28 | + | ||
29 | +4.5.1 | ||
30 | + - [Fix] Make sure preexisting + broken `Array#` methods that throw don’t break the runtime (#377) | ||
31 | + - [Dev Deps] update `jscs` | ||
32 | + | ||
33 | +4.5.0 | ||
34 | + - [New] `parseFloat('-0')` should return -0 in Opera 12 (#371) | ||
35 | + - [New] Provide and replace Date UTC methods (#360) | ||
36 | + - [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesn’t observably look them up on the receiver | ||
37 | + - [Robustness] use a cached and shimmed `String#trim` | ||
38 | + - [Tests] up to `node` `v5.5` | ||
39 | + - [Tests] add `parallelshell` and use it in a few tasks | ||
40 | + - [Refactor] rename cached methods to avoid linter warnings | ||
41 | + - [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config' | ||
42 | + - [Docs] Update license year to 2016 (#374) | ||
43 | + | ||
44 | +4.4.2 | ||
45 | + - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
46 | + | ||
47 | +4.4.1 | ||
48 | + - [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370) | ||
49 | + - [Docs] add missing shimmed things | ||
50 | + | ||
51 | +4.4.0 | ||
52 | + - [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364) | ||
53 | + - [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354) | ||
54 | + - [Fix] In IE 6, `window.external` makes `Object.keys` throw | ||
55 | + - [Fix] `Array#slice`: boxed string access on IE <= 8 (#349) | ||
56 | + - [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352) | ||
57 | + - [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358) | ||
58 | + - [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString` | ||
59 | + - [Robustness] Use a bound form of `Array#slice.call` | ||
60 | + - [Tests] Properly check for descriptor support in IE <= 8 | ||
61 | + - [Tests] on `node` `v5.1` | ||
62 | + - [Tests] Add `Array#slice` tests (#346) | ||
63 | + - [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver` | ||
64 | + - [Docs] Fix broken UMD links (#344) | ||
65 | + | ||
66 | +4.3.2 | ||
67 | + - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
68 | + | ||
69 | +4.3.1 | ||
70 | + - [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342) | ||
71 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
72 | + - [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits | ||
73 | + | ||
74 | +4.3.0 | ||
75 | + - [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336) | ||
76 | + - [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined` | ||
77 | + - [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333) | ||
78 | + - [New] `Error#toString`: prints out the proper message in IE 7 and below (#334) | ||
79 | + - [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340) | ||
80 | + - [Fix] `String#lastIndexOf`: ensure the correct length in IE 8 | ||
81 | + - [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332) | ||
82 | + - [Robustness] Use a bound `Array#push` instead of relying on `Function#call` | ||
83 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs` | ||
84 | + - [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) | ||
85 | + - [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114) | ||
86 | + - [Tests] add additional `Array#shift` tests (#337) | ||
87 | + - [Tests] Add additional `Array#splice` tests (#339) | ||
88 | + - [Tests] Add `Array#pop` tests, just in case (#338) | ||
89 | + - [Tests] include `global` tests in HTML test files | ||
90 | + - [Tests] Make sure the HTML tests run with the right charset | ||
91 | + - [Tests] ensure `node` `v0.8` tests stay passing. | ||
92 | + - [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off | ||
93 | + - [Tests] on `node` `v5.0` | ||
94 | + - [Tests] fix npm upgrades for older nodes | ||
95 | + | ||
96 | +4.2.1 | ||
97 | + - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
98 | + | ||
99 | +4.2.0 | ||
100 | + - [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support. | ||
101 | + - [Dev Deps] update `eslint`, `jscs` | ||
102 | + | ||
103 | +4.1.16 | ||
104 | + - [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380) | ||
105 | + | ||
106 | +4.1.15 | ||
107 | + - [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) | ||
108 | + - [shim: fix] add 'frame' to blacklisted keys (#330) | ||
109 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js` | ||
110 | + - [Tests] on `node` `v4.2` | ||
111 | + - [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off | ||
112 | + | ||
113 | +4.1.14 | ||
114 | + - [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327) | ||
115 | + - [Refactor] Use `ES.ToUint32` instead of inline `>>>` | ||
116 | + - [Tests] up to `node` `v4.1` | ||
117 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs` | ||
118 | + | ||
119 | +4.1.13 | ||
120 | + - [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326) | ||
121 | + | ||
122 | +4.1.12 | ||
123 | + - [fix] Make sure uglify doesn't remove function names | ||
124 | + - [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325) | ||
125 | + - [Tests] up to `io.js` `v3.3` | ||
126 | + - [Dev Deps] update `eslint`, `@ljharb/eslint-config` | ||
127 | + | ||
128 | +4.1.11 | ||
129 | + - [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly) | ||
130 | + - [shim: fix] Omit !Date.parse check in the if statement (#323) | ||
131 | + - [sham: fix] Fix Object.create sham to not set __proto__ (#301) | ||
132 | + - [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320) | ||
133 | + - [Tests] up to `io.js` `v3.1` | ||
134 | + - [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics | ||
135 | + - [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318) | ||
136 | + - [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config | ||
137 | + | ||
138 | +4.1.10 | ||
139 | + - [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322) | ||
140 | + - [Tests] Consolidating `Date.parse` extended year tests | ||
141 | + - [Tests] Account for a `Date.parse` precision variance in Safari 8 | ||
142 | + - [Tests] DRY up some Date.parse tests | ||
143 | + - [Tests] Don't create globals in Date tests | ||
144 | + - [Tests] Better failure output when an invalid date's toJSON throws | ||
145 | + - [Tests] Also compare lengths of array-likes | ||
146 | + - [Tests] Extra check on Object.keys(arguments) | ||
147 | + - [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable | ||
148 | + | ||
149 | +4.1.9 | ||
150 | + - [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6 | ||
151 | + - [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix. | ||
152 | + - [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome. | ||
153 | + - [Performance] Speed up blacklisted key check for Object.keys automation equality bug. | ||
154 | + - [Tests] Test on `io.js` `v2.4` | ||
155 | + - [Dev Deps] Update `eslint`, `semver` | ||
156 | + | ||
157 | +4.1.8 | ||
158 | + - [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275) | ||
159 | + - [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315) | ||
160 | + - [Fix] Fix `Date#toISOString` in Safari 5.1 (#243) | ||
161 | + - [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289) | ||
162 | + - [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295) | ||
163 | + - [Robustness] Safely use and reference many builtins internally (also see #313) | ||
164 | + - [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs | ||
165 | + - [Dev Deps] Update `eslint` | ||
166 | + | ||
167 | +4.1.7 | ||
168 | + - Make sure `Date.parse` is not enumerable (#310) | ||
169 | + | ||
170 | +4.1.6 | ||
171 | + - Support IE 8 when `document.domain` is set (#306, #150) | ||
172 | + - Remove version from `bower.json` (#307) | ||
173 | + | ||
174 | +4.1.5 | ||
175 | + - Add a failing runtime check for Safari 8 `Date.parse` | ||
176 | + - Update `eslint`, `semver` | ||
177 | + - Test on `io.js` `v2.2` | ||
178 | + | ||
179 | +4.1.4 | ||
180 | + - Make sure copied `Date` properties remain non-enumerable. | ||
181 | + - Using a more reliable check for supported property descriptors in non-IE ES3 | ||
182 | + - Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305) | ||
183 | + - Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`. | ||
184 | + - Test on `io.js` `v2.1` | ||
185 | + - Clean up `Array.prototype` iteration methods | ||
186 | + | ||
187 | +4.1.3 | ||
188 | + - Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license | ||
189 | + - Update `uglify-js`, `eslint` | ||
190 | + | ||
191 | +4.1.2 | ||
192 | + - In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303) | ||
193 | + - Date: Ensure all code paths have the correct `constructor` property | ||
194 | + - Date: Don't copy non-own properties from original `Date` | ||
195 | + - Test up to `io.js` `v2.0.0` | ||
196 | + - Simplify `isPrimitive` check. | ||
197 | + - Adding sanity check tests for ES5 `Number` constants. | ||
198 | + - Update `uglify-js`, `eslint`, `semver` | ||
199 | + | ||
200 | +4.1.1 | ||
201 | + - Fix name of `parseInt` replacement. | ||
202 | + - Update copyright year | ||
203 | + - Update `eslint`, `jscs` | ||
204 | + - Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change. | ||
205 | + - All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. | ||
206 | + - Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures. | ||
207 | + - Ensure some Object tests don't fail in ES6 | ||
208 | + - Make sure `Date` instances don't have an enumerable `constructor` property, when possible. | ||
209 | + | ||
210 | +4.1.0 | ||
211 | + - Update `eslint` | ||
212 | + - Improve type checks: `Array.isArray`, `isRegex` | ||
213 | + - Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules | ||
214 | + - Note which ES abstract methods are replaceable via `es-abstract` | ||
215 | + - Run `travis-ci` tests on `iojs`! | ||
216 | + | ||
217 | +4.0.6 | ||
218 | + - Update `jscs`, `uglify-js`, add `eslint` | ||
219 | + - es5-sham: fix Object.defineProperty to not check for own properties (#211) | ||
220 | + - Fix Array#splice bug in Safari 5 (#284) | ||
221 | + - Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285) | ||
222 | + | ||
223 | +4.0.5 | ||
224 | + - Update `jscs` so tests pass | ||
225 | + | ||
226 | +4.0.4 | ||
227 | + - Style/indentation/whitespace cleanups. | ||
228 | + - README tweaks | ||
229 | + | ||
230 | +4.0.3 | ||
231 | + - Fix keywords (#268) | ||
232 | + - add some Date tests | ||
233 | + - Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710) | ||
234 | + | ||
235 | +4.0.2 | ||
236 | + - Start including version numbers in minified files (#267) | ||
237 | + | ||
238 | +4.0.1 | ||
239 | + - Fix legacy arguments object detection in Object.keys (#260) | ||
240 | + | ||
241 | +4.0.0 | ||
242 | + - No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255) | ||
243 | + - Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250) | ||
244 | + - lots of internal refactoring | ||
245 | + - Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254) | ||
246 | + | ||
247 | +3.4.0 | ||
248 | + - Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239) | ||
249 | + - Fix Object.keys with Arguments objects in Safari 5.0 | ||
250 | + - Now shimming String#split in Opera 10.6 | ||
251 | + - Avoid using "toString" as a variable name, since that breaks Opera | ||
252 | + - Internal implementation and test cleanups | ||
253 | + | ||
254 | +3.3.2 | ||
255 | + - Remove an internal "bind" call, which should make the shim a bit faster | ||
256 | + - Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6 | ||
257 | + | ||
258 | +3.3.1 | ||
259 | + - Fixing an Array#splice bug in IE 6/7 | ||
260 | + - cleaning up Array#splice tests | ||
261 | + | ||
262 | +3.3.0 | ||
263 | + - Fix Array#reduceRight in node 0.6 and older browsers (#238) | ||
264 | + | ||
265 | +3.2.0 | ||
266 | + - Fix es5-sham UMD definition to work properly with AMD (#237) | ||
267 | + - Ensure that Array methods do not autobox context in strict mode (#233) | ||
268 | + | ||
269 | +3.1.1 | ||
270 | + - Update minified files (#231) | ||
271 | + | ||
272 | +3.1.0 | ||
273 | + - Fix String#replace in Firefox up through 29 (#228) | ||
274 | + | ||
275 | +3.0.2 | ||
276 | + - Fix `Function#bind` in IE 7 and 8 (#224, #225, #226) | ||
277 | + | ||
278 | +3.0.1 | ||
279 | + - Version bump to ensure npm has newest minified assets | ||
280 | + | ||
281 | +3.0.0 | ||
282 | + - es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini | ||
283 | + - Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim` | ||
284 | + - Added spec-compliant shim for `parseInt` | ||
285 | + - Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives | ||
286 | + - Improve minification of builds | ||
287 | + | ||
288 | +2.3.0 | ||
289 | + - parseInt is now properly shimmed in ES3 browsers to default the radix | ||
290 | + - update URLs to point to the new organization | ||
291 | + | ||
292 | +2.2.0 | ||
293 | + - Function.prototype.bind shim now reports correct length on a bound function | ||
294 | + - fix node 0.6.x v8 bug in Array#forEach | ||
295 | + - test improvements | ||
296 | + | ||
297 | +2.1.0 | ||
298 | + - Object.create fixes | ||
299 | + - tweaks to the Object.defineProperties shim | ||
300 | + | ||
301 | +2.0.0 | ||
302 | + - Separate reliable shims from dubious shims (shams). | ||
303 | + | ||
304 | +1.2.10 | ||
305 | + - Group-effort Style Cleanup | ||
306 | + - Took a stab at fixing Object.defineProperty on IE8 without | ||
307 | + bad side-effects. (@hax) | ||
308 | + - Object.isExtensible no longer fakes it. (@xavierm) | ||
309 | + - Date.prototype.toISOString no longer deals with partial | ||
310 | + ISO dates, per spec (@kitcambridge) | ||
311 | + - More (mostly from @bryanforbes) | ||
312 | + | ||
313 | +1.2.9 | ||
314 | + - Corrections to toISOString by @kitcambridge | ||
315 | + - Fixed three bugs in array methods revealed by Jasmine tests. | ||
316 | + - Cleaned up Function.prototype.bind with more fixes and tests from | ||
317 | + @bryanforbes. | ||
318 | + | ||
319 | +1.2.8 | ||
320 | + - Actually fixed problems with Function.prototype.bind, and regressions | ||
321 | + from 1.2.7 (@bryanforbes, @jdalton #36) | ||
322 | + | ||
323 | +1.2.7 - REGRESSED | ||
324 | + - Fixed problems with Function.prototype.bind when called as a constructor. | ||
325 | + (@jdalton #36) | ||
326 | + | ||
327 | +1.2.6 | ||
328 | + - Revised Date.parse to match ES 5.1 (kitcambridge) | ||
329 | + | ||
330 | +1.2.5 | ||
331 | + - Fixed a bug for padding it Date..toISOString (tadfisher issue #33) | ||
332 | + | ||
333 | +1.2.4 | ||
334 | + - Fixed a descriptor bug in Object.defineProperty (raynos) | ||
335 | + | ||
336 | +1.2.3 | ||
337 | + - Cleaned up RequireJS and <script> boilerplate | ||
338 | + | ||
339 | +1.2.2 | ||
340 | + - Changed reduce to follow the letter of the spec with regard to having and | ||
341 | + owning properties. | ||
342 | + - Fixed a bug where RegExps pass as Functions in some engines in reduce. | ||
343 | + | ||
344 | +1.2.1 | ||
345 | + - Adding few fixes to make jshint happy. | ||
346 | + - Fix for issue #12, function expressions can cause scoping issues in IE. | ||
347 | + - NPM will minify on install or when `npm run-script install` is executed. | ||
348 | + - Adding .gitignore to avoid publishing dev dependencies. | ||
349 | + | ||
350 | +1.2.0 | ||
351 | + - Making script loadable as AMD module. | ||
352 | + - Adding `indexOf` to the list of safe shims. | ||
353 | + | ||
354 | +1.1.0 | ||
355 | + - Added support for accessor properties where possible (which is all browsers | ||
356 | + except IE). | ||
357 | + - Stop exposing bound function's (that are returned by | ||
358 | + `Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`) | ||
359 | + as in some cases (when using facade objects for example) capabilities of the | ||
360 | + enclosed functions will be leaked. | ||
361 | + - `Object.create` now explicitly sets `__proto__` property to guarantee | ||
362 | + correct behavior of `Object.getPrototypeOf`'s on all objects created using | ||
363 | + `Object.create`. | ||
364 | + - Switched to `===` from `==` where possible as it's slightly faster on older | ||
365 | + browsers that are target of this lib. | ||
366 | + - Added names to all anonymous functions to have a better stack traces. | ||
367 | + | ||
368 | +1.0.0 | ||
369 | + - fixed Date.toISODate, using UTC accessors, as in | ||
370 | + http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986 | ||
371 | + (arian) | ||
372 | + | ||
373 | +0.0.4 | ||
374 | + - Revised Object.getPrototypeOf to work in more cases | ||
375 | + in response to http://ejohn.org/blog/objectgetprototypeof/ | ||
376 | + [issue #2] (fschaefer) | ||
377 | + | ||
378 | +0.0.3 | ||
379 | + - Fixed typos in Object.keys (samsonjs) | ||
380 | + | ||
381 | +0.0.2 | ||
382 | + Per kangax's recommendations: | ||
383 | + - faster Object.create(null) | ||
384 | + - fixed a function-scope function declaration statement in Object.create | ||
385 | + | ||
386 | +0.0.1 | ||
387 | + - fixed Object.create(null), in so far as that's possible | ||
388 | + - reworked Rhino Object.freeze(Function) bug detector and patcher | ||
389 | + | ||
390 | +0.0.0 | ||
391 | + - forked from narwhal-lib | ||
392 | + |
1 | - | ||
2 | -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License | ||
3 | -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal | ||
4 | - Project) | ||
5 | -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA | ||
6 | -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License | ||
7 | -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License | ||
8 | -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License | ||
9 | -- kossnocorp Sasha Koss XXX TODO License or CLA | ||
10 | -- bryanforbes Bryan Forbes XXX TODO License or CLA | ||
11 | -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence | ||
12 | -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD | ||
13 | - License | ||
14 | -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License | ||
15 | -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain) | ||
16 | -- iwyg XXX TODO License or CLA | ||
17 | -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License | ||
18 | -- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License | ||
19 | -- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence | ||
20 | -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License | ||
21 | -- rwldrn Rick Waldron Copyright (C) 2011 MIT License | ||
22 | -- lexer Alexey Zakharov XXX TODO License or CLA | ||
23 | -- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.) | ||
24 | - Copyright (C) 2009 MIT License | ||
25 | -- Steven Levithan Copyright (C) 2012 MIT License | ||
26 | -- Jordan Harband (C) 2013 MIT License | ||
27 | - | 1 | + |
2 | +- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License | ||
3 | +- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal | ||
4 | + Project) | ||
5 | +- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA | ||
6 | +- fschaefer Florian Schäfer Copyright (C) 2010 MIT License | ||
7 | +- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License | ||
8 | +- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License | ||
9 | +- kossnocorp Sasha Koss XXX TODO License or CLA | ||
10 | +- bryanforbes Bryan Forbes XXX TODO License or CLA | ||
11 | +- killdream Quildreen Motta Copyright (C) 2011 MIT Licence | ||
12 | +- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD | ||
13 | + License | ||
14 | +- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License | ||
15 | +- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain) | ||
16 | +- iwyg XXX TODO License or CLA | ||
17 | +- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License | ||
18 | +- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License | ||
19 | +- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence | ||
20 | +- samsonjs Sami Samhuri Copyright (C) 2010 MIT License | ||
21 | +- rwldrn Rick Waldron Copyright (C) 2011 MIT License | ||
22 | +- lexer Alexey Zakharov XXX TODO License or CLA | ||
23 | +- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.) | ||
24 | + Copyright (C) 2009 MIT License | ||
25 | +- Steven Levithan Copyright (C) 2012 MIT License | ||
26 | +- Jordan Harband (C) 2013 MIT License | ||
27 | + |
1 | -The MIT License (MIT) | ||
2 | - | ||
3 | -Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors | ||
4 | - | ||
5 | -Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | -of this software and associated documentation files (the "Software"), to deal | ||
7 | -in the Software without restriction, including without limitation the rights | ||
8 | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | -copies of the Software, and to permit persons to whom the Software is | ||
10 | -furnished to do so, subject to the following conditions: | ||
11 | - | ||
12 | -The above copyright notice and this permission notice shall be included in | ||
13 | -all copies or substantial portions of the Software. | ||
14 | - | ||
15 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
21 | -THE SOFTWARE. | ||
22 | - | 1 | +The MIT License (MIT) |
2 | + | ||
3 | +Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors | ||
4 | + | ||
5 | +Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | +of this software and associated documentation files (the "Software"), to deal | ||
7 | +in the Software without restriction, including without limitation the rights | ||
8 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | +copies of the Software, and to permit persons to whom the Software is | ||
10 | +furnished to do so, subject to the following conditions: | ||
11 | + | ||
12 | +The above copyright notice and this permission notice shall be included in | ||
13 | +all copies or substantial portions of the Software. | ||
14 | + | ||
15 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
21 | +THE SOFTWARE. | ||
22 | + |
1 | -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. | ||
2 | -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) | ||
3 | - | ||
4 | - # The files that need updating when incrementing the version number. | ||
5 | -VERSIONED_FILES := *.js *.json *.map README* | ||
6 | - | ||
7 | - | ||
8 | -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. | ||
9 | -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment | ||
10 | -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. | ||
11 | -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") | ||
12 | -UTILS := semver | ||
13 | -# Make sure that all required utilities can be located. | ||
14 | -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))) | ||
15 | - | ||
16 | -# Default target (by virtue of being the first non '.'-prefixed in the file). | ||
17 | -.PHONY: _no-target-specified | ||
18 | -_no-target-specified: | ||
19 | - $(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) | ||
20 | - | ||
21 | -# Lists all targets defined in this makefile. | ||
22 | -.PHONY: list | ||
23 | -list: | ||
24 | - @$(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 | ||
25 | - | ||
26 | -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). | ||
27 | -.PHONY: test | ||
28 | -test: | ||
29 | - @npm test | ||
30 | - | ||
31 | -.PHONY: _ensure-tag | ||
32 | -_ensure-tag: | ||
33 | -ifndef TAG | ||
34 | - $(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) | ||
35 | -endif | ||
36 | - | ||
37 | -CHANGELOG_ERROR = $(error No CHANGES specified) | ||
38 | -.PHONY: _ensure-changelog | ||
39 | -_ensure-changelog: | ||
40 | - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2) | ||
41 | - | ||
42 | -# Ensures that the git workspace is clean. | ||
43 | -.PHONY: _ensure-clean | ||
44 | -_ensure-clean: | ||
45 | - @[ -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; } | ||
46 | - | ||
47 | -# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`. | ||
48 | -.PHONY: release | ||
49 | -release: _ensure-tag _ensure-changelog _ensure-clean | ||
50 | - @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}; \ | ||
51 | - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ | ||
52 | - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ | ||
53 | - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ | ||
54 | - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ | ||
55 | - else \ | ||
56 | - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ | ||
57 | - fi; \ | ||
58 | - 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; }; \ | ||
59 | - npm run minify; \ | ||
60 | - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ | ||
61 | - replace "blob/master" "blob/v$$new_ver" -- *.min.js && \ | ||
62 | - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \ | ||
63 | - git tag -a -m "v$$new_ver" "v$$new_ver" | 1 | +# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. |
2 | +$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) | ||
3 | + | ||
4 | + # The files that need updating when incrementing the version number. | ||
5 | +VERSIONED_FILES := *.js *.json *.map README* | ||
6 | + | ||
7 | + | ||
8 | +# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. | ||
9 | +# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment | ||
10 | +# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. | ||
11 | +export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") | ||
12 | +UTILS := semver | ||
13 | +# Make sure that all required utilities can be located. | ||
14 | +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))) | ||
15 | + | ||
16 | +# Default target (by virtue of being the first non '.'-prefixed in the file). | ||
17 | +.PHONY: _no-target-specified | ||
18 | +_no-target-specified: | ||
19 | + $(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) | ||
20 | + | ||
21 | +# Lists all targets defined in this makefile. | ||
22 | +.PHONY: list | ||
23 | +list: | ||
24 | + @$(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 | ||
25 | + | ||
26 | +# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). | ||
27 | +.PHONY: test | ||
28 | +test: | ||
29 | + @npm test | ||
30 | + | ||
31 | +.PHONY: _ensure-tag | ||
32 | +_ensure-tag: | ||
33 | +ifndef TAG | ||
34 | + $(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) | ||
35 | +endif | ||
36 | + | ||
37 | +CHANGELOG_ERROR = $(error No CHANGES specified) | ||
38 | +.PHONY: _ensure-changelog | ||
39 | +_ensure-changelog: | ||
40 | + @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2) | ||
41 | + | ||
42 | +# Ensures that the git workspace is clean. | ||
43 | +.PHONY: _ensure-clean | ||
44 | +_ensure-clean: | ||
45 | + @[ -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; } | ||
46 | + | ||
47 | +# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`. | ||
48 | +.PHONY: release | ||
49 | +release: _ensure-tag _ensure-changelog _ensure-clean | ||
50 | + @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}; \ | ||
51 | + new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ | ||
52 | + if printf "$$new_ver" | command grep -q '^[0-9]'; then \ | ||
53 | + semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ | ||
54 | + semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ | ||
55 | + else \ | ||
56 | + new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ | ||
57 | + fi; \ | ||
58 | + 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; }; \ | ||
59 | + npm run minify; \ | ||
60 | + replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ | ||
61 | + replace "blob/master" "blob/v$$new_ver" -- *.min.js && \ | ||
62 | + git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \ | ||
63 | + git tag -a -m "v$$new_ver" "v$$new_ver" |
1 | -#es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup> | ||
2 | - | ||
3 | -[![npm badge][npm-badge-png]][npm-url] | ||
4 | - | ||
5 | -[![Build Status][travis-svg]][travis-url] | ||
6 | -[![dependency status][deps-svg]][deps-url] | ||
7 | -[![dev dependency status][dev-deps-svg]][dev-deps-url] | ||
8 | - | ||
9 | -`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to | ||
10 | -contain all EcmaScript 5 methods that can be faithfully emulated with a | ||
11 | -legacy JavaScript engine. | ||
12 | -**Note:** As `es5-shim.js` is designed to patch the native Javascript | ||
13 | -engine, it should be the library that is loaded first. | ||
14 | - | ||
15 | -`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as | ||
16 | -closely as possible. For these methods, as closely as possible to ES5 | ||
17 | -is not very close. Many of these shams are intended only to allow code | ||
18 | -to be written to ES5 without causing run-time errors in older engines. | ||
19 | -In many cases, this means that these shams cause many ES5 methods to | ||
20 | -silently fail. Decide carefully whether this is what you want. | ||
21 | -**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly. | ||
22 | - | ||
23 | - | ||
24 | -## Tests | ||
25 | - | ||
26 | -The tests are written with the Jasmine BDD test framework. | ||
27 | -To run the tests, navigate to <root-folder>/tests/ , or, | ||
28 | -simply `npm install` and `npm test`. | ||
29 | - | ||
30 | -## Shims | ||
31 | - | ||
32 | -### Complete tests ### | ||
33 | - | ||
34 | -* Array.prototype.every | ||
35 | -* Array.prototype.filter | ||
36 | -* Array.prototype.forEach | ||
37 | -* Array.prototype.indexOf | ||
38 | -* Array.prototype.lastIndexOf | ||
39 | -* Array.prototype.map | ||
40 | -* Array.prototype.slice | ||
41 | -* Array.prototype.some | ||
42 | -* Array.prototype.sort | ||
43 | -* Array.prototype.reduce | ||
44 | -* Array.prototype.reduceRight | ||
45 | -* Array.prototype.push | ||
46 | -* Array.prototype.join | ||
47 | -* Array.isArray | ||
48 | -* Date.now | ||
49 | -* Date.prototype.toJSON | ||
50 | -* Function.prototype.bind | ||
51 | - * :warning: Caveat: the bound function has a prototype property. | ||
52 | - * :warning: Caveat: bound functions do not try too hard to keep you | ||
53 | - from manipulating their ``arguments`` and ``caller`` properties. | ||
54 | - * :warning: Caveat: bound functions don't have checks in ``call`` and | ||
55 | - ``apply`` to avoid executing as a constructor. | ||
56 | -* Number.prototype.toFixed | ||
57 | -* Number.prototype.toPrecision | ||
58 | -* Object.keys | ||
59 | -* String.prototype.split | ||
60 | -* String.prototype.trim | ||
61 | -* String.prototype.lastIndexOf | ||
62 | -* String.prototype.replace | ||
63 | - * Firefox (through v29) natively handles capturing groups incorrectly. | ||
64 | -* Date.parse (for ISO parsing) | ||
65 | -* Date.prototype.toISOString | ||
66 | -* parseInt | ||
67 | -* parseFloat | ||
68 | -* Error.prototype.toString | ||
69 | -* Error.prototype.name | ||
70 | -* Error.prototype.message | ||
71 | -* RegExp.prototype.toString | ||
72 | - | ||
73 | -## Shams | ||
74 | - | ||
75 | -* :warning: Object.create | ||
76 | - | ||
77 | - For the case of simply "begetting" an object that inherits | ||
78 | - prototypically from another, this should work fine across legacy | ||
79 | - engines. | ||
80 | - | ||
81 | - :warning: The second argument is passed to Object.defineProperties | ||
82 | - which will probably fail either silently or with extreme prejudice. | ||
83 | - | ||
84 | -* :warning: Object.getPrototypeOf | ||
85 | - | ||
86 | - This will return "undefined" in some cases. It uses `__proto__` if | ||
87 | - it's available. Failing that, it uses constructor.prototype, which | ||
88 | - depends on the constructor property of the object's prototype having | ||
89 | - not been replaced. If your object was created like this, it won't | ||
90 | - work: | ||
91 | - | ||
92 | - function Foo() { | ||
93 | - } | ||
94 | - Foo.prototype = {}; | ||
95 | - | ||
96 | - Because the prototype reassignment destroys the constructor | ||
97 | - property. | ||
98 | - | ||
99 | - This will work for all objects that were created using | ||
100 | - `Object.create` implemented with this library. | ||
101 | - | ||
102 | -* :warning: Object.getOwnPropertyNames | ||
103 | - | ||
104 | - This method uses Object.keys, so it will not be accurate on legacy | ||
105 | - engines. | ||
106 | - | ||
107 | -* Object.isSealed | ||
108 | - | ||
109 | - Returns "false" in all legacy engines for all objects, which is | ||
110 | - conveniently guaranteed to be accurate. | ||
111 | - | ||
112 | -* Object.isFrozen | ||
113 | - | ||
114 | - Returns "false" in all legacy engines for all objects, which is | ||
115 | - conveniently guaranteed to be accurate. | ||
116 | - | ||
117 | -* Object.isExtensible | ||
118 | - | ||
119 | - Works like a charm, by trying very hard to extend the object then | ||
120 | - redacting the extension. | ||
121 | - | ||
122 | -### May fail | ||
123 | - | ||
124 | -* :warning: Object.getOwnPropertyDescriptor | ||
125 | - | ||
126 | - The behavior of this shim does not conform to ES5. It should | ||
127 | - probably not be used at this time, until its behavior has been | ||
128 | - reviewed and been confirmed to be useful in legacy engines. | ||
129 | - | ||
130 | -* :warning: Object.defineProperty | ||
131 | - | ||
132 | - In the worst of circumstances, IE 8 provides a version of this | ||
133 | - method that only works on DOM objects. This sham will not be | ||
134 | - installed. The given version of `defineProperty` will throw an | ||
135 | - exception if used on non-DOM objects. | ||
136 | - | ||
137 | - In slightly better circumstances, this method will silently fail to | ||
138 | - set "writable", "enumerable", and "configurable" properties. | ||
139 | - | ||
140 | - Providing a getter or setter with "get" or "set" on a descriptor | ||
141 | - will silently fail on engines that lack "__defineGetter__" and | ||
142 | - "__defineSetter__", which include all versions of IE. | ||
143 | - | ||
144 | - https://github.com/es-shims/es5-shim/issues#issue/5 | ||
145 | - | ||
146 | -* :warning: Object.defineProperties | ||
147 | - | ||
148 | - This uses the Object.defineProperty shim. | ||
149 | - | ||
150 | -* Object.seal | ||
151 | - | ||
152 | - Silently fails on all legacy engines. This should be | ||
153 | - fine unless you are depending on the safety and security | ||
154 | - provisions of this method, which you cannot possibly | ||
155 | - obtain in legacy engines. | ||
156 | - | ||
157 | -* Object.freeze | ||
158 | - | ||
159 | - Silently fails on all legacy engines. This should be | ||
160 | - fine unless you are depending on the safety and security | ||
161 | - provisions of this method, which you cannot possibly | ||
162 | - obtain in legacy engines. | ||
163 | - | ||
164 | -* Object.preventExtensions | ||
165 | - | ||
166 | - Silently fails on all legacy engines. This should be | ||
167 | - fine unless you are depending on the safety and security | ||
168 | - provisions of this method, which you cannot possibly | ||
169 | - obtain in legacy engines. | ||
170 | - | ||
171 | -### Example of applying ES compatability shims in a browser project | ||
172 | - | ||
173 | -```html | ||
174 | -<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script> | ||
175 | -<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script> | ||
176 | -<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
177 | -<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script> | ||
178 | -<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script> | ||
179 | -<script src="https://wzrd.in/standalone/es7-shim@latest"></script> | ||
180 | -<script src="other-libs.js"></script> | ||
181 | -``` | ||
182 | -[npm-url]: https://npmjs.org/package/es5-shim | ||
183 | -[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg | ||
184 | -[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg | ||
185 | -[travis-url]: https://travis-ci.org/es-shims/es5-shim | ||
186 | -[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg | ||
187 | -[deps-url]: https://david-dm.org/es-shims/es5-shim | ||
188 | -[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg | ||
189 | -[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies | ||
190 | -[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true | 1 | +#es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup> |
2 | + | ||
3 | +[![npm badge][npm-badge-png]][npm-url] | ||
4 | + | ||
5 | +[![Build Status][travis-svg]][travis-url] | ||
6 | +[![dependency status][deps-svg]][deps-url] | ||
7 | +[![dev dependency status][dev-deps-svg]][dev-deps-url] | ||
8 | + | ||
9 | +`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to | ||
10 | +contain all EcmaScript 5 methods that can be faithfully emulated with a | ||
11 | +legacy JavaScript engine. | ||
12 | +**Note:** As `es5-shim.js` is designed to patch the native Javascript | ||
13 | +engine, it should be the library that is loaded first. | ||
14 | + | ||
15 | +`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as | ||
16 | +closely as possible. For these methods, as closely as possible to ES5 | ||
17 | +is not very close. Many of these shams are intended only to allow code | ||
18 | +to be written to ES5 without causing run-time errors in older engines. | ||
19 | +In many cases, this means that these shams cause many ES5 methods to | ||
20 | +silently fail. Decide carefully whether this is what you want. | ||
21 | +**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly. | ||
22 | + | ||
23 | + | ||
24 | +## Tests | ||
25 | + | ||
26 | +The tests are written with the Jasmine BDD test framework. | ||
27 | +To run the tests, navigate to <root-folder>/tests/ , or, | ||
28 | +simply `npm install` and `npm test`. | ||
29 | + | ||
30 | +## Shims | ||
31 | + | ||
32 | +### Complete tests ### | ||
33 | + | ||
34 | +* Array.prototype.every | ||
35 | +* Array.prototype.filter | ||
36 | +* Array.prototype.forEach | ||
37 | +* Array.prototype.indexOf | ||
38 | +* Array.prototype.lastIndexOf | ||
39 | +* Array.prototype.map | ||
40 | +* Array.prototype.slice | ||
41 | +* Array.prototype.some | ||
42 | +* Array.prototype.sort | ||
43 | +* Array.prototype.reduce | ||
44 | +* Array.prototype.reduceRight | ||
45 | +* Array.prototype.push | ||
46 | +* Array.prototype.join | ||
47 | +* Array.isArray | ||
48 | +* Date.now | ||
49 | +* Date.prototype.toJSON | ||
50 | +* Function.prototype.bind | ||
51 | + * :warning: Caveat: the bound function has a prototype property. | ||
52 | + * :warning: Caveat: bound functions do not try too hard to keep you | ||
53 | + from manipulating their ``arguments`` and ``caller`` properties. | ||
54 | + * :warning: Caveat: bound functions don't have checks in ``call`` and | ||
55 | + ``apply`` to avoid executing as a constructor. | ||
56 | +* Number.prototype.toFixed | ||
57 | +* Number.prototype.toPrecision | ||
58 | +* Object.keys | ||
59 | +* String.prototype.split | ||
60 | +* String.prototype.trim | ||
61 | +* String.prototype.lastIndexOf | ||
62 | +* String.prototype.replace | ||
63 | + * Firefox (through v29) natively handles capturing groups incorrectly. | ||
64 | +* Date.parse (for ISO parsing) | ||
65 | +* Date.prototype.toISOString | ||
66 | +* parseInt | ||
67 | +* parseFloat | ||
68 | +* Error.prototype.toString | ||
69 | +* Error.prototype.name | ||
70 | +* Error.prototype.message | ||
71 | +* RegExp.prototype.toString | ||
72 | + | ||
73 | +## Shams | ||
74 | + | ||
75 | +* :warning: Object.create | ||
76 | + | ||
77 | + For the case of simply "begetting" an object that inherits | ||
78 | + prototypically from another, this should work fine across legacy | ||
79 | + engines. | ||
80 | + | ||
81 | + :warning: The second argument is passed to Object.defineProperties | ||
82 | + which will probably fail either silently or with extreme prejudice. | ||
83 | + | ||
84 | +* :warning: Object.getPrototypeOf | ||
85 | + | ||
86 | + This will return "undefined" in some cases. It uses `__proto__` if | ||
87 | + it's available. Failing that, it uses constructor.prototype, which | ||
88 | + depends on the constructor property of the object's prototype having | ||
89 | + not been replaced. If your object was created like this, it won't | ||
90 | + work: | ||
91 | + | ||
92 | + function Foo() { | ||
93 | + } | ||
94 | + Foo.prototype = {}; | ||
95 | + | ||
96 | + Because the prototype reassignment destroys the constructor | ||
97 | + property. | ||
98 | + | ||
99 | + This will work for all objects that were created using | ||
100 | + `Object.create` implemented with this library. | ||
101 | + | ||
102 | +* :warning: Object.getOwnPropertyNames | ||
103 | + | ||
104 | + This method uses Object.keys, so it will not be accurate on legacy | ||
105 | + engines. | ||
106 | + | ||
107 | +* Object.isSealed | ||
108 | + | ||
109 | + Returns "false" in all legacy engines for all objects, which is | ||
110 | + conveniently guaranteed to be accurate. | ||
111 | + | ||
112 | +* Object.isFrozen | ||
113 | + | ||
114 | + Returns "false" in all legacy engines for all objects, which is | ||
115 | + conveniently guaranteed to be accurate. | ||
116 | + | ||
117 | +* Object.isExtensible | ||
118 | + | ||
119 | + Works like a charm, by trying very hard to extend the object then | ||
120 | + redacting the extension. | ||
121 | + | ||
122 | +### May fail | ||
123 | + | ||
124 | +* :warning: Object.getOwnPropertyDescriptor | ||
125 | + | ||
126 | + The behavior of this shim does not conform to ES5. It should | ||
127 | + probably not be used at this time, until its behavior has been | ||
128 | + reviewed and been confirmed to be useful in legacy engines. | ||
129 | + | ||
130 | +* :warning: Object.defineProperty | ||
131 | + | ||
132 | + In the worst of circumstances, IE 8 provides a version of this | ||
133 | + method that only works on DOM objects. This sham will not be | ||
134 | + installed. The given version of `defineProperty` will throw an | ||
135 | + exception if used on non-DOM objects. | ||
136 | + | ||
137 | + In slightly better circumstances, this method will silently fail to | ||
138 | + set "writable", "enumerable", and "configurable" properties. | ||
139 | + | ||
140 | + Providing a getter or setter with "get" or "set" on a descriptor | ||
141 | + will silently fail on engines that lack "__defineGetter__" and | ||
142 | + "__defineSetter__", which include all versions of IE. | ||
143 | + | ||
144 | + https://github.com/es-shims/es5-shim/issues#issue/5 | ||
145 | + | ||
146 | +* :warning: Object.defineProperties | ||
147 | + | ||
148 | + This uses the Object.defineProperty shim. | ||
149 | + | ||
150 | +* Object.seal | ||
151 | + | ||
152 | + Silently fails on all legacy engines. This should be | ||
153 | + fine unless you are depending on the safety and security | ||
154 | + provisions of this method, which you cannot possibly | ||
155 | + obtain in legacy engines. | ||
156 | + | ||
157 | +* Object.freeze | ||
158 | + | ||
159 | + Silently fails on all legacy engines. This should be | ||
160 | + fine unless you are depending on the safety and security | ||
161 | + provisions of this method, which you cannot possibly | ||
162 | + obtain in legacy engines. | ||
163 | + | ||
164 | +* Object.preventExtensions | ||
165 | + | ||
166 | + Silently fails on all legacy engines. This should be | ||
167 | + fine unless you are depending on the safety and security | ||
168 | + provisions of this method, which you cannot possibly | ||
169 | + obtain in legacy engines. | ||
170 | + | ||
171 | +### Example of applying ES compatability shims in a browser project | ||
172 | + | ||
173 | +```html | ||
174 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script> | ||
175 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script> | ||
176 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
177 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script> | ||
178 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script> | ||
179 | +<script src="https://wzrd.in/standalone/es7-shim@latest"></script> | ||
180 | +<script src="other-libs.js"></script> | ||
181 | +``` | ||
182 | +[npm-url]: https://npmjs.org/package/es5-shim | ||
183 | +[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg | ||
184 | +[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg | ||
185 | +[travis-url]: https://travis-ci.org/es-shims/es5-shim | ||
186 | +[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg | ||
187 | +[deps-url]: https://david-dm.org/es-shims/es5-shim | ||
188 | +[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg | ||
189 | +[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies | ||
190 | +[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true |
1 | -{ | ||
2 | - "name": "es5-shim", | ||
3 | - "main": "es5-shim.js", | ||
4 | - "repository": { | ||
5 | - "type": "git", | ||
6 | - "url": "git://github.com/es-shims/es5-shim" | ||
7 | - }, | ||
8 | - "homepage": "https://github.com/es-shims/es5-shim", | ||
9 | - "authors": [ | ||
10 | - "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)", | ||
11 | - "Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)", | ||
12 | - "Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)", | ||
13 | - "Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)", | ||
14 | - "Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)", | ||
15 | - "Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)" | ||
16 | - ], | ||
17 | - "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
18 | - "keywords": [ | ||
19 | - "shim", | ||
20 | - "es5", | ||
21 | - "es5 shim", | ||
22 | - "javascript", | ||
23 | - "ecmascript", | ||
24 | - "polyfill" | ||
25 | - ], | ||
26 | - "license": "MIT", | ||
27 | - "ignore": [ | ||
28 | - "**/.*", | ||
29 | - "node_modules", | ||
30 | - "bower_components", | ||
31 | - "tests" | ||
32 | - ] | ||
33 | -} | 1 | +{ |
2 | + "name": "es5-shim", | ||
3 | + "main": "es5-shim.js", | ||
4 | + "repository": { | ||
5 | + "type": "git", | ||
6 | + "url": "git://github.com/es-shims/es5-shim" | ||
7 | + }, | ||
8 | + "homepage": "https://github.com/es-shims/es5-shim", | ||
9 | + "authors": [ | ||
10 | + "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)", | ||
11 | + "Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)", | ||
12 | + "Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)", | ||
13 | + "Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)", | ||
14 | + "Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)", | ||
15 | + "Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)" | ||
16 | + ], | ||
17 | + "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
18 | + "keywords": [ | ||
19 | + "shim", | ||
20 | + "es5", | ||
21 | + "es5 shim", | ||
22 | + "javascript", | ||
23 | + "ecmascript", | ||
24 | + "polyfill" | ||
25 | + ], | ||
26 | + "license": "MIT", | ||
27 | + "ignore": [ | ||
28 | + "**/.*", | ||
29 | + "node_modules", | ||
30 | + "bower_components", | ||
31 | + "tests" | ||
32 | + ] | ||
33 | +} |
1 | -{ | ||
2 | - "name": "es5-shim", | ||
3 | - "repo": "es-shims/es5-shim", | ||
4 | - "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
5 | - "version": "v4.5.1", | ||
6 | - "keywords": [ | ||
7 | - "shim", | ||
8 | - "es5", | ||
9 | - "es5 shim", | ||
10 | - "javascript", | ||
11 | - "ecmascript", | ||
12 | - "polyfill" | ||
13 | - ], | ||
14 | - "license": "MIT", | ||
15 | - "main": "es5-shim.js", | ||
16 | - "scripts": [ | ||
17 | - "es5-shim.js" | ||
18 | - ] | ||
19 | -} | 1 | +{ |
2 | + "name": "es5-shim", | ||
3 | + "repo": "es-shims/es5-shim", | ||
4 | + "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
5 | + "version": "v4.5.1", | ||
6 | + "keywords": [ | ||
7 | + "shim", | ||
8 | + "es5", | ||
9 | + "es5 shim", | ||
10 | + "javascript", | ||
11 | + "ecmascript", | ||
12 | + "polyfill" | ||
13 | + ], | ||
14 | + "license": "MIT", | ||
15 | + "main": "es5-shim.js", | ||
16 | + "scripts": [ | ||
17 | + "es5-shim.js" | ||
18 | + ] | ||
19 | +} |
1 | -/*! | ||
2 | - * https://github.com/es-shims/es5-shim | ||
3 | - * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | - * see https://github.com/es-shims/es5-shim/blob/master/LICENSE | ||
5 | - */ | ||
6 | - | ||
7 | -// vim: ts=4 sts=4 sw=4 expandtab | ||
8 | - | ||
9 | -// Add semicolon to prevent IIFE from being passed as argument to concatenated code. | ||
10 | -; | ||
11 | - | ||
12 | -// UMD (Universal Module Definition) | ||
13 | -// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js | ||
14 | -(function (root, factory) { | ||
15 | - 'use strict'; | ||
16 | - | ||
17 | - /* global define, exports, module */ | ||
18 | - if (typeof define === 'function' && define.amd) { | ||
19 | - // AMD. Register as an anonymous module. | ||
20 | - define(factory); | ||
21 | - } else if (typeof exports === 'object') { | ||
22 | - // Node. Does not work with strict CommonJS, but | ||
23 | - // only CommonJS-like enviroments that support module.exports, | ||
24 | - // like Node. | ||
25 | - module.exports = factory(); | ||
26 | - } else { | ||
27 | - // Browser globals (root is window) | ||
28 | - root.returnExports = factory(); | ||
29 | - } | ||
30 | -}(this, function () { | ||
31 | - | ||
32 | -var call = Function.call; | ||
33 | -var prototypeOfObject = Object.prototype; | ||
34 | -var owns = call.bind(prototypeOfObject.hasOwnProperty); | ||
35 | -var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); | ||
36 | -var toStr = call.bind(prototypeOfObject.toString); | ||
37 | - | ||
38 | -// If JS engine supports accessors creating shortcuts. | ||
39 | -var defineGetter; | ||
40 | -var defineSetter; | ||
41 | -var lookupGetter; | ||
42 | -var lookupSetter; | ||
43 | -var supportsAccessors = owns(prototypeOfObject, '__defineGetter__'); | ||
44 | -if (supportsAccessors) { | ||
45 | - /* eslint-disable no-underscore-dangle */ | ||
46 | - defineGetter = call.bind(prototypeOfObject.__defineGetter__); | ||
47 | - defineSetter = call.bind(prototypeOfObject.__defineSetter__); | ||
48 | - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); | ||
49 | - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); | ||
50 | - /* eslint-enable no-underscore-dangle */ | ||
51 | -} | ||
52 | - | ||
53 | -// ES5 15.2.3.2 | ||
54 | -// http://es5.github.com/#x15.2.3.2 | ||
55 | -if (!Object.getPrototypeOf) { | ||
56 | - // https://github.com/es-shims/es5-shim/issues#issue/2 | ||
57 | - // http://ejohn.org/blog/objectgetprototypeof/ | ||
58 | - // recommended by fschaefer on github | ||
59 | - // | ||
60 | - // sure, and webreflection says ^_^ | ||
61 | - // ... this will nerever possibly return null | ||
62 | - // ... Opera Mini breaks here with infinite loops | ||
63 | - Object.getPrototypeOf = function getPrototypeOf(object) { | ||
64 | - /* eslint-disable no-proto */ | ||
65 | - var proto = object.__proto__; | ||
66 | - /* eslint-enable no-proto */ | ||
67 | - if (proto || proto === null) { | ||
68 | - return proto; | ||
69 | - } else if (toStr(object.constructor) === '[object Function]') { | ||
70 | - return object.constructor.prototype; | ||
71 | - } else if (object instanceof Object) { | ||
72 | - return prototypeOfObject; | ||
73 | - } else { | ||
74 | - // Correctly return null for Objects created with `Object.create(null)` | ||
75 | - // (shammed or native) or `{ __proto__: null}`. Also returns null for | ||
76 | - // cross-realm objects on browsers that lack `__proto__` support (like | ||
77 | - // IE <11), but that's the best we can do. | ||
78 | - return null; | ||
79 | - } | ||
80 | - }; | ||
81 | -} | ||
82 | - | ||
83 | -// ES5 15.2.3.3 | ||
84 | -// http://es5.github.com/#x15.2.3.3 | ||
85 | - | ||
86 | -var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) { | ||
87 | - try { | ||
88 | - object.sentinel = 0; | ||
89 | - return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0; | ||
90 | - } catch (exception) { | ||
91 | - return false; | ||
92 | - } | ||
93 | -}; | ||
94 | - | ||
95 | -// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially. | ||
96 | -if (Object.defineProperty) { | ||
97 | - var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({}); | ||
98 | - var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' || | ||
99 | - doesGetOwnPropertyDescriptorWork(document.createElement('div')); | ||
100 | - if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) { | ||
101 | - var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor; | ||
102 | - } | ||
103 | -} | ||
104 | - | ||
105 | -if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) { | ||
106 | - var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: '; | ||
107 | - | ||
108 | - /* eslint-disable no-proto */ | ||
109 | - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { | ||
110 | - if ((typeof object !== 'object' && typeof object !== 'function') || object === null) { | ||
111 | - throw new TypeError(ERR_NON_OBJECT + object); | ||
112 | - } | ||
113 | - | ||
114 | - // make a valiant attempt to use the real getOwnPropertyDescriptor | ||
115 | - // for I8's DOM elements. | ||
116 | - if (getOwnPropertyDescriptorFallback) { | ||
117 | - try { | ||
118 | - return getOwnPropertyDescriptorFallback.call(Object, object, property); | ||
119 | - } catch (exception) { | ||
120 | - // try the shim if the real one doesn't work | ||
121 | - } | ||
122 | - } | ||
123 | - | ||
124 | - var descriptor; | ||
125 | - | ||
126 | - // If object does not owns property return undefined immediately. | ||
127 | - if (!owns(object, property)) { | ||
128 | - return descriptor; | ||
129 | - } | ||
130 | - | ||
131 | - // If object has a property then it's for sure `configurable`, and | ||
132 | - // probably `enumerable`. Detect enumerability though. | ||
133 | - descriptor = { | ||
134 | - enumerable: isEnumerable(object, property), | ||
135 | - configurable: true | ||
136 | - }; | ||
137 | - | ||
138 | - // If JS engine supports accessor properties then property may be a | ||
139 | - // getter or setter. | ||
140 | - if (supportsAccessors) { | ||
141 | - // Unfortunately `__lookupGetter__` will return a getter even | ||
142 | - // if object has own non getter property along with a same named | ||
143 | - // inherited getter. To avoid misbehavior we temporary remove | ||
144 | - // `__proto__` so that `__lookupGetter__` will return getter only | ||
145 | - // if it's owned by an object. | ||
146 | - var prototype = object.__proto__; | ||
147 | - var notPrototypeOfObject = object !== prototypeOfObject; | ||
148 | - // avoid recursion problem, breaking in Opera Mini when | ||
149 | - // Object.getOwnPropertyDescriptor(Object.prototype, 'toString') | ||
150 | - // or any other Object.prototype accessor | ||
151 | - if (notPrototypeOfObject) { | ||
152 | - object.__proto__ = prototypeOfObject; | ||
153 | - } | ||
154 | - | ||
155 | - var getter = lookupGetter(object, property); | ||
156 | - var setter = lookupSetter(object, property); | ||
157 | - | ||
158 | - if (notPrototypeOfObject) { | ||
159 | - // Once we have getter and setter we can put values back. | ||
160 | - object.__proto__ = prototype; | ||
161 | - } | ||
162 | - | ||
163 | - if (getter || setter) { | ||
164 | - if (getter) { | ||
165 | - descriptor.get = getter; | ||
166 | - } | ||
167 | - if (setter) { | ||
168 | - descriptor.set = setter; | ||
169 | - } | ||
170 | - // If it was accessor property we're done and return here | ||
171 | - // in order to avoid adding `value` to the descriptor. | ||
172 | - return descriptor; | ||
173 | - } | ||
174 | - } | ||
175 | - | ||
176 | - // If we got this far we know that object has an own property that is | ||
177 | - // not an accessor so we set it as a value and return descriptor. | ||
178 | - descriptor.value = object[property]; | ||
179 | - descriptor.writable = true; | ||
180 | - return descriptor; | ||
181 | - }; | ||
182 | - /* eslint-enable no-proto */ | ||
183 | -} | ||
184 | - | ||
185 | -// ES5 15.2.3.4 | ||
186 | -// http://es5.github.com/#x15.2.3.4 | ||
187 | -if (!Object.getOwnPropertyNames) { | ||
188 | - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { | ||
189 | - return Object.keys(object); | ||
190 | - }; | ||
191 | -} | ||
192 | - | ||
193 | -// ES5 15.2.3.5 | ||
194 | -// http://es5.github.com/#x15.2.3.5 | ||
195 | -if (!Object.create) { | ||
196 | - | ||
197 | - // Contributed by Brandon Benvie, October, 2012 | ||
198 | - var createEmpty; | ||
199 | - var supportsProto = !({ __proto__: null } instanceof Object); | ||
200 | - // the following produces false positives | ||
201 | - // in Opera Mini => not a reliable check | ||
202 | - // Object.prototype.__proto__ === null | ||
203 | - | ||
204 | - // Check for document.domain and active x support | ||
205 | - // No need to use active x approach when document.domain is not set | ||
206 | - // see https://github.com/es-shims/es5-shim/issues/150 | ||
207 | - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 | ||
208 | - /* global ActiveXObject */ | ||
209 | - var shouldUseActiveX = function shouldUseActiveX() { | ||
210 | - // return early if document.domain not set | ||
211 | - if (!document.domain) { | ||
212 | - return false; | ||
213 | - } | ||
214 | - | ||
215 | - try { | ||
216 | - return !!new ActiveXObject('htmlfile'); | ||
217 | - } catch (exception) { | ||
218 | - return false; | ||
219 | - } | ||
220 | - }; | ||
221 | - | ||
222 | - // This supports IE8 when document.domain is used | ||
223 | - // see https://github.com/es-shims/es5-shim/issues/150 | ||
224 | - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 | ||
225 | - var getEmptyViaActiveX = function getEmptyViaActiveX() { | ||
226 | - var empty; | ||
227 | - var xDoc; | ||
228 | - | ||
229 | - xDoc = new ActiveXObject('htmlfile'); | ||
230 | - | ||
231 | - var script = 'script'; | ||
232 | - xDoc.write('<' + script + '></' + script + '>'); | ||
233 | - xDoc.close(); | ||
234 | - | ||
235 | - empty = xDoc.parentWindow.Object.prototype; | ||
236 | - xDoc = null; | ||
237 | - | ||
238 | - return empty; | ||
239 | - }; | ||
240 | - | ||
241 | - // The original implementation using an iframe | ||
242 | - // before the activex approach was added | ||
243 | - // see https://github.com/es-shims/es5-shim/issues/150 | ||
244 | - var getEmptyViaIFrame = function getEmptyViaIFrame() { | ||
245 | - var iframe = document.createElement('iframe'); | ||
246 | - var parent = document.body || document.documentElement; | ||
247 | - var empty; | ||
248 | - | ||
249 | - iframe.style.display = 'none'; | ||
250 | - parent.appendChild(iframe); | ||
251 | - /* eslint-disable no-script-url */ | ||
252 | - iframe.src = 'javascript:'; | ||
253 | - /* eslint-enable no-script-url */ | ||
254 | - | ||
255 | - empty = iframe.contentWindow.Object.prototype; | ||
256 | - parent.removeChild(iframe); | ||
257 | - iframe = null; | ||
258 | - | ||
259 | - return empty; | ||
260 | - }; | ||
261 | - | ||
262 | - /* global document */ | ||
263 | - if (supportsProto || typeof document === 'undefined') { | ||
264 | - createEmpty = function () { | ||
265 | - return { __proto__: null }; | ||
266 | - }; | ||
267 | - } else { | ||
268 | - // In old IE __proto__ can't be used to manually set `null`, nor does | ||
269 | - // any other method exist to make an object that inherits from nothing, | ||
270 | - // aside from Object.prototype itself. Instead, create a new global | ||
271 | - // object and *steal* its Object.prototype and strip it bare. This is | ||
272 | - // used as the prototype to create nullary objects. | ||
273 | - createEmpty = function () { | ||
274 | - // Determine which approach to use | ||
275 | - // see https://github.com/es-shims/es5-shim/issues/150 | ||
276 | - var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame(); | ||
277 | - | ||
278 | - delete empty.constructor; | ||
279 | - delete empty.hasOwnProperty; | ||
280 | - delete empty.propertyIsEnumerable; | ||
281 | - delete empty.isPrototypeOf; | ||
282 | - delete empty.toLocaleString; | ||
283 | - delete empty.toString; | ||
284 | - delete empty.valueOf; | ||
285 | - | ||
286 | - var Empty = function Empty() {}; | ||
287 | - Empty.prototype = empty; | ||
288 | - // short-circuit future calls | ||
289 | - createEmpty = function () { | ||
290 | - return new Empty(); | ||
291 | - }; | ||
292 | - return new Empty(); | ||
293 | - }; | ||
294 | - } | ||
295 | - | ||
296 | - Object.create = function create(prototype, properties) { | ||
297 | - | ||
298 | - var object; | ||
299 | - var Type = function Type() {}; // An empty constructor. | ||
300 | - | ||
301 | - if (prototype === null) { | ||
302 | - object = createEmpty(); | ||
303 | - } else { | ||
304 | - if (typeof prototype !== 'object' && typeof prototype !== 'function') { | ||
305 | - // In the native implementation `parent` can be `null` | ||
306 | - // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) | ||
307 | - // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` | ||
308 | - // like they are in modern browsers. Using `Object.create` on DOM elements | ||
309 | - // is...err...probably inappropriate, but the native version allows for it. | ||
310 | - throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome | ||
311 | - } | ||
312 | - Type.prototype = prototype; | ||
313 | - object = new Type(); | ||
314 | - // IE has no built-in implementation of `Object.getPrototypeOf` | ||
315 | - // neither `__proto__`, but this manually setting `__proto__` will | ||
316 | - // guarantee that `Object.getPrototypeOf` will work as expected with | ||
317 | - // objects created using `Object.create` | ||
318 | - /* eslint-disable no-proto */ | ||
319 | - object.__proto__ = prototype; | ||
320 | - /* eslint-enable no-proto */ | ||
321 | - } | ||
322 | - | ||
323 | - if (properties !== void 0) { | ||
324 | - Object.defineProperties(object, properties); | ||
325 | - } | ||
326 | - | ||
327 | - return object; | ||
328 | - }; | ||
329 | -} | ||
330 | - | ||
331 | -// ES5 15.2.3.6 | ||
332 | -// http://es5.github.com/#x15.2.3.6 | ||
333 | - | ||
334 | -// Patch for WebKit and IE8 standard mode | ||
335 | -// Designed by hax <hax.github.com> | ||
336 | -// related issue: https://github.com/es-shims/es5-shim/issues#issue/5 | ||
337 | -// IE8 Reference: | ||
338 | -// http://msdn.microsoft.com/en-us/library/dd282900.aspx | ||
339 | -// http://msdn.microsoft.com/en-us/library/dd229916.aspx | ||
340 | -// WebKit Bugs: | ||
341 | -// https://bugs.webkit.org/show_bug.cgi?id=36423 | ||
342 | - | ||
343 | -var doesDefinePropertyWork = function doesDefinePropertyWork(object) { | ||
344 | - try { | ||
345 | - Object.defineProperty(object, 'sentinel', {}); | ||
346 | - return 'sentinel' in object; | ||
347 | - } catch (exception) { | ||
348 | - return false; | ||
349 | - } | ||
350 | -}; | ||
351 | - | ||
352 | -// check whether defineProperty works if it's given. Otherwise, | ||
353 | -// shim partially. | ||
354 | -if (Object.defineProperty) { | ||
355 | - var definePropertyWorksOnObject = doesDefinePropertyWork({}); | ||
356 | - var definePropertyWorksOnDom = typeof document === 'undefined' || | ||
357 | - doesDefinePropertyWork(document.createElement('div')); | ||
358 | - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { | ||
359 | - var definePropertyFallback = Object.defineProperty, | ||
360 | - definePropertiesFallback = Object.defineProperties; | ||
361 | - } | ||
362 | -} | ||
363 | - | ||
364 | -if (!Object.defineProperty || definePropertyFallback) { | ||
365 | - var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: '; | ||
366 | - var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: '; | ||
367 | - var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine'; | ||
368 | - | ||
369 | - Object.defineProperty = function defineProperty(object, property, descriptor) { | ||
370 | - if ((typeof object !== 'object' && typeof object !== 'function') || object === null) { | ||
371 | - throw new TypeError(ERR_NON_OBJECT_TARGET + object); | ||
372 | - } | ||
373 | - if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) { | ||
374 | - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); | ||
375 | - } | ||
376 | - // make a valiant attempt to use the real defineProperty | ||
377 | - // for I8's DOM elements. | ||
378 | - if (definePropertyFallback) { | ||
379 | - try { | ||
380 | - return definePropertyFallback.call(Object, object, property, descriptor); | ||
381 | - } catch (exception) { | ||
382 | - // try the shim if the real one doesn't work | ||
383 | - } | ||
384 | - } | ||
385 | - | ||
386 | - // If it's a data property. | ||
387 | - if ('value' in descriptor) { | ||
388 | - // fail silently if 'writable', 'enumerable', or 'configurable' | ||
389 | - // are requested but not supported | ||
390 | - /* | ||
391 | - // alternate approach: | ||
392 | - if ( // can't implement these features; allow false but not true | ||
393 | - ('writable' in descriptor && !descriptor.writable) || | ||
394 | - ('enumerable' in descriptor && !descriptor.enumerable) || | ||
395 | - ('configurable' in descriptor && !descriptor.configurable) | ||
396 | - )) | ||
397 | - throw new RangeError( | ||
398 | - 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' | ||
399 | - ); | ||
400 | - */ | ||
401 | - | ||
402 | - if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { | ||
403 | - // As accessors are supported only on engines implementing | ||
404 | - // `__proto__` we can safely override `__proto__` while defining | ||
405 | - // a property to make sure that we don't hit an inherited | ||
406 | - // accessor. | ||
407 | - /* eslint-disable no-proto */ | ||
408 | - var prototype = object.__proto__; | ||
409 | - object.__proto__ = prototypeOfObject; | ||
410 | - // Deleting a property anyway since getter / setter may be | ||
411 | - // defined on object itself. | ||
412 | - delete object[property]; | ||
413 | - object[property] = descriptor.value; | ||
414 | - // Setting original `__proto__` back now. | ||
415 | - object.__proto__ = prototype; | ||
416 | - /* eslint-enable no-proto */ | ||
417 | - } else { | ||
418 | - object[property] = descriptor.value; | ||
419 | - } | ||
420 | - } else { | ||
421 | - if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) { | ||
422 | - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); | ||
423 | - } | ||
424 | - // If we got that far then getters and setters can be defined !! | ||
425 | - if ('get' in descriptor) { | ||
426 | - defineGetter(object, property, descriptor.get); | ||
427 | - } | ||
428 | - if ('set' in descriptor) { | ||
429 | - defineSetter(object, property, descriptor.set); | ||
430 | - } | ||
431 | - } | ||
432 | - return object; | ||
433 | - }; | ||
434 | -} | ||
435 | - | ||
436 | -// ES5 15.2.3.7 | ||
437 | -// http://es5.github.com/#x15.2.3.7 | ||
438 | -if (!Object.defineProperties || definePropertiesFallback) { | ||
439 | - Object.defineProperties = function defineProperties(object, properties) { | ||
440 | - // make a valiant attempt to use the real defineProperties | ||
441 | - if (definePropertiesFallback) { | ||
442 | - try { | ||
443 | - return definePropertiesFallback.call(Object, object, properties); | ||
444 | - } catch (exception) { | ||
445 | - // try the shim if the real one doesn't work | ||
446 | - } | ||
447 | - } | ||
448 | - | ||
449 | - Object.keys(properties).forEach(function (property) { | ||
450 | - if (property !== '__proto__') { | ||
451 | - Object.defineProperty(object, property, properties[property]); | ||
452 | - } | ||
453 | - }); | ||
454 | - return object; | ||
455 | - }; | ||
456 | -} | ||
457 | - | ||
458 | -// ES5 15.2.3.8 | ||
459 | -// http://es5.github.com/#x15.2.3.8 | ||
460 | -if (!Object.seal) { | ||
461 | - Object.seal = function seal(object) { | ||
462 | - if (Object(object) !== object) { | ||
463 | - throw new TypeError('Object.seal can only be called on Objects.'); | ||
464 | - } | ||
465 | - // this is misleading and breaks feature-detection, but | ||
466 | - // allows "securable" code to "gracefully" degrade to working | ||
467 | - // but insecure code. | ||
468 | - return object; | ||
469 | - }; | ||
470 | -} | ||
471 | - | ||
472 | -// ES5 15.2.3.9 | ||
473 | -// http://es5.github.com/#x15.2.3.9 | ||
474 | -if (!Object.freeze) { | ||
475 | - Object.freeze = function freeze(object) { | ||
476 | - if (Object(object) !== object) { | ||
477 | - throw new TypeError('Object.freeze can only be called on Objects.'); | ||
478 | - } | ||
479 | - // this is misleading and breaks feature-detection, but | ||
480 | - // allows "securable" code to "gracefully" degrade to working | ||
481 | - // but insecure code. | ||
482 | - return object; | ||
483 | - }; | ||
484 | -} | ||
485 | - | ||
486 | -// detect a Rhino bug and patch it | ||
487 | -try { | ||
488 | - Object.freeze(function () {}); | ||
489 | -} catch (exception) { | ||
490 | - Object.freeze = (function (freezeObject) { | ||
491 | - return function freeze(object) { | ||
492 | - if (typeof object === 'function') { | ||
493 | - return object; | ||
494 | - } else { | ||
495 | - return freezeObject(object); | ||
496 | - } | ||
497 | - }; | ||
498 | - }(Object.freeze)); | ||
499 | -} | ||
500 | - | ||
501 | -// ES5 15.2.3.10 | ||
502 | -// http://es5.github.com/#x15.2.3.10 | ||
503 | -if (!Object.preventExtensions) { | ||
504 | - Object.preventExtensions = function preventExtensions(object) { | ||
505 | - if (Object(object) !== object) { | ||
506 | - throw new TypeError('Object.preventExtensions can only be called on Objects.'); | ||
507 | - } | ||
508 | - // this is misleading and breaks feature-detection, but | ||
509 | - // allows "securable" code to "gracefully" degrade to working | ||
510 | - // but insecure code. | ||
511 | - return object; | ||
512 | - }; | ||
513 | -} | ||
514 | - | ||
515 | -// ES5 15.2.3.11 | ||
516 | -// http://es5.github.com/#x15.2.3.11 | ||
517 | -if (!Object.isSealed) { | ||
518 | - Object.isSealed = function isSealed(object) { | ||
519 | - if (Object(object) !== object) { | ||
520 | - throw new TypeError('Object.isSealed can only be called on Objects.'); | ||
521 | - } | ||
522 | - return false; | ||
523 | - }; | ||
524 | -} | ||
525 | - | ||
526 | -// ES5 15.2.3.12 | ||
527 | -// http://es5.github.com/#x15.2.3.12 | ||
528 | -if (!Object.isFrozen) { | ||
529 | - Object.isFrozen = function isFrozen(object) { | ||
530 | - if (Object(object) !== object) { | ||
531 | - throw new TypeError('Object.isFrozen can only be called on Objects.'); | ||
532 | - } | ||
533 | - return false; | ||
534 | - }; | ||
535 | -} | ||
536 | - | ||
537 | -// ES5 15.2.3.13 | ||
538 | -// http://es5.github.com/#x15.2.3.13 | ||
539 | -if (!Object.isExtensible) { | ||
540 | - Object.isExtensible = function isExtensible(object) { | ||
541 | - // 1. If Type(O) is not Object throw a TypeError exception. | ||
542 | - if (Object(object) !== object) { | ||
543 | - throw new TypeError('Object.isExtensible can only be called on Objects.'); | ||
544 | - } | ||
545 | - // 2. Return the Boolean value of the [[Extensible]] internal property of O. | ||
546 | - var name = ''; | ||
547 | - while (owns(object, name)) { | ||
548 | - name += '?'; | ||
549 | - } | ||
550 | - object[name] = true; | ||
551 | - var returnValue = owns(object, name); | ||
552 | - delete object[name]; | ||
553 | - return returnValue; | ||
554 | - }; | ||
555 | -} | ||
556 | - | ||
557 | -})); | 1 | +/*! |
2 | + * https://github.com/es-shims/es5-shim | ||
3 | + * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | + * see https://github.com/es-shims/es5-shim/blob/master/LICENSE | ||
5 | + */ | ||
6 | + | ||
7 | +// vim: ts=4 sts=4 sw=4 expandtab | ||
8 | + | ||
9 | +// Add semicolon to prevent IIFE from being passed as argument to concatenated code. | ||
10 | +; | ||
11 | + | ||
12 | +// UMD (Universal Module Definition) | ||
13 | +// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js | ||
14 | +(function (root, factory) { | ||
15 | + 'use strict'; | ||
16 | + | ||
17 | + /* global define, exports, module */ | ||
18 | + if (typeof define === 'function' && define.amd) { | ||
19 | + // AMD. Register as an anonymous module. | ||
20 | + define(factory); | ||
21 | + } else if (typeof exports === 'object') { | ||
22 | + // Node. Does not work with strict CommonJS, but | ||
23 | + // only CommonJS-like enviroments that support module.exports, | ||
24 | + // like Node. | ||
25 | + module.exports = factory(); | ||
26 | + } else { | ||
27 | + // Browser globals (root is window) | ||
28 | + root.returnExports = factory(); | ||
29 | + } | ||
30 | +}(this, function () { | ||
31 | + | ||
32 | +var call = Function.call; | ||
33 | +var prototypeOfObject = Object.prototype; | ||
34 | +var owns = call.bind(prototypeOfObject.hasOwnProperty); | ||
35 | +var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); | ||
36 | +var toStr = call.bind(prototypeOfObject.toString); | ||
37 | + | ||
38 | +// If JS engine supports accessors creating shortcuts. | ||
39 | +var defineGetter; | ||
40 | +var defineSetter; | ||
41 | +var lookupGetter; | ||
42 | +var lookupSetter; | ||
43 | +var supportsAccessors = owns(prototypeOfObject, '__defineGetter__'); | ||
44 | +if (supportsAccessors) { | ||
45 | + /* eslint-disable no-underscore-dangle */ | ||
46 | + defineGetter = call.bind(prototypeOfObject.__defineGetter__); | ||
47 | + defineSetter = call.bind(prototypeOfObject.__defineSetter__); | ||
48 | + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); | ||
49 | + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); | ||
50 | + /* eslint-enable no-underscore-dangle */ | ||
51 | +} | ||
52 | + | ||
53 | +// ES5 15.2.3.2 | ||
54 | +// http://es5.github.com/#x15.2.3.2 | ||
55 | +if (!Object.getPrototypeOf) { | ||
56 | + // https://github.com/es-shims/es5-shim/issues#issue/2 | ||
57 | + // http://ejohn.org/blog/objectgetprototypeof/ | ||
58 | + // recommended by fschaefer on github | ||
59 | + // | ||
60 | + // sure, and webreflection says ^_^ | ||
61 | + // ... this will nerever possibly return null | ||
62 | + // ... Opera Mini breaks here with infinite loops | ||
63 | + Object.getPrototypeOf = function getPrototypeOf(object) { | ||
64 | + /* eslint-disable no-proto */ | ||
65 | + var proto = object.__proto__; | ||
66 | + /* eslint-enable no-proto */ | ||
67 | + if (proto || proto === null) { | ||
68 | + return proto; | ||
69 | + } else if (toStr(object.constructor) === '[object Function]') { | ||
70 | + return object.constructor.prototype; | ||
71 | + } else if (object instanceof Object) { | ||
72 | + return prototypeOfObject; | ||
73 | + } else { | ||
74 | + // Correctly return null for Objects created with `Object.create(null)` | ||
75 | + // (shammed or native) or `{ __proto__: null}`. Also returns null for | ||
76 | + // cross-realm objects on browsers that lack `__proto__` support (like | ||
77 | + // IE <11), but that's the best we can do. | ||
78 | + return null; | ||
79 | + } | ||
80 | + }; | ||
81 | +} | ||
82 | + | ||
83 | +// ES5 15.2.3.3 | ||
84 | +// http://es5.github.com/#x15.2.3.3 | ||
85 | + | ||
86 | +var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) { | ||
87 | + try { | ||
88 | + object.sentinel = 0; | ||
89 | + return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0; | ||
90 | + } catch (exception) { | ||
91 | + return false; | ||
92 | + } | ||
93 | +}; | ||
94 | + | ||
95 | +// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially. | ||
96 | +if (Object.defineProperty) { | ||
97 | + var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({}); | ||
98 | + var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' || | ||
99 | + doesGetOwnPropertyDescriptorWork(document.createElement('div')); | ||
100 | + if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) { | ||
101 | + var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor; | ||
102 | + } | ||
103 | +} | ||
104 | + | ||
105 | +if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) { | ||
106 | + var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: '; | ||
107 | + | ||
108 | + /* eslint-disable no-proto */ | ||
109 | + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { | ||
110 | + if ((typeof object !== 'object' && typeof object !== 'function') || object === null) { | ||
111 | + throw new TypeError(ERR_NON_OBJECT + object); | ||
112 | + } | ||
113 | + | ||
114 | + // make a valiant attempt to use the real getOwnPropertyDescriptor | ||
115 | + // for I8's DOM elements. | ||
116 | + if (getOwnPropertyDescriptorFallback) { | ||
117 | + try { | ||
118 | + return getOwnPropertyDescriptorFallback.call(Object, object, property); | ||
119 | + } catch (exception) { | ||
120 | + // try the shim if the real one doesn't work | ||
121 | + } | ||
122 | + } | ||
123 | + | ||
124 | + var descriptor; | ||
125 | + | ||
126 | + // If object does not owns property return undefined immediately. | ||
127 | + if (!owns(object, property)) { | ||
128 | + return descriptor; | ||
129 | + } | ||
130 | + | ||
131 | + // If object has a property then it's for sure `configurable`, and | ||
132 | + // probably `enumerable`. Detect enumerability though. | ||
133 | + descriptor = { | ||
134 | + enumerable: isEnumerable(object, property), | ||
135 | + configurable: true | ||
136 | + }; | ||
137 | + | ||
138 | + // If JS engine supports accessor properties then property may be a | ||
139 | + // getter or setter. | ||
140 | + if (supportsAccessors) { | ||
141 | + // Unfortunately `__lookupGetter__` will return a getter even | ||
142 | + // if object has own non getter property along with a same named | ||
143 | + // inherited getter. To avoid misbehavior we temporary remove | ||
144 | + // `__proto__` so that `__lookupGetter__` will return getter only | ||
145 | + // if it's owned by an object. | ||
146 | + var prototype = object.__proto__; | ||
147 | + var notPrototypeOfObject = object !== prototypeOfObject; | ||
148 | + // avoid recursion problem, breaking in Opera Mini when | ||
149 | + // Object.getOwnPropertyDescriptor(Object.prototype, 'toString') | ||
150 | + // or any other Object.prototype accessor | ||
151 | + if (notPrototypeOfObject) { | ||
152 | + object.__proto__ = prototypeOfObject; | ||
153 | + } | ||
154 | + | ||
155 | + var getter = lookupGetter(object, property); | ||
156 | + var setter = lookupSetter(object, property); | ||
157 | + | ||
158 | + if (notPrototypeOfObject) { | ||
159 | + // Once we have getter and setter we can put values back. | ||
160 | + object.__proto__ = prototype; | ||
161 | + } | ||
162 | + | ||
163 | + if (getter || setter) { | ||
164 | + if (getter) { | ||
165 | + descriptor.get = getter; | ||
166 | + } | ||
167 | + if (setter) { | ||
168 | + descriptor.set = setter; | ||
169 | + } | ||
170 | + // If it was accessor property we're done and return here | ||
171 | + // in order to avoid adding `value` to the descriptor. | ||
172 | + return descriptor; | ||
173 | + } | ||
174 | + } | ||
175 | + | ||
176 | + // If we got this far we know that object has an own property that is | ||
177 | + // not an accessor so we set it as a value and return descriptor. | ||
178 | + descriptor.value = object[property]; | ||
179 | + descriptor.writable = true; | ||
180 | + return descriptor; | ||
181 | + }; | ||
182 | + /* eslint-enable no-proto */ | ||
183 | +} | ||
184 | + | ||
185 | +// ES5 15.2.3.4 | ||
186 | +// http://es5.github.com/#x15.2.3.4 | ||
187 | +if (!Object.getOwnPropertyNames) { | ||
188 | + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { | ||
189 | + return Object.keys(object); | ||
190 | + }; | ||
191 | +} | ||
192 | + | ||
193 | +// ES5 15.2.3.5 | ||
194 | +// http://es5.github.com/#x15.2.3.5 | ||
195 | +if (!Object.create) { | ||
196 | + | ||
197 | + // Contributed by Brandon Benvie, October, 2012 | ||
198 | + var createEmpty; | ||
199 | + var supportsProto = !({ __proto__: null } instanceof Object); | ||
200 | + // the following produces false positives | ||
201 | + // in Opera Mini => not a reliable check | ||
202 | + // Object.prototype.__proto__ === null | ||
203 | + | ||
204 | + // Check for document.domain and active x support | ||
205 | + // No need to use active x approach when document.domain is not set | ||
206 | + // see https://github.com/es-shims/es5-shim/issues/150 | ||
207 | + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 | ||
208 | + /* global ActiveXObject */ | ||
209 | + var shouldUseActiveX = function shouldUseActiveX() { | ||
210 | + // return early if document.domain not set | ||
211 | + if (!document.domain) { | ||
212 | + return false; | ||
213 | + } | ||
214 | + | ||
215 | + try { | ||
216 | + return !!new ActiveXObject('htmlfile'); | ||
217 | + } catch (exception) { | ||
218 | + return false; | ||
219 | + } | ||
220 | + }; | ||
221 | + | ||
222 | + // This supports IE8 when document.domain is used | ||
223 | + // see https://github.com/es-shims/es5-shim/issues/150 | ||
224 | + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 | ||
225 | + var getEmptyViaActiveX = function getEmptyViaActiveX() { | ||
226 | + var empty; | ||
227 | + var xDoc; | ||
228 | + | ||
229 | + xDoc = new ActiveXObject('htmlfile'); | ||
230 | + | ||
231 | + var script = 'script'; | ||
232 | + xDoc.write('<' + script + '></' + script + '>'); | ||
233 | + xDoc.close(); | ||
234 | + | ||
235 | + empty = xDoc.parentWindow.Object.prototype; | ||
236 | + xDoc = null; | ||
237 | + | ||
238 | + return empty; | ||
239 | + }; | ||
240 | + | ||
241 | + // The original implementation using an iframe | ||
242 | + // before the activex approach was added | ||
243 | + // see https://github.com/es-shims/es5-shim/issues/150 | ||
244 | + var getEmptyViaIFrame = function getEmptyViaIFrame() { | ||
245 | + var iframe = document.createElement('iframe'); | ||
246 | + var parent = document.body || document.documentElement; | ||
247 | + var empty; | ||
248 | + | ||
249 | + iframe.style.display = 'none'; | ||
250 | + parent.appendChild(iframe); | ||
251 | + /* eslint-disable no-script-url */ | ||
252 | + iframe.src = 'javascript:'; | ||
253 | + /* eslint-enable no-script-url */ | ||
254 | + | ||
255 | + empty = iframe.contentWindow.Object.prototype; | ||
256 | + parent.removeChild(iframe); | ||
257 | + iframe = null; | ||
258 | + | ||
259 | + return empty; | ||
260 | + }; | ||
261 | + | ||
262 | + /* global document */ | ||
263 | + if (supportsProto || typeof document === 'undefined') { | ||
264 | + createEmpty = function () { | ||
265 | + return { __proto__: null }; | ||
266 | + }; | ||
267 | + } else { | ||
268 | + // In old IE __proto__ can't be used to manually set `null`, nor does | ||
269 | + // any other method exist to make an object that inherits from nothing, | ||
270 | + // aside from Object.prototype itself. Instead, create a new global | ||
271 | + // object and *steal* its Object.prototype and strip it bare. This is | ||
272 | + // used as the prototype to create nullary objects. | ||
273 | + createEmpty = function () { | ||
274 | + // Determine which approach to use | ||
275 | + // see https://github.com/es-shims/es5-shim/issues/150 | ||
276 | + var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame(); | ||
277 | + | ||
278 | + delete empty.constructor; | ||
279 | + delete empty.hasOwnProperty; | ||
280 | + delete empty.propertyIsEnumerable; | ||
281 | + delete empty.isPrototypeOf; | ||
282 | + delete empty.toLocaleString; | ||
283 | + delete empty.toString; | ||
284 | + delete empty.valueOf; | ||
285 | + | ||
286 | + var Empty = function Empty() {}; | ||
287 | + Empty.prototype = empty; | ||
288 | + // short-circuit future calls | ||
289 | + createEmpty = function () { | ||
290 | + return new Empty(); | ||
291 | + }; | ||
292 | + return new Empty(); | ||
293 | + }; | ||
294 | + } | ||
295 | + | ||
296 | + Object.create = function create(prototype, properties) { | ||
297 | + | ||
298 | + var object; | ||
299 | + var Type = function Type() {}; // An empty constructor. | ||
300 | + | ||
301 | + if (prototype === null) { | ||
302 | + object = createEmpty(); | ||
303 | + } else { | ||
304 | + if (typeof prototype !== 'object' && typeof prototype !== 'function') { | ||
305 | + // In the native implementation `parent` can be `null` | ||
306 | + // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) | ||
307 | + // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` | ||
308 | + // like they are in modern browsers. Using `Object.create` on DOM elements | ||
309 | + // is...err...probably inappropriate, but the native version allows for it. | ||
310 | + throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome | ||
311 | + } | ||
312 | + Type.prototype = prototype; | ||
313 | + object = new Type(); | ||
314 | + // IE has no built-in implementation of `Object.getPrototypeOf` | ||
315 | + // neither `__proto__`, but this manually setting `__proto__` will | ||
316 | + // guarantee that `Object.getPrototypeOf` will work as expected with | ||
317 | + // objects created using `Object.create` | ||
318 | + /* eslint-disable no-proto */ | ||
319 | + object.__proto__ = prototype; | ||
320 | + /* eslint-enable no-proto */ | ||
321 | + } | ||
322 | + | ||
323 | + if (properties !== void 0) { | ||
324 | + Object.defineProperties(object, properties); | ||
325 | + } | ||
326 | + | ||
327 | + return object; | ||
328 | + }; | ||
329 | +} | ||
330 | + | ||
331 | +// ES5 15.2.3.6 | ||
332 | +// http://es5.github.com/#x15.2.3.6 | ||
333 | + | ||
334 | +// Patch for WebKit and IE8 standard mode | ||
335 | +// Designed by hax <hax.github.com> | ||
336 | +// related issue: https://github.com/es-shims/es5-shim/issues#issue/5 | ||
337 | +// IE8 Reference: | ||
338 | +// http://msdn.microsoft.com/en-us/library/dd282900.aspx | ||
339 | +// http://msdn.microsoft.com/en-us/library/dd229916.aspx | ||
340 | +// WebKit Bugs: | ||
341 | +// https://bugs.webkit.org/show_bug.cgi?id=36423 | ||
342 | + | ||
343 | +var doesDefinePropertyWork = function doesDefinePropertyWork(object) { | ||
344 | + try { | ||
345 | + Object.defineProperty(object, 'sentinel', {}); | ||
346 | + return 'sentinel' in object; | ||
347 | + } catch (exception) { | ||
348 | + return false; | ||
349 | + } | ||
350 | +}; | ||
351 | + | ||
352 | +// check whether defineProperty works if it's given. Otherwise, | ||
353 | +// shim partially. | ||
354 | +if (Object.defineProperty) { | ||
355 | + var definePropertyWorksOnObject = doesDefinePropertyWork({}); | ||
356 | + var definePropertyWorksOnDom = typeof document === 'undefined' || | ||
357 | + doesDefinePropertyWork(document.createElement('div')); | ||
358 | + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { | ||
359 | + var definePropertyFallback = Object.defineProperty, | ||
360 | + definePropertiesFallback = Object.defineProperties; | ||
361 | + } | ||
362 | +} | ||
363 | + | ||
364 | +if (!Object.defineProperty || definePropertyFallback) { | ||
365 | + var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: '; | ||
366 | + var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: '; | ||
367 | + var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine'; | ||
368 | + | ||
369 | + Object.defineProperty = function defineProperty(object, property, descriptor) { | ||
370 | + if ((typeof object !== 'object' && typeof object !== 'function') || object === null) { | ||
371 | + throw new TypeError(ERR_NON_OBJECT_TARGET + object); | ||
372 | + } | ||
373 | + if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) { | ||
374 | + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); | ||
375 | + } | ||
376 | + // make a valiant attempt to use the real defineProperty | ||
377 | + // for I8's DOM elements. | ||
378 | + if (definePropertyFallback) { | ||
379 | + try { | ||
380 | + return definePropertyFallback.call(Object, object, property, descriptor); | ||
381 | + } catch (exception) { | ||
382 | + // try the shim if the real one doesn't work | ||
383 | + } | ||
384 | + } | ||
385 | + | ||
386 | + // If it's a data property. | ||
387 | + if ('value' in descriptor) { | ||
388 | + // fail silently if 'writable', 'enumerable', or 'configurable' | ||
389 | + // are requested but not supported | ||
390 | + /* | ||
391 | + // alternate approach: | ||
392 | + if ( // can't implement these features; allow false but not true | ||
393 | + ('writable' in descriptor && !descriptor.writable) || | ||
394 | + ('enumerable' in descriptor && !descriptor.enumerable) || | ||
395 | + ('configurable' in descriptor && !descriptor.configurable) | ||
396 | + )) | ||
397 | + throw new RangeError( | ||
398 | + 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' | ||
399 | + ); | ||
400 | + */ | ||
401 | + | ||
402 | + if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { | ||
403 | + // As accessors are supported only on engines implementing | ||
404 | + // `__proto__` we can safely override `__proto__` while defining | ||
405 | + // a property to make sure that we don't hit an inherited | ||
406 | + // accessor. | ||
407 | + /* eslint-disable no-proto */ | ||
408 | + var prototype = object.__proto__; | ||
409 | + object.__proto__ = prototypeOfObject; | ||
410 | + // Deleting a property anyway since getter / setter may be | ||
411 | + // defined on object itself. | ||
412 | + delete object[property]; | ||
413 | + object[property] = descriptor.value; | ||
414 | + // Setting original `__proto__` back now. | ||
415 | + object.__proto__ = prototype; | ||
416 | + /* eslint-enable no-proto */ | ||
417 | + } else { | ||
418 | + object[property] = descriptor.value; | ||
419 | + } | ||
420 | + } else { | ||
421 | + if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) { | ||
422 | + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); | ||
423 | + } | ||
424 | + // If we got that far then getters and setters can be defined !! | ||
425 | + if ('get' in descriptor) { | ||
426 | + defineGetter(object, property, descriptor.get); | ||
427 | + } | ||
428 | + if ('set' in descriptor) { | ||
429 | + defineSetter(object, property, descriptor.set); | ||
430 | + } | ||
431 | + } | ||
432 | + return object; | ||
433 | + }; | ||
434 | +} | ||
435 | + | ||
436 | +// ES5 15.2.3.7 | ||
437 | +// http://es5.github.com/#x15.2.3.7 | ||
438 | +if (!Object.defineProperties || definePropertiesFallback) { | ||
439 | + Object.defineProperties = function defineProperties(object, properties) { | ||
440 | + // make a valiant attempt to use the real defineProperties | ||
441 | + if (definePropertiesFallback) { | ||
442 | + try { | ||
443 | + return definePropertiesFallback.call(Object, object, properties); | ||
444 | + } catch (exception) { | ||
445 | + // try the shim if the real one doesn't work | ||
446 | + } | ||
447 | + } | ||
448 | + | ||
449 | + Object.keys(properties).forEach(function (property) { | ||
450 | + if (property !== '__proto__') { | ||
451 | + Object.defineProperty(object, property, properties[property]); | ||
452 | + } | ||
453 | + }); | ||
454 | + return object; | ||
455 | + }; | ||
456 | +} | ||
457 | + | ||
458 | +// ES5 15.2.3.8 | ||
459 | +// http://es5.github.com/#x15.2.3.8 | ||
460 | +if (!Object.seal) { | ||
461 | + Object.seal = function seal(object) { | ||
462 | + if (Object(object) !== object) { | ||
463 | + throw new TypeError('Object.seal can only be called on Objects.'); | ||
464 | + } | ||
465 | + // this is misleading and breaks feature-detection, but | ||
466 | + // allows "securable" code to "gracefully" degrade to working | ||
467 | + // but insecure code. | ||
468 | + return object; | ||
469 | + }; | ||
470 | +} | ||
471 | + | ||
472 | +// ES5 15.2.3.9 | ||
473 | +// http://es5.github.com/#x15.2.3.9 | ||
474 | +if (!Object.freeze) { | ||
475 | + Object.freeze = function freeze(object) { | ||
476 | + if (Object(object) !== object) { | ||
477 | + throw new TypeError('Object.freeze can only be called on Objects.'); | ||
478 | + } | ||
479 | + // this is misleading and breaks feature-detection, but | ||
480 | + // allows "securable" code to "gracefully" degrade to working | ||
481 | + // but insecure code. | ||
482 | + return object; | ||
483 | + }; | ||
484 | +} | ||
485 | + | ||
486 | +// detect a Rhino bug and patch it | ||
487 | +try { | ||
488 | + Object.freeze(function () {}); | ||
489 | +} catch (exception) { | ||
490 | + Object.freeze = (function (freezeObject) { | ||
491 | + return function freeze(object) { | ||
492 | + if (typeof object === 'function') { | ||
493 | + return object; | ||
494 | + } else { | ||
495 | + return freezeObject(object); | ||
496 | + } | ||
497 | + }; | ||
498 | + }(Object.freeze)); | ||
499 | +} | ||
500 | + | ||
501 | +// ES5 15.2.3.10 | ||
502 | +// http://es5.github.com/#x15.2.3.10 | ||
503 | +if (!Object.preventExtensions) { | ||
504 | + Object.preventExtensions = function preventExtensions(object) { | ||
505 | + if (Object(object) !== object) { | ||
506 | + throw new TypeError('Object.preventExtensions can only be called on Objects.'); | ||
507 | + } | ||
508 | + // this is misleading and breaks feature-detection, but | ||
509 | + // allows "securable" code to "gracefully" degrade to working | ||
510 | + // but insecure code. | ||
511 | + return object; | ||
512 | + }; | ||
513 | +} | ||
514 | + | ||
515 | +// ES5 15.2.3.11 | ||
516 | +// http://es5.github.com/#x15.2.3.11 | ||
517 | +if (!Object.isSealed) { | ||
518 | + Object.isSealed = function isSealed(object) { | ||
519 | + if (Object(object) !== object) { | ||
520 | + throw new TypeError('Object.isSealed can only be called on Objects.'); | ||
521 | + } | ||
522 | + return false; | ||
523 | + }; | ||
524 | +} | ||
525 | + | ||
526 | +// ES5 15.2.3.12 | ||
527 | +// http://es5.github.com/#x15.2.3.12 | ||
528 | +if (!Object.isFrozen) { | ||
529 | + Object.isFrozen = function isFrozen(object) { | ||
530 | + if (Object(object) !== object) { | ||
531 | + throw new TypeError('Object.isFrozen can only be called on Objects.'); | ||
532 | + } | ||
533 | + return false; | ||
534 | + }; | ||
535 | +} | ||
536 | + | ||
537 | +// ES5 15.2.3.13 | ||
538 | +// http://es5.github.com/#x15.2.3.13 | ||
539 | +if (!Object.isExtensible) { | ||
540 | + Object.isExtensible = function isExtensible(object) { | ||
541 | + // 1. If Type(O) is not Object throw a TypeError exception. | ||
542 | + if (Object(object) !== object) { | ||
543 | + throw new TypeError('Object.isExtensible can only be called on Objects.'); | ||
544 | + } | ||
545 | + // 2. Return the Boolean value of the [[Extensible]] internal property of O. | ||
546 | + var name = ''; | ||
547 | + while (owns(object, name)) { | ||
548 | + name += '?'; | ||
549 | + } | ||
550 | + object[name] = true; | ||
551 | + var returnValue = owns(object, name); | ||
552 | + delete object[name]; | ||
553 | + return returnValue; | ||
554 | + }; | ||
555 | +} | ||
556 | + | ||
557 | +})); |
1 | -/*! | ||
2 | - * https://github.com/es-shims/es5-shim | ||
3 | - * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | - * see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE | ||
5 | - */ | ||
6 | -(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}}}); | ||
7 | -//# sourceMappingURL=es5-sham.map | 1 | +/*! |
2 | + * https://github.com/es-shims/es5-shim | ||
3 | + * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | + * see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE | ||
5 | + */ | ||
6 | +(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}}}); | ||
7 | +//# sourceMappingURL=es5-sham.map |
此 diff 太大无法显示。
1 | -/*! | ||
2 | - * https://github.com/es-shims/es5-shim | ||
3 | - * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | - * see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE | ||
5 | - */ | ||
6 | -(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}}); | ||
7 | -//# sourceMappingURL=es5-shim.map | 1 | +/*! |
2 | + * https://github.com/es-shims/es5-shim | ||
3 | + * @license es5-shim Copyright 2009-2015 by contributors, MIT License | ||
4 | + * see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE | ||
5 | + */ | ||
6 | +(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}}); | ||
7 | +//# sourceMappingURL=es5-shim.map |
1 | -{ | ||
2 | - "name": "es5-shim", | ||
3 | - "version": "4.5.7", | ||
4 | - "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
5 | - "homepage": "http://github.com/es-shims/es5-shim/", | ||
6 | - "contributors": [ | ||
7 | - "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)", | ||
8 | - "Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)", | ||
9 | - "Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)", | ||
10 | - "Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)", | ||
11 | - "Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)", | ||
12 | - "Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)" | ||
13 | - ], | ||
14 | - "bugs": { | ||
15 | - "mail": "ljharb@gmail.com", | ||
16 | - "url": "http://github.com/es-shims/es5-shim/issues" | ||
17 | - }, | ||
18 | - "license": "MIT", | ||
19 | - "main": "es5-shim.js", | ||
20 | - "repository": { | ||
21 | - "type": "git", | ||
22 | - "url": "http://github.com/es-shims/es5-shim.git" | ||
23 | - }, | ||
24 | - "scripts": { | ||
25 | - "minify": "concurrently --raw 'npm run --silent minify-shim' 'npm run --silent minify-sham'", | ||
26 | - "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", | ||
27 | - "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", | ||
28 | - "pretest": "npm run --silent lint", | ||
29 | - "test": "npm run --silent tests-only", | ||
30 | - "tests-only": "jasmine-node --matchall ./ tests/spec/", | ||
31 | - "test-native": "jasmine-node --matchall tests/spec/", | ||
32 | - "lint": "concurrently --raw 'npm run --silent jscs' 'npm run --silent eslint'", | ||
33 | - "eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js", | ||
34 | - "jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" | ||
35 | - }, | ||
36 | - "devDependencies": { | ||
37 | - "eslint": "^2.5.3", | ||
38 | - "@ljharb/eslint-config": "^2.2.0", | ||
39 | - "jasmine-node": "^1.14.5", | ||
40 | - "jscs": "^2.11.0", | ||
41 | - "uglify-js": "^2.6.2", | ||
42 | - "replace": "^0.3.0", | ||
43 | - "semver": "^5.1.0", | ||
44 | - "concurrently": "^2.0.0" | ||
45 | - }, | ||
46 | - "engines": { | ||
47 | - "node": ">=0.4.0" | ||
48 | - }, | ||
49 | - "testling": { | ||
50 | - "browsers": [ | ||
51 | - "iexplore/6.0..latest", | ||
52 | - "firefox/3.0..6.0", | ||
53 | - "firefox/18.0..latest", | ||
54 | - "firefox/nightly", | ||
55 | - "chrome/4.0..10.0", | ||
56 | - "chrome/25.0..latest", | ||
57 | - "chrome/canary", | ||
58 | - "opera/10.0..latest", | ||
59 | - "opera/next", | ||
60 | - "safari/4.0..latest", | ||
61 | - "ipad/6.0..latest", | ||
62 | - "iphone/6.0..latest", | ||
63 | - "android-browser/4.2" | ||
64 | - ] | ||
65 | - }, | ||
66 | - "keywords": [ | ||
67 | - "shim", | ||
68 | - "es5", | ||
69 | - "es5 shim", | ||
70 | - "javascript", | ||
71 | - "ecmascript", | ||
72 | - "polyfill" | ||
73 | - ] | ||
74 | -} | ||
75 | - | 1 | +{ |
2 | + "name": "es5-shim", | ||
3 | + "version": "4.5.7", | ||
4 | + "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
5 | + "homepage": "http://github.com/es-shims/es5-shim/", | ||
6 | + "contributors": [ | ||
7 | + "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)", | ||
8 | + "Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)", | ||
9 | + "Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)", | ||
10 | + "Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)", | ||
11 | + "Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)", | ||
12 | + "Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)" | ||
13 | + ], | ||
14 | + "bugs": { | ||
15 | + "mail": "ljharb@gmail.com", | ||
16 | + "url": "http://github.com/es-shims/es5-shim/issues" | ||
17 | + }, | ||
18 | + "license": "MIT", | ||
19 | + "main": "es5-shim.js", | ||
20 | + "repository": { | ||
21 | + "type": "git", | ||
22 | + "url": "http://github.com/es-shims/es5-shim.git" | ||
23 | + }, | ||
24 | + "scripts": { | ||
25 | + "minify": "concurrently --raw 'npm run --silent minify-shim' 'npm run --silent minify-sham'", | ||
26 | + "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", | ||
27 | + "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", | ||
28 | + "pretest": "npm run --silent lint", | ||
29 | + "test": "npm run --silent tests-only", | ||
30 | + "tests-only": "jasmine-node --matchall ./ tests/spec/", | ||
31 | + "test-native": "jasmine-node --matchall tests/spec/", | ||
32 | + "lint": "concurrently --raw 'npm run --silent jscs' 'npm run --silent eslint'", | ||
33 | + "eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js", | ||
34 | + "jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" | ||
35 | + }, | ||
36 | + "devDependencies": { | ||
37 | + "eslint": "^2.5.3", | ||
38 | + "@ljharb/eslint-config": "^2.2.0", | ||
39 | + "jasmine-node": "^1.14.5", | ||
40 | + "jscs": "^2.11.0", | ||
41 | + "uglify-js": "^2.6.2", | ||
42 | + "replace": "^0.3.0", | ||
43 | + "semver": "^5.1.0", | ||
44 | + "concurrently": "^2.0.0" | ||
45 | + }, | ||
46 | + "engines": { | ||
47 | + "node": ">=0.4.0" | ||
48 | + }, | ||
49 | + "testling": { | ||
50 | + "browsers": [ | ||
51 | + "iexplore/6.0..latest", | ||
52 | + "firefox/3.0..6.0", | ||
53 | + "firefox/18.0..latest", | ||
54 | + "firefox/nightly", | ||
55 | + "chrome/4.0..10.0", | ||
56 | + "chrome/25.0..latest", | ||
57 | + "chrome/canary", | ||
58 | + "opera/10.0..latest", | ||
59 | + "opera/next", | ||
60 | + "safari/4.0..latest", | ||
61 | + "ipad/6.0..latest", | ||
62 | + "iphone/6.0..latest", | ||
63 | + "android-browser/4.2" | ||
64 | + ] | ||
65 | + }, | ||
66 | + "keywords": [ | ||
67 | + "shim", | ||
68 | + "es5", | ||
69 | + "es5 shim", | ||
70 | + "javascript", | ||
71 | + "ecmascript", | ||
72 | + "polyfill" | ||
73 | + ] | ||
74 | +} | ||
75 | + |
1 | -/* global beforeEach, expect */ | ||
2 | - | ||
3 | -var has = Object.prototype.hasOwnProperty; | ||
4 | -var getKeys = function (o) { | ||
5 | - 'use strict'; | ||
6 | - | ||
7 | - var key; | ||
8 | - var a = []; | ||
9 | - for (key in o) { | ||
10 | - if (has.call(o, key)) { | ||
11 | - a.push(key); | ||
12 | - } | ||
13 | - } | ||
14 | - return a; | ||
15 | -}; | ||
16 | - | ||
17 | -beforeEach(function () { | ||
18 | - 'use strict'; | ||
19 | - | ||
20 | - this.addMatchers({ | ||
21 | - toExactlyMatch: function (expected) { | ||
22 | - var a1, a2, l, i, key; | ||
23 | - var actual = this.actual; | ||
24 | - | ||
25 | - a1 = getKeys(actual); | ||
26 | - a2 = getKeys(expected); | ||
27 | - | ||
28 | - l = a1.length; | ||
29 | - if (l !== a2.length) { | ||
30 | - return false; | ||
31 | - } | ||
32 | - for (i = 0; i < l; i++) { | ||
33 | - key = a1[i]; | ||
34 | - expect(key).toEqual(a2[i]); | ||
35 | - expect(actual[key]).toEqual(expected[key]); | ||
36 | - } | ||
37 | - | ||
38 | - return true; | ||
39 | - } | ||
40 | - }); | ||
41 | -}); | 1 | +/* global beforeEach, expect */ |
2 | + | ||
3 | +var has = Object.prototype.hasOwnProperty; | ||
4 | +var getKeys = function (o) { | ||
5 | + 'use strict'; | ||
6 | + | ||
7 | + var key; | ||
8 | + var a = []; | ||
9 | + for (key in o) { | ||
10 | + if (has.call(o, key)) { | ||
11 | + a.push(key); | ||
12 | + } | ||
13 | + } | ||
14 | + return a; | ||
15 | +}; | ||
16 | + | ||
17 | +beforeEach(function () { | ||
18 | + 'use strict'; | ||
19 | + | ||
20 | + this.addMatchers({ | ||
21 | + toExactlyMatch: function (expected) { | ||
22 | + var a1, a2, l, i, key; | ||
23 | + var actual = this.actual; | ||
24 | + | ||
25 | + a1 = getKeys(actual); | ||
26 | + a2 = getKeys(expected); | ||
27 | + | ||
28 | + l = a1.length; | ||
29 | + if (l !== a2.length) { | ||
30 | + return false; | ||
31 | + } | ||
32 | + for (i = 0; i < l; i++) { | ||
33 | + key = a1[i]; | ||
34 | + expect(key).toEqual(a2[i]); | ||
35 | + expect(actual[key]).toEqual(expected[key]); | ||
36 | + } | ||
37 | + | ||
38 | + return true; | ||
39 | + } | ||
40 | + }); | ||
41 | +}); |
1 | -<!DOCTYPE HTML> | ||
2 | -<html> | ||
3 | -<head> | ||
4 | - <meta charset="utf-8" /> | ||
5 | - <title>Jasmine Spec Runner</title> | ||
6 | - | ||
7 | - <link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png"> | ||
8 | - | ||
9 | - <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> | ||
10 | - <script type="text/javascript" src="lib/jasmine.js"></script> | ||
11 | - <script type="text/javascript" src="lib/jasmine-html.js"></script> | ||
12 | - <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
13 | - | ||
14 | - <!-- include helper files here... --> | ||
15 | - <script src="helpers/h-matchers.js"></script> | ||
16 | - | ||
17 | - <!-- include source files here... --> | ||
18 | - <script src="../es5-shim.js"></script> | ||
19 | - <script src="../es5-sham.js"></script> | ||
20 | - | ||
21 | - <!-- include spec files here... --> | ||
22 | - <script src="spec/s-array.js"></script> | ||
23 | - <script src="spec/s-date.js"></script> | ||
24 | - <script src="spec/s-error.js"></script> | ||
25 | - <script src="spec/s-function.js"></script> | ||
26 | - <script src="spec/s-global.js"></script> | ||
27 | - <script src="spec/s-number.js"></script> | ||
28 | - <script src="spec/s-object.js"></script> | ||
29 | - <script src="spec/s-string.js"></script> | ||
30 | - <script src="spec/s-regexp.js"></script> | ||
31 | - | ||
32 | - | ||
33 | - <script type="text/javascript"> | ||
34 | - (function() { | ||
35 | - var jasmineEnv = jasmine.getEnv(); | ||
36 | - jasmineEnv.updateInterval = 1000; | ||
37 | - | ||
38 | - var trivialReporter = new jasmine.TrivialReporter(); | ||
39 | - | ||
40 | - jasmineEnv.addReporter(trivialReporter); | ||
41 | - | ||
42 | - jasmineEnv.specFilter = function(spec) { | ||
43 | - return trivialReporter.specFilter(spec); | ||
44 | - }; | ||
45 | - | ||
46 | - var currentWindowOnload = window.onload; | ||
47 | - | ||
48 | - window.onload = function() { | ||
49 | - if (currentWindowOnload) { | ||
50 | - currentWindowOnload(); | ||
51 | - } | ||
52 | - execJasmine(); | ||
53 | - }; | ||
54 | - | ||
55 | - function execJasmine() { | ||
56 | - jasmineEnv.execute(); | ||
57 | - } | ||
58 | - | ||
59 | - })(); | ||
60 | - </script> | ||
61 | - | ||
62 | -</head> | ||
63 | - | ||
64 | -<body> | ||
65 | -</body> | ||
66 | -</html> | 1 | +<!DOCTYPE HTML> |
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="utf-8" /> | ||
5 | + <title>Jasmine Spec Runner</title> | ||
6 | + | ||
7 | + <link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png"> | ||
8 | + | ||
9 | + <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> | ||
10 | + <script type="text/javascript" src="lib/jasmine.js"></script> | ||
11 | + <script type="text/javascript" src="lib/jasmine-html.js"></script> | ||
12 | + <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
13 | + | ||
14 | + <!-- include helper files here... --> | ||
15 | + <script src="helpers/h-matchers.js"></script> | ||
16 | + | ||
17 | + <!-- include source files here... --> | ||
18 | + <script src="../es5-shim.js"></script> | ||
19 | + <script src="../es5-sham.js"></script> | ||
20 | + | ||
21 | + <!-- include spec files here... --> | ||
22 | + <script src="spec/s-array.js"></script> | ||
23 | + <script src="spec/s-date.js"></script> | ||
24 | + <script src="spec/s-error.js"></script> | ||
25 | + <script src="spec/s-function.js"></script> | ||
26 | + <script src="spec/s-global.js"></script> | ||
27 | + <script src="spec/s-number.js"></script> | ||
28 | + <script src="spec/s-object.js"></script> | ||
29 | + <script src="spec/s-string.js"></script> | ||
30 | + <script src="spec/s-regexp.js"></script> | ||
31 | + | ||
32 | + | ||
33 | + <script type="text/javascript"> | ||
34 | + (function() { | ||
35 | + var jasmineEnv = jasmine.getEnv(); | ||
36 | + jasmineEnv.updateInterval = 1000; | ||
37 | + | ||
38 | + var trivialReporter = new jasmine.TrivialReporter(); | ||
39 | + | ||
40 | + jasmineEnv.addReporter(trivialReporter); | ||
41 | + | ||
42 | + jasmineEnv.specFilter = function(spec) { | ||
43 | + return trivialReporter.specFilter(spec); | ||
44 | + }; | ||
45 | + | ||
46 | + var currentWindowOnload = window.onload; | ||
47 | + | ||
48 | + window.onload = function() { | ||
49 | + if (currentWindowOnload) { | ||
50 | + currentWindowOnload(); | ||
51 | + } | ||
52 | + execJasmine(); | ||
53 | + }; | ||
54 | + | ||
55 | + function execJasmine() { | ||
56 | + jasmineEnv.execute(); | ||
57 | + } | ||
58 | + | ||
59 | + })(); | ||
60 | + </script> | ||
61 | + | ||
62 | +</head> | ||
63 | + | ||
64 | +<body> | ||
65 | +</body> | ||
66 | +</html> |
1 | -<!DOCTYPE HTML> | ||
2 | -<html> | ||
3 | -<head> | ||
4 | - <title>Jasmine Spec Runner</title> | ||
5 | - | ||
6 | - <link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png"> | ||
7 | - | ||
8 | - <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> | ||
9 | - <script type="text/javascript" src="lib/jasmine.js"></script> | ||
10 | - <script type="text/javascript" src="lib/jasmine-html.js"></script> | ||
11 | - <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
12 | - | ||
13 | - | ||
14 | - <!-- include helper files here... --> | ||
15 | - <script src="helpers/h-matchers.js"></script> | ||
16 | - | ||
17 | - <!-- include source files here... --> | ||
18 | - <script src="../es5-shim.min.js"></script> | ||
19 | - | ||
20 | - <!-- include spec files here... --> | ||
21 | - <script src="spec/s-array.js"></script> | ||
22 | - <script src="spec/s-date.js"></script> | ||
23 | - <script src="spec/s-error.js"></script> | ||
24 | - <script src="spec/s-function.js"></script> | ||
25 | - <script src="spec/s-global.js"></script> | ||
26 | - <script src="spec/s-number.js"></script> | ||
27 | - <script src="spec/s-object.js"></script> | ||
28 | - <script src="spec/s-string.js"></script> | ||
29 | - | ||
30 | - | ||
31 | - <script type="text/javascript"> | ||
32 | - (function() { | ||
33 | - var jasmineEnv = jasmine.getEnv(); | ||
34 | - jasmineEnv.updateInterval = 1000; | ||
35 | - | ||
36 | - var trivialReporter = new jasmine.TrivialReporter(); | ||
37 | - | ||
38 | - jasmineEnv.addReporter(trivialReporter); | ||
39 | - | ||
40 | - jasmineEnv.specFilter = function(spec) { | ||
41 | - return trivialReporter.specFilter(spec); | ||
42 | - }; | ||
43 | - | ||
44 | - var currentWindowOnload = window.onload; | ||
45 | - | ||
46 | - window.onload = function() { | ||
47 | - if (currentWindowOnload) { | ||
48 | - currentWindowOnload(); | ||
49 | - } | ||
50 | - execJasmine(); | ||
51 | - }; | ||
52 | - | ||
53 | - function execJasmine() { | ||
54 | - jasmineEnv.execute(); | ||
55 | - } | ||
56 | - | ||
57 | - })(); | ||
58 | - </script> | ||
59 | - | ||
60 | -</head> | ||
61 | - | ||
62 | -<body> | ||
63 | -</body> | ||
64 | -</html> | 1 | +<!DOCTYPE HTML> |
2 | +<html> | ||
3 | +<head> | ||
4 | + <title>Jasmine Spec Runner</title> | ||
5 | + | ||
6 | + <link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png"> | ||
7 | + | ||
8 | + <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> | ||
9 | + <script type="text/javascript" src="lib/jasmine.js"></script> | ||
10 | + <script type="text/javascript" src="lib/jasmine-html.js"></script> | ||
11 | + <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | ||
12 | + | ||
13 | + | ||
14 | + <!-- include helper files here... --> | ||
15 | + <script src="helpers/h-matchers.js"></script> | ||
16 | + | ||
17 | + <!-- include source files here... --> | ||
18 | + <script src="../es5-shim.min.js"></script> | ||
19 | + | ||
20 | + <!-- include spec files here... --> | ||
21 | + <script src="spec/s-array.js"></script> | ||
22 | + <script src="spec/s-date.js"></script> | ||
23 | + <script src="spec/s-error.js"></script> | ||
24 | + <script src="spec/s-function.js"></script> | ||
25 | + <script src="spec/s-global.js"></script> | ||
26 | + <script src="spec/s-number.js"></script> | ||
27 | + <script src="spec/s-object.js"></script> | ||
28 | + <script src="spec/s-string.js"></script> | ||
29 | + | ||
30 | + | ||
31 | + <script type="text/javascript"> | ||
32 | + (function() { | ||
33 | + var jasmineEnv = jasmine.getEnv(); | ||
34 | + jasmineEnv.updateInterval = 1000; | ||
35 | + | ||
36 | + var trivialReporter = new jasmine.TrivialReporter(); | ||
37 | + | ||
38 | + jasmineEnv.addReporter(trivialReporter); | ||
39 | + | ||
40 | + jasmineEnv.specFilter = function(spec) { | ||
41 | + return trivialReporter.specFilter(spec); | ||
42 | + }; | ||
43 | + | ||
44 | + var currentWindowOnload = window.onload; | ||
45 | + | ||
46 | + window.onload = function() { | ||
47 | + if (currentWindowOnload) { | ||
48 | + currentWindowOnload(); | ||
49 | + } | ||
50 | + execJasmine(); | ||
51 | + }; | ||
52 | + | ||
53 | + function execJasmine() { | ||
54 | + jasmineEnv.execute(); | ||
55 | + } | ||
56 | + | ||
57 | + })(); | ||
58 | + </script> | ||
59 | + | ||
60 | +</head> | ||
61 | + | ||
62 | +<body> | ||
63 | +</body> | ||
64 | +</html> |
-
请 注册 或 登录 后发表评论