зеркало из https://github.com/mozilla/gecko-dev.git
Bug 631305 - Deleted watchpoints don't always come back when assigned. r=brendan, a=sayrer.
This commit is contained in:
Родитель
b91cbe40d0
Коммит
94d579a7fc
|
@ -0,0 +1,9 @@
|
||||||
|
var n = 0;
|
||||||
|
var a = [];
|
||||||
|
for (var i = 0; i < 20; i++)
|
||||||
|
a[i] = {};
|
||||||
|
a[18].watch("p", function () { n++; });
|
||||||
|
delete a[18].p;
|
||||||
|
for (var i = 0; i < 20; i++)
|
||||||
|
a[i].p = 0;
|
||||||
|
assertEq(n, 1);
|
|
@ -1034,6 +1034,13 @@ JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,
|
||||||
JS_APPEND_LINK(&wp->links, &rt->watchPointList);
|
JS_APPEND_LINK(&wp->links, &rt->watchPointList);
|
||||||
++rt->debuggerMutations;
|
++rt->debuggerMutations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ensure that an object with watchpoints never has the same shape as an
|
||||||
|
* object without them, even if the watched properties are deleted.
|
||||||
|
*/
|
||||||
|
obj->watchpointOwnShapeChange(cx);
|
||||||
|
|
||||||
wp->handler = handler;
|
wp->handler = handler;
|
||||||
wp->closure = reinterpret_cast<JSObject*>(closure);
|
wp->closure = reinterpret_cast<JSObject*>(closure);
|
||||||
DBG_UNLOCK(rt);
|
DBG_UNLOCK(rt);
|
||||||
|
|
|
@ -518,6 +518,7 @@ struct JSObject : js::gc::Cell {
|
||||||
void protoShapeChange(JSContext *cx);
|
void protoShapeChange(JSContext *cx);
|
||||||
void shadowingShapeChange(JSContext *cx, const js::Shape &shape);
|
void shadowingShapeChange(JSContext *cx, const js::Shape &shape);
|
||||||
bool globalObjectOwnShapeChange(JSContext *cx);
|
bool globalObjectOwnShapeChange(JSContext *cx);
|
||||||
|
void watchpointOwnShapeChange(JSContext *cx) { generateOwnShape(cx); }
|
||||||
|
|
||||||
void extensibleShapeChange(JSContext *cx) {
|
void extensibleShapeChange(JSContext *cx) {
|
||||||
/* This will do for now. */
|
/* This will do for now. */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче