summaryrefslogtreecommitdiffstats
path: root/node_modules/object.assign/polyfill.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/object.assign/polyfill.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/object.assign/polyfill.js')
-rw-r--r--node_modules/object.assign/polyfill.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/node_modules/object.assign/polyfill.js b/node_modules/object.assign/polyfill.js
deleted file mode 100644
index ca94aea..0000000
--- a/node_modules/object.assign/polyfill.js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict';
-
-var implementation = require('./implementation');
-
-var lacksProperEnumerationOrder = function () {
- if (!Object.assign) {
- return false;
- }
- /*
- * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
- * note: this does not detect the bug unless there's 20 characters
- */
- var str = 'abcdefghijklmnopqrst';
- var letters = str.split('');
- var map = {};
- for (var i = 0; i < letters.length; ++i) {
- map[letters[i]] = letters[i];
- }
- var obj = Object.assign({}, map);
- var actual = '';
- for (var k in obj) {
- actual += k;
- }
- return str !== actual;
-};
-
-var assignHasPendingExceptions = function () {
- if (!Object.assign || !Object.preventExtensions) {
- return false;
- }
- /*
- * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
- * which is 72% slower than our shim, and Firefox 40's native implementation.
- */
- var thrower = Object.preventExtensions({ 1: 2 });
- try {
- Object.assign(thrower, 'xy');
- } catch (e) {
- return thrower[1] === 'y';
- }
- return false;
-};
-
-module.exports = function getPolyfill() {
- if (!Object.assign) {
- return implementation;
- }
- if (lacksProperEnumerationOrder()) {
- return implementation;
- }
- if (assignHasPendingExceptions()) {
- return implementation;
- }
- return Object.assign;
-};