From c5fcb26173a0c1d96c4d0b59dbe7a60f4052ca36 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Tue, 18 May 2010 20:20:50 -0700 Subject: [PATCH] Properly mark undefined call and construct hooks of function proxies (bug 566781, r=shaver). --- js/src/jsproxy.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 42e6f39e203..0186b22639b 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -704,19 +704,12 @@ proxy_TraceObject(JSTracer *trc, JSObject *obj) obj->traceProtoAndParent(trc); - if (!JSVAL_IS_PRIMITIVE(obj->fslots[JSSLOT_PROXY_HANDLER])) { - JSObject *handler = JSVAL_TO_OBJECT(obj->fslots[JSSLOT_PROXY_HANDLER]); - JS_CALL_OBJECT_TRACER(trc, handler, "__handler__"); - } + JS_CALL_VALUE_TRACER(trc, obj->fslots[JSSLOT_PROXY_HANDLER], "handler"); if (obj->isFunctionProxy()) { - JSObject *call = JSVAL_TO_OBJECT(obj->fslots[JSSLOT_PROXY_CALL]); - if (call) - JS_CALL_OBJECT_TRACER(trc, call, "__call__"); - JSObject *construct = JSVAL_TO_OBJECT(obj->fslots[JSSLOT_PROXY_CONSTRUCT]); - if (construct) - JS_CALL_OBJECT_TRACER(trc, construct, "__construct__"); + JS_CALL_VALUE_TRACER(trc, obj->fslots[JSSLOT_PROXY_CALL], "call"); + JS_CALL_VALUE_TRACER(trc, obj->fslots[JSSLOT_PROXY_CONSTRUCT], "construct"); } else { - JS_CALL_VALUE_TRACER(trc, obj->fslots[JSSLOT_PROXY_PRIVATE], "__private__"); + JS_CALL_VALUE_TRACER(trc, obj->fslots[JSSLOT_PROXY_PRIVATE], "private"); } }