From 1f18b43300e46b0c0002c2959adb22447bf85686 Mon Sep 17 00:00:00 2001 From: "brendan@mozilla.org" Date: Sun, 17 Jun 2007 22:10:19 -0700 Subject: [PATCH] Remove __callee__ property of Call prototypes (384642, r=igor). --- js/src/jsfun.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/js/src/jsfun.c b/js/src/jsfun.c index 479bb361abc..4488c294109 100644 --- a/js/src/jsfun.c +++ b/js/src/jsfun.c @@ -73,12 +73,11 @@ /* Generic function/call/arguments tinyids -- also reflected bit numbers. */ enum { CALL_ARGUMENTS = -1, /* predefined arguments local variable */ - CALL_CALLEE = -2, /* reference to active function's object */ - ARGS_LENGTH = -3, /* number of actual args, arity if inactive */ - ARGS_CALLEE = -4, /* reference from arguments to active funobj */ - FUN_ARITY = -5, /* number of formal parameters; desired argc */ - FUN_NAME = -6, /* function name, "" if anonymous */ - FUN_CALLER = -7 /* Function.prototype.caller, backward compat */ + ARGS_LENGTH = -2, /* number of actual args, arity if inactive */ + ARGS_CALLEE = -3, /* reference from arguments to active funobj */ + FUN_ARITY = -4, /* number of formal parameters; desired argc */ + FUN_NAME = -5, /* function name, "" if anonymous */ + FUN_CALLER = -6 /* Function.prototype.caller, backward compat */ }; #if JSFRAME_OVERRIDE_BITS < 8 @@ -657,11 +656,6 @@ js_PutCallObject(JSContext *cx, JSStackFrame *fp) return ok; } -static JSPropertySpec call_props[] = { - {"__callee__", CALL_CALLEE, 0,0,0}, - {0,0,0,0,0} -}; - static JSBool call_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { @@ -686,11 +680,6 @@ call_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; - case CALL_CALLEE: - if (!TEST_OVERRIDE_BIT(fp, slot)) - *vp = fp->argv ? fp->argv[-2] : OBJECT_TO_JSVAL(fp->fun->object); - break; - default: if ((uintN)slot < JS_MAX(fp->argc, fp->fun->nargs)) *vp = fp->argv[slot]; @@ -715,7 +704,6 @@ call_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) slot = JSVAL_TO_INT(id); switch (slot) { case CALL_ARGUMENTS: - case CALL_CALLEE: SET_OVERRIDE_BIT(fp, slot); break; @@ -932,11 +920,6 @@ call_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, *objp = obj; return JS_TRUE; } - - /* - * FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=384642 -- same - * magic needed for __callee__, if we decide to keep it. - */ } return JS_TRUE; } @@ -2120,7 +2103,7 @@ js_InitCallClass(JSContext *cx, JSObject *obj) JSObject *proto; proto = JS_InitClass(cx, obj, NULL, &js_CallClass, NULL, 0, - call_props, NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if (!proto) return NULL;