Skip to content

Commit 07c59fd

Browse files
committed
fix(cdn): Polyfill Object.assign for ES5
I copy-pasted the polyfill that rollup-typescript uses for object spreads.
1 parent 7977442 commit 07c59fd

File tree

1 file changed

+10
-0
lines changed
  • dev-packages/rollup-utils/polyfills

1 file changed

+10
-0
lines changed

dev-packages/rollup-utils/polyfills/es5.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ if (!('endsWith' in String.prototype)) {
3939
return i > -1 && i === this.length - searchElement.length;
4040
};
4141
}
42+
43+
if (!('assign' in Object)) {
44+
Object.assign = function __assign(t) {
45+
for (var s, i = 1, n = arguments.length; i < n; i++) {
46+
s = arguments[i];
47+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48+
}
49+
return t;
50+
};
51+
}

0 commit comments

Comments
 (0)