Skip to content

Commit 4dc67f4

Browse files
Andaristrbuckton
authored andcommitted
Update helpers to use redefining pattern if needed (related to microsoft/TypeScript#24244) (#54)
1 parent a921045 commit 4dc67f4

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tslib.es6.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,28 @@ and limitations under the License.
1414
***************************************************************************** */
1515
/* global Reflect, Promise */
1616

17-
var extendStatics = Object.setPrototypeOf ||
18-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
17+
var extendStatics = function(d, b) {
18+
extendStatics = Object.setPrototypeOf ||
19+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
21+
return extendStatics(d, b);
22+
};
2023

2124
export function __extends(d, b) {
2225
extendStatics(d, b);
2326
function __() { this.constructor = d; }
2427
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2528
}
2629

27-
export var __assign = Object.assign || function __assign(t) {
28-
for (var s, i = 1, n = arguments.length; i < n; i++) {
29-
s = arguments[i];
30-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
30+
export var __assign = function() {
31+
__assign = Object.assign || function __assign(t) {
32+
for (var s, i = 1, n = arguments.length; i < n; i++) {
33+
s = arguments[i];
34+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
35+
}
36+
return t;
3137
}
32-
return t;
38+
return __assign.apply(this, arguments);
3339
}
3440

3541
export function __rest(s, e) {

0 commit comments

Comments
 (0)