|
5 | 5 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {})); |
6 | 6 | }(this, (function (exports) { 'use strict'; |
7 | 7 |
|
8 | | - // Polyfills |
9 | | - if (Number.EPSILON === undefined) { |
10 | | - Number.EPSILON = Math.pow(2, -52); |
11 | | - } |
12 | | - |
13 | | - if (Number.isInteger === undefined) { |
14 | | - // Missing in IE |
15 | | - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger |
16 | | - Number.isInteger = function (value) { |
17 | | - return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; |
18 | | - }; |
19 | | - } // |
20 | | - |
21 | | - |
22 | | - if (Math.sign === undefined) { |
23 | | - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign |
24 | | - Math.sign = function (x) { |
25 | | - return x < 0 ? -1 : x > 0 ? 1 : +x; |
26 | | - }; |
27 | | - } |
28 | | - |
29 | | - if ('name' in Function.prototype === false) { |
30 | | - // Missing in IE |
31 | | - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name |
32 | | - Object.defineProperty(Function.prototype, 'name', { |
33 | | - get: function get() { |
34 | | - return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]; |
35 | | - } |
36 | | - }); |
37 | | - } |
38 | | - |
39 | | - if (Object.assign === undefined) { |
40 | | - // Missing in IE |
41 | | - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign |
42 | | - Object.assign = function (target) { |
43 | | - |
44 | | - if (target === undefined || target === null) { |
45 | | - throw new TypeError('Cannot convert undefined or null to object'); |
46 | | - } |
47 | | - |
48 | | - var output = Object(target); |
49 | | - |
50 | | - for (var index = 1; index < arguments.length; index++) { |
51 | | - var source = arguments[index]; |
52 | | - |
53 | | - if (source !== undefined && source !== null) { |
54 | | - for (var nextKey in source) { |
55 | | - if (Object.prototype.hasOwnProperty.call(source, nextKey)) { |
56 | | - output[nextKey] = source[nextKey]; |
57 | | - } |
58 | | - } |
59 | | - } |
60 | | - } |
61 | | - |
62 | | - return output; |
63 | | - }; |
64 | | - } |
65 | | - |
66 | 8 | /** |
67 | 9 | * Copyright (c) 2014-present, Facebook, Inc. |
68 | 10 | * |
|
0 commit comments