From 5d458db61a3b166658edee0837dcadc8aca7df84 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Tue, 12 Sep 2006 01:55:08 +0000 Subject: [PATCH] Fix getter/setter in object initialiser decompilation to track minimal parenthesization fixes (352010, r=mrbkap). --- js/src/jsopcode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/src/jsopcode.c b/js/src/jsopcode.c index 7479ace50120..953311e4f224 100644 --- a/js/src/jsopcode.c +++ b/js/src/jsopcode.c @@ -3057,14 +3057,16 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) rval); #else if (lastop == JSOP_GETTER || lastop == JSOP_SETTER) { - rval += strlen(js_function_str) + 1; - todo = Sprint(&ss->sprinter, "%s%s%s %s%.*s", + JS_ASSERT(strncmp(rval, js_function_str, 8) == 0 && + rval[8] == ' '); + rval += 8 + 1; + JS_ASSERT(rval[strlen(rval)-1] == '}'); + todo = Sprint(&ss->sprinter, "%s%s%s %s%s", lval, (lval[1] != '\0') ? ", " : "", (lastop == JSOP_GETTER) ? js_get_str : js_set_str, xval, - strlen(rval) - 1, rval); } else { todo = Sprint(&ss->sprinter, "%s%s%s:%s",