diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index be45f478ad5b..5aa6993bb36d 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -289,32 +289,3 @@ BEGIN_TEST(testDebugger_singleStepThrow) return JSTRAP_CONTINUE; } END_TEST(testDebugger_singleStepThrow) - -BEGIN_TEST(testDebugger_emptyObjectPropertyIterator) -{ - JSObject *obj = JS_NewObject(cx, NULL, NULL, NULL); - JSScopeProperty *prop = NULL; - CHECK(!JS_PropertyIterator(obj, &prop)); - CHECK(!prop); - - return true; -} -END_TEST(testDebugger_emptyObjectPropertyIterator) - -BEGIN_TEST(testDebugger_nonEmptyObjectPropertyIterator) -{ - jsval v; - EVAL("({a: 15})", &v); - JSObject *obj = JSVAL_TO_OBJECT(v); - JSScopeProperty *prop = NULL; - CHECK(JS_PropertyIterator(obj, &prop)); - JSPropertyDesc desc; - CHECK(JS_GetPropertyDesc(cx, obj, prop, &desc)); - CHECK_EQUAL(JSVAL_IS_INT(desc.value), true); - CHECK_EQUAL(JSVAL_TO_INT(desc.value), 15); - CHECK(!JS_PropertyIterator(obj, &prop)); - CHECK(!prop); - - return true; -} -END_TEST(testDebugger_nonEmptyObjectPropertyIterator) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 81cc50ada6e3..c191540608b7 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -782,32 +782,10 @@ JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp, /* This all should be reworked to avoid requiring JSScopeProperty types. */ -JS_PUBLIC_API(JSScopeProperty *) -JS_PropertyIterator(JSObject *obj, JSScopeProperty **iteratorp) -{ - const Shape *shape; - - /* The caller passes null in *iteratorp to get things started. */ - shape = (Shape *) *iteratorp; - if (!shape) - shape = obj->lastProperty(); - else - shape = shape->previous(); - - if (!shape->previous()) { - JS_ASSERT(shape->isEmptyShape()); - shape = NULL; - } - - return *iteratorp = reinterpret_cast(const_cast(shape)); -} - -JS_PUBLIC_API(JSBool) -JS_GetPropertyDesc(JSContext *cx, JSObject *obj_, JSScopeProperty *sprop, - JSPropertyDesc *pd) +static JSBool +GetPropertyDesc(JSContext *cx, JSObject *obj_, Shape *shape, JSPropertyDesc *pd) { assertSameCompartment(cx, obj_); - Shape *shape = (Shape *) sprop; pd->id = IdToJsval(shape->propid()); RootedVarObject obj(cx, obj_); @@ -855,6 +833,7 @@ JS_PUBLIC_API(JSBool) JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda) { assertSameCompartment(cx, obj); + Class *clasp = obj->getClass(); if (!obj->isNative() || (clasp->flags & JSCLASS_NEW_ENUMERATE)) { JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, @@ -882,7 +861,7 @@ JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda) if (!js_AddRoot(cx, &pd[i].value, NULL)) goto bad; Shape *shape = const_cast(&r.front()); - if (!JS_GetPropertyDesc(cx, obj, reinterpret_cast(shape), &pd[i])) + if (!GetPropertyDesc(cx, obj, shape, &pd[i])) goto bad; if ((pd[i].flags & JSPD_ALIAS) && !js_AddRoot(cx, &pd[i].alias, NULL)) goto bad; diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 445172d01097..73d75039708b 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -374,13 +374,6 @@ typedef struct JSPropertyDescArray { typedef struct JSScopeProperty JSScopeProperty; -extern JS_PUBLIC_API(JSScopeProperty *) -JS_PropertyIterator(JSObject *obj, JSScopeProperty **iteratorp); - -extern JS_PUBLIC_API(JSBool) -JS_GetPropertyDesc(JSContext *cx, JSObject *obj, JSScopeProperty *shape, - JSPropertyDesc *pd); - extern JS_PUBLIC_API(JSBool) JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index e3cf054398f4..419299b2ba61 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1965,43 +1965,6 @@ DisassWithSrc(JSContext *cx, unsigned argc, jsval *vp) #undef LINE_BUF_LEN } -static void -DumpScope(JSContext *cx, JSObject *obj, FILE *fp) -{ - unsigned i = 0; - for (JSScopeProperty *sprop = NULL; JS_PropertyIterator(obj, &sprop);) { - fprintf(fp, "%3u %p ", i++, (void *) sprop); - ((Shape *) sprop)->dump(cx, fp); - } -} - -static JSBool -DumpStats(JSContext *cx, unsigned argc, jsval *vp) -{ - jsval *argv = JS_ARGV(cx, vp); - for (unsigned i = 0; i < argc; i++) { - JSString *str = JS_ValueToString(cx, argv[i]); - if (!str) - return JS_FALSE; - argv[i] = STRING_TO_JSVAL(str); - JSFlatString *flatStr = JS_FlattenString(cx, str); - if (!flatStr) - return JS_FALSE; - if (JS_FlatStringEqualsAscii(flatStr, "atom")) { - js_DumpAtoms(cx, gOutFile); - } else if (JS_FlatStringEqualsAscii(flatStr, "global")) { - DumpScope(cx, cx->globalObject, stdout); - } else { - fputs("js: invalid stats argument ", gErrFile); - JS_FileEscapedString(gErrFile, str, 0); - putc('\n', gErrFile); - continue; - } - } - JS_SET_RVAL(cx, vp, JSVAL_VOID); - return JS_TRUE; -} - static JSBool DumpHeap(JSContext *cx, unsigned argc, jsval *vp) { @@ -3640,10 +3603,6 @@ static JSFunctionSpecWithHelp shell_functions[] = { "notes([fun])", " Show source notes for functions."), - JS_FN_HELP("stats", DumpStats, 1, 0, -"stats([string ...])", -" Dump 'atom' or 'global' stats."), - JS_FN_HELP("findReferences", FindReferences, 1, 0, "findReferences(target)", " Walk the entire heap, looking for references to |target|, and return a\n"