]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/polyfills/object-assign.js
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / 3rdparty / civetweb / src / third_party / duktape-1.5.2 / polyfills / object-assign.js
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/polyfills/object-assign.js b/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/polyfills/object-assign.js
new file mode 100644 (file)
index 0000000..dfa5a44
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ *  Object.assign(), described in E6 Section 19.1.2.1
+ *
+ *  http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.assign
+ */
+
+if (typeof Object.assign === 'undefined') {
+   Object.defineProperty(Object, 'assign', {
+       value: function (target) {
+           var i, n, j, m, k;
+           var source, keys;
+           var gotError;
+           var pendingError;
+
+           if (target == null) {
+               throw new Exception('target null or undefined');
+           }
+
+           for (i = 1, n = arguments.length; i < n; i++) {
+               source = arguments[i];
+               if (source == null) {
+                   continue;  // null or undefined
+               }
+               source = Object(source);
+               keys = Object.keys(source);  // enumerable own keys
+
+               for (j = 0, m = keys.length; j < m; j++) {
+                   k = keys[j];
+                   try {
+                       target[k] = source[k];
+                   } catch (e) {
+                       if (!gotError) {
+                           gotError = true;
+                           pendingError = e;
+                       }
+                   }
+               }
+           }
+
+           if (gotError) {
+               throw pendingError;
+           }
+       }, writable: true, enumerable: false, configurable: true
+   });
+}