aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/object
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
commita065e04d529da1d847b5062a12c46d916408bf32 (patch)
treefe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/zh-cn/web/javascript/reference/global_objects/object
parent218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff)
downloadtranslated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/count/index.html88
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html85
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html93
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html208
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html160
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html43
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html133
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html105
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html201
9 files changed, 0 insertions, 1116 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html
deleted file mode 100644
index c7dfb12f2b..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html
+++ /dev/null
@@ -1,88 +0,0 @@
----
-title: Object.prototype.__count__
-slug: Web/JavaScript/Reference/Global_Objects/Object/count
-tags:
- - JavaScript
- - Object
- - Obsolete
- - Property
- - Prototype
-translation_of: Archive/Web/JavaScript/Object.count
----
-<div>{{JSRef}} {{obsolete_header("2")}}</div>
-
-<p> <strong><code>__count__</code></strong> 属性曾经用来存放对象的可枚举的属性的个数,但是已经被废除。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code><var>obj</var>.__count__</code></pre>
-
-<h2 id="示例">示例</h2>
-
-<pre class="brush: js">{ 1: 1 }.__count__ // 1
-[].__count__ // 0
-[1].__count__ // 1
-[1, /* hole */, 2, 3].__count__ // 3
-</pre>
-
-<h2 id="详细说明">详细说明</h2>
-
-<p>无需详细说明</p>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="更多请参看">更多请参看</h2>
-
-<ul>
- <li><a class="external" href="http://whereswalden.com/2010/04/06/more-changes-coming-to-spidermonkey-the-magical-__count__-property-of-objects-is-being-removed/">[Blog post] More changes coming to SpiderMonkey: the magical __count__ property is being removed</a></li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html
deleted file mode 100644
index e823c314a8..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html
+++ /dev/null
@@ -1,85 +0,0 @@
----
-title: Object.prototype.eval()
-slug: Web/JavaScript/Reference/Global_Objects/Object/eval
-translation_of: Archive/Web/JavaScript/Object.eval
----
-<div>{{JSRef}} {{obsolete_header}}</div>
-
-<p><code><strong>Object.eval()</strong></code> 方法用于在对象的上下文中对 JavaScript 代码字符串求值,但该方法已被移除。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code><var>obj</var>.eval(<var>string</var>)</code></pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>string</code></dt>
- <dd>包含任意 JavaScript 表达式、语句或一组语句的字符串。表达式中可包含已有对象的变量与属性。</dd>
-</dl>
-
-<h2 id="描述">描述</h2>
-
-<p><code>eval</code> 方法已从对象方法中移除。可使用全局 {{jsxref("Global_Objects/eval", "eval()")}} 函数替代该方法。</p>
-
-<h2 id="规范">规范</h2>
-
-<p>暂无规范</p>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="相关链接">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Global_Objects/eval", "eval()")}}</li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html
deleted file mode 100644
index fac0573de3..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html
+++ /dev/null
@@ -1,93 +0,0 @@
----
-title: Object.getNotifier()
-slug: Web/JavaScript/Reference/Global_Objects/Object/getNotifier
-translation_of: Archive/Web/JavaScript/Object.getNotifier
----
-<div>{{JSRef}} {{obsolete_header}}</div>
-
-<p><strong><code>Object.getNotifer()</code></strong> 方法用于创建可人工触发 change 事件的对象,但该方法在浏览器中已被废弃。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox">Object.getNotifier(<em>obj</em>)</pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>obj</code></dt>
- <dd>获取通知的对象。</dd>
-</dl>
-
-<h3 id="返回值">返回值</h3>
-
-<p>与传入对象相关联的通知对象。</p>
-
-<h2 id="描述">描述</h2>
-
-<p><code><font face="Open Sans, Arial, sans-serif">通知对象可触发 </font>Object.observe() 所观察到的人工变动。</code></p>
-
-<h2 id="规范">规范</h2>
-
-<p><a href="https://github.com/arv/ecmascript-object-observe">Strawman proposal specification.</a></p>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatChrome("36")}} [1]</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatChrome("36")}} [1]</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<p>[1] Deprecated in Chrome 49.</p>
-
-<h2 id="相关链接">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Object.observe()")}} {{obsolete_inline}}</li>
- <li>{{jsxref("Object.unobserve()")}} {{obsolete_inline}}</li>
- <li>{{jsxref("Array.observe()")}} {{obsolete_inline}}</li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html
deleted file mode 100644
index 7b54198c19..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html
+++ /dev/null
@@ -1,208 +0,0 @@
----
-title: Object.prototype.__noSuchMethod__
-slug: Web/JavaScript/Reference/Global_Objects/Object/noSuchMethod
-translation_of: Archive/Web/JavaScript/Object.noSuchMethod
----
-<div>{{JSRef}} {{obsolete_header}}</div>
-
-<p><strong><code>__noSuchMethod__</code></strong> 属性曾经是指当调用某个对象里不存在的方法时即将被执行的函数,但是现在这个函数已经不可用。</p>
-
-<p><code><font face="Open Sans, Arial, sans-serif">在</font><strong>__noSuchMethod__</strong></code> 属性被移除之后,ECMAScript 2015 (ES6) 规范转而采用 {{jsxref("Proxy")}} 对象, 可以实现下面的效果(以及更多)。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code><var>obj</var>.__noSuchMethod__ = <var>fun</var></code></pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>fun</code></dt>
- <dd>函数形式如下:</dd>
- <dd>
- <pre class="brush: js"><code>function (<var>id</var>, <var>args</var>) { . . . }</code></pre>
-
- <dl>
- <dt><code>id</code></dt>
- <dd>调用的不存在的方法名</dd>
- <dt><code>args</code></dt>
- <dd>传递给该方法的参数数组</dd>
- </dl>
- </dd>
-</dl>
-
-<h2 id="描述">描述</h2>
-
-<p>默认情况喜爱,试图调用对象上不存在的方法其结果是在{{jsxref("TypeError")}}上抛出异常,这种行为可以在</p>
-
-<p>By default, an attempt to call a method that doesn't exist on an object results in a {{jsxref("TypeError")}} being thrown. This behavior can be circumvented by defining a function at that object's <code>__noSuchMethod__</code> member. The function takes two arguments, the first is the name of the method attempted and the second is an array of the arguments that were passed in the method call. The second argument is an actual array (that is, it inherits through the {{jsxref("Array.prototype")}} chain) and not the array-like <a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments" title="JavaScript/Reference/Functions/arguments">arguments object</a>.</p>
-
-<p>If this method cannot be called, either as if <code>undefined</code> by default, if deleted, or if manually set to a non-function, the JavaScript engine will revert to throwing <code>TypeError</code>s.</p>
-
-<h2 id="Examples">Examples</h2>
-
-<h3 id="Simple_test_of___noSuchMethod__">Simple test of <code>__noSuchMethod__</code></h3>
-
-<pre class="brush: js">var o = {
- __noSuchMethod__: function(id, args) {
- console.log(id, '(' + args.join(', ') + ')');
- }
-};
-
-o.foo(1, 2, 3);
-o.bar(4, 5);
-o.baz();
-
-// Output
-// foo (1, 2, 3)
-// bar (4, 5)
-// baz ()
-</pre>
-
-<h3 id="Using___noSuchMethod___to_simulate_multiple_inheritance">Using <code>__noSuchMethod__</code> to simulate multiple inheritance</h3>
-
-<p>An example of code that implements a primitive form of multiple inheritance is shown below.</p>
-
-<pre class="brush: js">// Doesn't work with multiple inheritance objects as parents
-function noMethod(name, args) {
- var parents = this.__parents_;
-
- // Go through all parents
- for (var i = 0; i &lt; parents.length; i++) {
- // If we find a function on the parent, we call it
- if (typeof parents[i][name] == "function") {
- return parents[i][name].apply(this, args);
- }
- }
-
- // If we get here, the method hasn't been found
- throw new TypeError;
-}
-
-// Used to add a parent for multiple inheritance
-function addParent(obj, parent) {
- // If the object isn't initialized, initialize it
- if (!obj.__parents_) {
- obj.__parents_ = [];
- obj.__noSuchMethod__ = noMethod;
- }
-
- // Add the parent
- obj.__parents_.push(parent);
-}
-</pre>
-
-<p>An example of using this idea is shown below.</p>
-
-<pre class="brush: js">// Example base class 1
-function NamedThing(name){
- this.name=name;
-}
-
-NamedThing.prototype = {
- getName: function() { return this.name; },
- setName: function(newName) { this.name = newName; }
-}
-
-// Example base class 2
-function AgedThing(age) {
- this.age = age;
-}
-
-AgedThing.prototype = {
- getAge: function() { return this.age; },
- setAge: function(age) { this.age = age; }
-}
-
-// Child class. inherits from NamedThing and AgedThing
-// as well as defining address
-function Person(name, age, address){
- addParent(this, NamedThing.prototype);
- NamedThing.call(this, name);
- addParent(this, AgedThing.prototype);
- AgedThing.call(this, age);
- this.address = address;
-}
-
-Person.prototype = {
- getAddr: function() { return this.address; },
- setAddr: function(addr) { this.address = addr; }
-}
-
-var bob = new Person("bob", 25, "New York");
-
-console.log("getAge is " + (("getAge" in bob) ? "in" : "not in") + " bob");
-// getAge is not in bob
-
-console.log("bob's age is: " + bob.getAge());
-// bob's age is: 25
-
-console.log("getName is " + (("getName" in bob) ? "in" : "not in") + " bob");
-// getName is not in bob
-
-console.log("bob's name is: " + bob.getName());
-// bob's name is: bob
-
-console.log("getAddr is " + (("getAddr" in bob) ? "in" : "not in") + " bob");
-// getAddr is in bob
-
-console.log("bob's address is: " + bob.getAddr());
-// bob's address is: New York
-</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<p>Not part of any specifications. This feature has been removed, see {{bug(683218)}}.</p>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}} [1]</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}} [1]</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<p>[1] This feature was implemented until version 43.</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html
deleted file mode 100644
index e37cc6ab6f..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html
+++ /dev/null
@@ -1,160 +0,0 @@
----
-title: Object.observe()
-slug: Web/JavaScript/Reference/Global_Objects/Object/observe
-tags:
- - ECMAScript7
- - Experimental
- - JavaScript
- - Method
- - Object
- - observe
-translation_of: Archive/Web/JavaScript/Object.observe
----
-<div>{{JSRef}} {{obsolete_header}}</div>
-
-<h2 id="概述">概述</h2>
-
-<p><strong><code>Object.observe()</code></strong> 方法用于异步地监视一个对象的修改。当对象属性被修改时,方法的回调函数会提供一个有序的修改流。然而,这个接口已经被废弃并从各浏览器中移除。你可以使用更通用的 {{jsxref("Proxy")}} 对象替代。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code>Object.observe(<var>obj</var>, <var>callback</var></code>[, <var>acceptList</var>])</pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>obj</code></dt>
- <dd>被监控的对象.</dd>
- <dt><code>callback</code></dt>
- <dd>当对象被修改时触发的回调函数,其参数为:
- <dl>
- <dt><code>changes</code></dt>
- <dd>一个数组,其中包含的每一个对象代表一个修改行为。每个修改行为的对象包含:
- <ul>
- <li><strong><code>name</code></strong>: 被修改的属性名称<span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
- <li><strong><code>object</code></strong>: 修改后该对象的值<span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
- <li><strong><code>type</code></strong>: 表示对该对象做了何种类型的修改,可能的值为<code>"add"</code>, <code>"update"</code>, or <code>"delete"</code><span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
- <li><strong><code>oldValue</code></strong>: 对象修改前的值。该值只在<code>"update"<font face="Open Sans, sans-serif">与</font></code><code>"delete"有效。</code></li>
- <li> </li>
- </ul>
- </dd>
- <dt><font face="Consolas">acceptList</font></dt>
- <dd>在给定对象上给定回调中要监视的变化类型列表。如果省略, <code><font face="Courier New">["add", "update", "delete", "reconfigure", "setPrototype", "preventExtensions"]</font></code> 将会被使用。</dd>
- </dl>
- </dd>
-</dl>
-
-<h2 id="描述">描述</h2>
-
-<p><code style="font-style: normal;">callback</code> 函数会在<code>对象被改变时被调用,其参数为一个包含所有修改信息的有序的数组对象。</code></p>
-
-<h2 id="例子">例子</h2>
-
-<h3 id="例子_打印出三种不同操作类型的日志">例子: 打印出三种不同操作类型的日志</h3>
-
-<pre class="brush: js">var obj = {
- foo: 0,
- bar: 1
-};
-
-Object.observe(obj, function(changes) {
- console.log(changes);
-});
-
-obj.baz = 2;
-// [{name: 'baz', object: &lt;obj&gt;, type: 'add'}]
-
-obj.foo = 'hello';
-// [{name: 'foo', object: &lt;obj&gt;, type: 'update', oldValue: 0}]
-
-delete obj.baz;
-// [{name: 'baz', object: &lt;obj&gt;, type: 'delete', oldValue: 2}]
-</pre>
-
-<h3 id="例子_数据绑定">例子: 数据绑定</h3>
-
-<pre class="brush: js">// 一个数据模型
-var user = {
- id: 0,
- name: 'Brendan Eich',
- title: 'Mr.'
-};
-
-// 创建用户的greeting
-function updateGreeting() {
- user.greeting = 'Hello, ' + user.title + ' ' + user.name + '!';
-}
-updateGreeting();
-
-Object.observe(user, function(changes) {
- changes.forEach(function(change) {
- // 当name或title属性改变时, 更新greeting
- if (change.name === 'name' || change.name === 'title') {
- updateGreeting();
- }
- });
-});
-</pre>
-
-<h2 id="Specifications" name="Specifications">规范</h2>
-
-<p><a href="https://github.com/arv/ecmascript-object-observe">Strawman proposal for ECMAScript 7</a>.</p>
-
-<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatChrome("36")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatChrome("36")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="See_also" name="See_also">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Object.unobserve()")}} {{experimental_inline}}</li>
- <li>{{jsxref("Array.observe()")}} {{experimental_inline}}</li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html
deleted file mode 100644
index 8597b6c4a3..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: Object.prototype.__parent__
-slug: Web/JavaScript/Reference/Global_Objects/Object/Parent
-tags:
- - JavaScript
- - 原型
- - 对象
- - 属性
- - 已废弃
- - 非标准
-translation_of: Archive/Web/JavaScript/Object.parent
----
-<div>{{JSRef}}{{Non-standard_Header}}{{Obsolete_Header("gecko2")}}</div>
-
-<p>The <strong><code>__parent__</code></strong> property used to point to an object's context, but it has been removed.</p>
-
-<p>指向一个对象的上下文.</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><var>obj</var>.__parent__</pre>
-
-<h2 id="描述">描述</h2>
-
-<p>对于最顶层对象来说,这个属性的值就是全局对象 window。</p>
-
-<h2 id="规范">规范</h2>
-
-<p>不属于任何规范。</p>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-
-
-<p>{{Compat("javascript.builtins.Object.parent")}}</p>
-
-<h2 id="参见">参见</h2>
-
-<ul>
- <li><a class="external" href="http://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/">SpiderMonkey change du jour: the special __parent__ property has been removed</a></li>
- <li><a href="/zh-CN/docs/Components.utils.getGlobalForObject">Components.utils.getGlobalForObject</a></li>
- <li><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/Proto">__proto__</a></li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html
deleted file mode 100644
index bcae6ae8e7..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html
+++ /dev/null
@@ -1,133 +0,0 @@
----
-title: Object.unobserve()
-slug: Web/JavaScript/Reference/Global_Objects/Object/unobserve
-translation_of: Archive/Web/JavaScript/Object.unobserve
----
-<div>{{JSRef}} {{non-standard_header}}</div>
-
-<p><strong>Object.unobserve()</strong> 是用来移除通过 {{jsxref("Object.observe()")}}设置的观察者的方法。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code>Object.unobserve(<var>obj</var>, <var>callback</var>)</code></pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>obj</code></dt>
- <dd>需要停止观察的对象。</dd>
- <dt><code>callback</code></dt>
- <dd>通过 observer 给 <strong>obj </strong>对象设置的回调函数.</dd>
-</dl>
-
-<h2 id="描述">描述</h2>
-
-<p><code>Object.unobserve()</code> 用来在 {{jsxref("Object.observe()")}} 被调用以后,从对象上移除一个观察者。</p>
-
-<p>这个回调函数必须是一个函数的引用,而不能是一个匿名函数。因为这个引用将被用来移除之前设置的观察者方法。 给 <strong>Object.unobserve() </strong>传入匿名函数作为回调是不起作用的, 它不能移除任何观察者方法。</p>
-
-<h2 id="例子">例子</h2>
-
-<h3 id="观察一个对象">观察一个对象</h3>
-
-<pre class="brush: js">var obj = {
-  foo: 0,
-  bar: 1
-};
-
-var observer = function(changes) {
-  console.log(changes);
-}
-
-Object.observe(obj, observer);
-​
-obj.newProperty = 2;
-// [{name: 'newProperty', object: &lt;obj&gt;, type: 'add'}]
-
-Object.unobserve(obj, observer);
-
-obj.foo = 1;
-// 回调函数不会被调用</pre>
-
-<h3 id="使用匿名函数">使用匿名函数</h3>
-
-<pre class="brush: js">var person = {
-  name : 'Ahmed',
-  age : 25
-};
-
-Object.observe(person, function (changes) {
-  console.log(changes);
-});
-
-person.age = 40;
-// [{name: 'age', object: &lt;obj&gt;, oldValue: 25, type: 'update'}]
-
-Object.unobserve(person, function (changes) {
-  console.log(changes);
-});
-
-person.age = 63;
-// [{name: 'age', object: &lt;obj&gt;, oldValue: 40, type: 'update'}]
-// 回调函数将会被调用
-</pre>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatChrome("36")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatChrome("36")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("23")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="相关链接">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Object.observe()")}} {{non-standard_inline}}</li>
- <li>{{jsxref("Array.observe()")}} {{non-standard_inline}}</li>
- <li>{{jsxref("Array.unobserve()")}} {{non-standard_inline}}</li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html
deleted file mode 100644
index 986154992d..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Object.prototype.unwatch()
-slug: Web/JavaScript/Reference/Global_Objects/Object/unwatch
-translation_of: Archive/Web/JavaScript/Object.unwatch
----
-<div>{{JSRef}}</div>
-
-<div class="warning">
-<p><strong>警告 :</strong> 请尽量避免使用 unwatch() 和  {{jsxref("Object.prototype.watch", "watch()")}} . 这两个方法仅在 Gecko 中实现 , 并且他们过去主要作调试用. 另外, 使用 watchpoints 对性能有一系列的副面影响 ,特别是当使用全局对象,如 <code>window</code>. 你应该使用  <a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">setters and getters</a> 或 proxies 来替代. 查阅 {{anch("Browser compatibility")}} 以获取更多信息.</p>
-</div>
-
-<p><code><strong>unwatch()</strong></code> 删除一个 {{jsxref("Object.prototype.watch", "watch()")}} 设置的 watchpoint.</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code><var>obj</var>.unwatch(<var>prop</var>)</code></pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt><code>prop</code></dt>
- <dd>想要停止监视的对象的属性名</dd>
-</dl>
-
-<h2 id="描述">描述</h2>
-
-<p>JavaScript调试器具有类似的功能,以及其他调试选项。有关调试器的信息  <a href="/en-US/docs/Venkman">Venkman</a>.</p>
-
-<p>默认地, 这个方法 被每一个 {{jsxref("Object")}} 的子类继承 </p>
-
-<div class="note">
-<p><strong>Note:</strong> The reason for <code>unwatch()</code> to take the property name <em>prop</em> as its only parameter is due to the "single handler allowing" behavior of the {{jsxref("Object.watch", "watch()")}} method.</p>
-</div>
-
-<h2 id="例子">例子</h2>
-
-<p>See {{jsxref("Object.watch", "watch()")}}.</p>
-
-<h2 id="说明">说明</h2>
-
-<p>Not part of any specifications. Implemented in JavaScript 1.2.</p>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="Compatibility_notes">Compatibility notes</h2>
-
-<ul>
- <li>从 Firefox 23 ({{bug(903332)}}) 开始, 在 {{domxref("Document")}} 对象上调用 <code>unwatch()</code> 抛出 {{jsxref("TypeError")}} . This regression has been fixed with Firefox 27.</li>
-</ul>
-
-<h2 id="相关链接">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Object.watch()")}}</li>
-</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html
deleted file mode 100644
index 540967eee3..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html
+++ /dev/null
@@ -1,201 +0,0 @@
----
-title: Object.prototype.watch()
-slug: Web/JavaScript/Reference/Global_Objects/Object/watch
-tags:
- - Debugging
- - Deprecated
- - JavaScript
- - Method
- - Object
- - Obsolete
- - Prototype
-translation_of: Archive/Web/JavaScript/Object.watch
----
-<p>{{JSRef}}</p>
-
-<div class="warning">
-<p><strong>警告:</strong> 通常来讲,你应该尽量避免使用 <code>watch()</code>和  {{jsxref("Object.prototype.unwatch", "unwatch()")}} 这两个方法。因为只有 Gecko 实现了这两个方法,并且它们主要是为了在调试方便。另外,使用 watchpoint 对性能有严重的负面影响,在全局对象(如 window)上使用时尤其如此。你可以使用 <a href="/zh-cn/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters" title="https://developer.mozilla.org/zh-cn/Core_JavaScript_1.5_Guide/Working_with_Objects#Defining_getters_and_setters">setters and getters</a> 或者 proxy 代替。参见 {{ anch("Compatibility") }} 了解详情。</p>
-</div>
-
-<p><code><strong>watch() </strong></code>方法会监视属性是否被赋值并在赋值时运行相关函数。</p>
-
-<h2 id="Summary" name="Summary">语法</h2>
-
-<pre class="syntaxbox"><em>obj</em>.watch(<em>prop</em>, <em>handler</em>)</pre>
-
-<h3 id="Parameters" name="Parameters">参数</h3>
-
-<dl>
- <dt><code>prop</code></dt>
- <dd>想要监视值是否发生变化的指定对象的某个属性的属性名称</dd>
-</dl>
-
-<dl>
- <dt><code>handler</code></dt>
- <dd>当指定的属性发生变化时执行的回调函数</dd>
-</dl>
-
-<h3 id="返回值">返回值</h3>
-
-<p>{{jsxref("undefined")}}.</p>
-
-<h2 id="Description" name="Description">描述</h2>
-
-<p>监视对指定对象的名为 <code>prop</code> 属性的赋值操作,只要 <code>prop</code> 属性被赋值,便调用 <code>handler(prop, oldval, newval)</code> 回调函数,并将函数返回值保存到该属性。 通过返回修改的新值(或者返回旧值),一个监视点可以过滤(或使之为 null )赋值。</p>
-
-<p>如果你删除某个设置监视点的属性,该监视点并不会消失。如果你之后重新创建这个属性,监视点仍然有效。</p>
-
-<p>要移除某个监视点,使用 <code><a href="/zh-cn/JavaScript/Reference/Global_Objects/Object/unwatch" title="zh-cn/JavaScript/Reference/Global_Objects/Object/unwatch">unwatch()</a></code> 方法。默认所有 <code>Object</code> 的后代都将继承 <code>watch</code> 方法。</p>
-
-<p>JavaScript 调试器有与之相似的机制以及其它调试选项。需要更多有关调试器的信息,请查阅 <a href="/zh-cn/Venkman" title="zh-cn/Venkman">Venkman</a>。</p>
-
-<p>对于 Firefox,<code>handler</code> 只会被脚本内的赋值操作激活,并不包括本地代码。举个例子,如果用户点击一个指向当前文档内的某个锚点, <code>window.watch('location', myHandler)</code> 不会回调 <code>myHandler</code> ,但 <code>window.location += '#myAnchor'</code> 将触发回调  <code>myHandler</code>。</p>
-
-<div class="note"><strong>注意:</strong> 对一个对象的指定属性调用 <code>watch()</code>  将覆盖先前关联的 handler。</div>
-
-<h2 id="Examples" name="Examples">例子</h2>
-
-<h3 id="Example_Using_watch_and_unwatch" name="Example:_Using_watch_and_unwatch">使用 <code>watch</code> 和 <code>unwatch</code></h3>
-
-<pre class="brush: js">var o = {p:1};
-o.watch("p",
- function (id, oldval, newval) {
- console.log("o." + id + "由" + oldval + " 变为 " + newval);
- return newval;
- });
-
-o.p = 2;
-o.p = 3;
-delete o.p;
-o.p = 4;
-
-o.unwatch('p');
-o.p = 5;
-</pre>
-
-<p>上面的代码显示结果如下:</p>
-
-<pre class="eval">o.p 由 1 变为 2
-o.p 由 2 变为 3
-o.p 由 undefined 变为 4
-</pre>
-
-<h3 id="Example_Using_watch_to_validate_an_object.27s_properties" name="Example:_Using_watch_to_validate_an_object.27s_properties">使用 <code>watch</code> 来验证一个对象的属性</h3>
-
-<p>你可以使用 <code>watch</code> 来检测一个对象的属性赋值是否是合法的.下例演示了如何确保每个人始终具有一个合法的名字和0 到 200之间的年龄.</p>
-
-<pre class="brush: js">Person = function(name,age) {
- this.watch("age", Person.prototype._isValidAssignment);
- this.watch("name", Person.prototype._isValidAssignment);
- this.name = name;
- this.age = age;
-}
-
-Person.prototype.toString = function() {
- return this.name + ", " + this.age;
-};
-
-Person.prototype._isValidAssignment = function(id, oldval, newval) {
- if (id === "name" &amp;&amp; (!newval || newval.length &gt; 30)) {
- throw new RangeError("不合法的名字 " + this);
- }
- if (id === "age" &amp;&amp; (newval &lt; 0 || newval &gt; 200)) {
- throw new RangeError("不合法的年龄 " + this);
- }
- return newval;
-}
-
-will = new Person("Will", 29);
-print(will); // Will, 29
-
-try {
- will.name = "";
-} catch (e) {
- //print(e);
- console.log(e);
-}
-
-try {
- will.age = -4;
-} catch (e) {
- console.log(e);
-}
-</pre>
-
-<p>上面的代码显示结果如下:</p>
-
-<pre class="eval">Will, 29
-RangeError: 不合法的名字 Will, 29
-RangeError: 不合法的年龄 Will, 29
-</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<p>不是任何规范的一部分。从 JavaScript 1.2 开始实现。</p>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="兼容性提示">兼容性提示</h2>
-
-<ul>
- <li>此 <a href="https://gist.github.com/384583">Polyfill</a> 为所有 ES5 兼容浏览器提供 <code>watch</code> 支持。</li>
- <li>使用 {{jsxref("Proxy")}} 允许你更加深度地调整属性服务机制</li>
- <li>从 Firefox 23 开始,在 {{domxref("Document")}} 对象上调用 <code>watch()</code> 将抛出 {{jsxref("TypeError")}} 错误。这个回归问题已经在 Firefox 27 修复。</li>
-</ul>
-
-<h2 id="See_Also" name="See_Also">相关链接</h2>
-
-<ul>
- <li>{{jsxref("Object.unwatch()")}}</li>
- <li>{{jsxref("Object.observe()")}} {{obsolete_inline}}</li>
-</ul>