1 |
|
2 |
|
3 | if ( Number.EPSILON === undefined ) {
|
4 |
|
5 | Number.EPSILON = Math.pow( 2, - 52 );
|
6 |
|
7 | }
|
8 |
|
9 | if ( Number.isInteger === undefined ) {
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | Number.isInteger = function ( value ) {
|
15 |
|
16 | return typeof value === 'number' && isFinite( value ) && Math.floor( value ) === value;
|
17 |
|
18 | };
|
19 |
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | if ( Math.sign === undefined ) {
|
25 |
|
26 |
|
27 |
|
28 | Math.sign = function ( x ) {
|
29 |
|
30 | return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x;
|
31 |
|
32 | };
|
33 |
|
34 | }
|
35 |
|
36 | if ( 'name' in Function.prototype === false ) {
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | Object.defineProperty( Function.prototype, 'name', {
|
42 |
|
43 | get: function () {
|
44 |
|
45 | return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ];
|
46 |
|
47 | }
|
48 |
|
49 | } );
|
50 |
|
51 | }
|
52 |
|
53 | if ( Object.assign === undefined ) {
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | Object.assign = function ( target ) {
|
59 |
|
60 | 'use strict';
|
61 |
|
62 | if ( target === undefined || target === null ) {
|
63 |
|
64 | throw new TypeError( 'Cannot convert undefined or null to object' );
|
65 |
|
66 | }
|
67 |
|
68 | const output = Object( target );
|
69 |
|
70 | for ( let index = 1; index < arguments.length; index ++ ) {
|
71 |
|
72 | const source = arguments[ index ];
|
73 |
|
74 | if ( source !== undefined && source !== null ) {
|
75 |
|
76 | for ( const nextKey in source ) {
|
77 |
|
78 | if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) {
|
79 |
|
80 | output[ nextKey ] = source[ nextKey ];
|
81 |
|
82 | }
|
83 |
|
84 | }
|
85 |
|
86 | }
|
87 |
|
88 | }
|
89 |
|
90 | return output;
|
91 |
|
92 | };
|
93 |
|
94 | }
|