Deprecation warning:
Do not use
unwatch()
and
watch()
! These two methods were implemented only in Firefox prior to version 58, they're
deprecated and removed in Firefox 58+
. In addition, using watchpoints has a serious negative impact on performance, which is especially true when used on global objects, such as
window
. You can usually use
setters and getters
or
proxies
代替。
unwatch()
method removes a watchpoint set with the
watch()
方法。
obj.unwatch(prop)
prop
The name of a property of the object to stop watching.
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
.
注意:
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()
方法。
见
watch()
.
Not part of any standard.
unwatch()
on the
Document
object throws a
TypeError
since Firefox 23 (
bug 903332
). This regression has been fixed with Firefox 27.
Archive
Function
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.unwatch()
Object.prototype.valueOf()
Object.prototype.watch()
Object.setPrototypeOf()