MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 487845 of Object.prototype.unwatch()

  • Revision slug: Web/JavaScript/Reference/Global_Objects/Object/unwatch
  • Revision title: Object.unwatch
  • Revision id: 487845
  • Created:
  • Creator: kohei.yoshino
  • Is current revision? No
  • Comment

Revision Content

{{Non-standard_header}}

Summary

Removes a watchpoint set with the watch() method.

Method of Object
Implemented in JavaScript 1.8.6 {{todo("1.2 ?")}}
ECMAScript Edition none

Syntax

object.unwatch(prop)

Parameters

prop
The name of a property of the object to stop watching.

Description

The JavaScript debugger has functionality similar to that provided by this method, as well as other debugging options. For information on the debugger, see Venkman.

By default, this method is inherited by every object descended from Object.

Note: The reason for unwatch() to take the property name prop as its only parameter is due to the "single handler allowing" behavior of the watch() method.
Note: Calling unwatch() on the {{ domxref("Document") }} object throws a TypeError since Firefox 23 ({{ bug(903332) }}). This regression has been fixed with Firefox 28.

Examples

See watch().

Revision Source

<div>
 {{Non-standard_header}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>Removes a watchpoint set with the <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch" title="JavaScript/Reference/Global_Objects/Object/watch">watch()</a></code> method.</p>
<table class="standard-table">
 <thead>
  <tr>
   <th class="header" colspan="2">Method of <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object" title="JavaScript/Reference/Global_Objects/Object"><code>Object</code></a></th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>Implemented in</td>
   <td>JavaScript 1.8.6 {{todo("1.2 ?")}}</td>
  </tr>
  <tr>
   <td>ECMAScript Edition</td>
   <td>none</td>
  </tr>
 </tbody>
</table>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<code><var>object</var>.unwatch(<em>prop</em>)</code></pre>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<dl>
 <dt>
  <code>prop</code></dt>
 <dd>
  The name of a property of the object to stop watching.</dd>
</dl>
<h2 id="Description" name="Description">Description</h2>
<p>The JavaScript debugger has functionality similar to that provided by this method, as well as other debugging options. For information on the debugger, see <a href="/en-US/docs/Venkman" title="Venkman">Venkman</a>.</p>
<p>By default, this method is inherited by every object descended from <code>Object</code>.</p>
<div class="note">
 <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 <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch" title="watch"><code>watch()</code></a> method.</div>
<div class="note">
 <strong>Note:</strong> Calling <code>unwatch()</code> on the {{ domxref("Document") }} object throws a <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError"><code>TypeError</code></a> since Firefox&nbsp;23 ({{ bug(903332) }}). This regression has been fixed with Firefox&nbsp;28.</div>
<h2 id="Examples" name="Examples">Examples</h2>
<p>See <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch" title="JavaScript/Reference/Global_Objects/Object/watch">watch()</a></code>.</p>
Revert to this revision