aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects
diff options
context:
space:
mode:
authorAtsuto Yamashita <atyamash@yahoo-corp.jp>2022-03-15 19:47:35 +0900
committerGitHub <noreply@github.com>2022-03-15 19:47:35 +0900
commit9bf38df91fadd199a5ea45ad79d5e111ddfb3fe0 (patch)
tree71952407ea41c86feabef4214610d59e15aae55d /files/zh-cn/web/javascript/reference/global_objects
parentc2678137db5f97ad1fe39e872529159a1afafec1 (diff)
parent9e7fbb013772ebab9b35185f0d0836995acbe6db (diff)
downloadtranslated-content-9bf38df91fadd199a5ea45ad79d5e111ddfb3fe0.tar.gz
translated-content-9bf38df91fadd199a5ea45ad79d5e111ddfb3fe0.tar.bz2
translated-content-9bf38df91fadd199a5ea45ad79d5e111ddfb3fe0.zip
Merge branch 'main' into fix-typo-client-side-web-apis-intro-ja
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html33
1 files changed, 0 insertions, 33 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html
index 4b8696d2ab..616406e3e5 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html
@@ -251,39 +251,6 @@ console.log(copy);
// { foo:1, get bar() { return 2 } }
</pre>
-<h2 id="Polyfill">Polyfill</h2>
-
-<p>此{{Glossary("Polyfill","polyfill")}}不支持 symbol 属性,因为ES5 中根本没有 symbol :</p>
-
-<pre class="brush: js">if (typeof Object.assign != 'function') {
- // Must be writable: true, enumerable: false, configurable: true
- Object.defineProperty(Object, "assign", {
- value: function assign(target, varArgs) { // .length of function is 2
- 'use strict';
- if (target == null) { // TypeError if undefined or null
- throw new TypeError('Cannot convert undefined or null to object');
- }
-
- let to = Object(target);
-
- for (var index = 1; index &lt; arguments.length; index++) {
- var nextSource = arguments[index];
-
- if (nextSource != null) { // Skip over if undefined or null
- for (let nextKey in nextSource) {
- // Avoid bugs when hasOwnProperty is shadowed
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
- to[nextKey] = nextSource[nextKey];
- }
- }
- }
- }
- return to;
- },
- writable: true,
- configurable: true
- });
-}</pre>
<h2 id="Specifications">规范</h2>