From 8b23a66e17ba59dea9615e5595e9f806eee0c3f2 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Mon, 28 Nov 2011 07:43:31 -0800 Subject: [PATCH] Add API for JSD to get the parent of a scope object, no bug. --- js/jsd/jsd_val.c | 2 +- js/src/jsdbgapi.cpp | 6 ++++++ js/src/jsdbgapi.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/js/jsd/jsd_val.c b/js/jsd/jsd_val.c index c0f9ca3c9fa5..571a01f393d4 100644 --- a/js/jsd/jsd_val.c +++ b/js/jsd/jsd_val.c @@ -747,7 +747,7 @@ jsd_GetValueParent(JSDContext* jsdc, JSDValue* jsdval) return NULL; } - parent = JS_GetParent(jsdc->dumbContext,obj); + parent = JS_GetParentOrScopeChain(jsdc->dumbContext,obj); JS_LeaveCrossCompartmentCall(call); JS_EndRequest(jsdc->dumbContext); if(!parent) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 71328ac0a919..f6b35e56d180 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -619,6 +619,12 @@ JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fpArg) return &fp->callee(); } +JS_PUBLIC_API(JSObject *) +JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj) +{ + return obj->scopeChain(); +} + JS_PUBLIC_API(JSBool) JS_IsConstructorFrame(JSContext *cx, JSStackFrame *fp) { diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 5a11045150d0..317414aaeb8a 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -279,6 +279,9 @@ JS_GetFrameFunction(JSContext *cx, JSStackFrame *fp); extern JS_PUBLIC_API(JSObject *) JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fp); +extern JS_PUBLIC_API(JSObject *) +JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj); + /* XXXrginda Initially published with typo */ #define JS_IsContructorFrame JS_IsConstructorFrame extern JS_PUBLIC_API(JSBool)