mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
First part of bug 749392. Stop exposing 'clear' in our shells in preparation of removing the underlying JS_ClearScope() API. r=jwalden
This commit is contained in:
parent
270738f819
commit
fecdb93ec9
@ -522,22 +522,6 @@ DumpHeap(JSContext *cx,
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
static JSBool
|
||||
Clear(JSContext *cx,
|
||||
unsigned argc,
|
||||
jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
if (argc > 0 && !JSVAL_IS_PRIMITIVE(argv[0])) {
|
||||
JS_ClearScope(cx, JSVAL_TO_OBJECT(argv[0]));
|
||||
} else {
|
||||
JS_ReportError(cx, "'clear' requires an object");
|
||||
return JS_FALSE;
|
||||
}
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSFunctionSpec gGlobalFunctions[] =
|
||||
{
|
||||
{"print", Print, 0,0},
|
||||
@ -551,7 +535,6 @@ JSFunctionSpec gGlobalFunctions[] =
|
||||
#ifdef JS_GC_ZEAL
|
||||
{"gczeal", GCZeal, 1,0},
|
||||
#endif
|
||||
{"clear", Clear, 1,0},
|
||||
#ifdef DEBUG
|
||||
{"dumpHeap", DumpHeap, 5,0},
|
||||
#endif
|
||||
|
@ -2299,22 +2299,6 @@ BuildDate(JSContext *cx, unsigned argc, jsval *vp)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
Clear(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
JSObject *obj;
|
||||
if (argc == 0) {
|
||||
obj = JS_GetGlobalForScopeChain(cx);
|
||||
if (!obj)
|
||||
return false;
|
||||
} else if (!JS_ValueToObject(cx, JS_ARGV(cx, vp)[0], &obj)) {
|
||||
return false;
|
||||
}
|
||||
JS_ClearScope(cx, obj);
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
Intern(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
@ -3701,10 +3685,6 @@ static JSFunctionSpecWithHelp shell_functions[] = {
|
||||
"build()",
|
||||
" Show build date and time."),
|
||||
|
||||
JS_FN_HELP("clear", Clear, 0, 0,
|
||||
"clear([obj])",
|
||||
" Clear properties of object."),
|
||||
|
||||
JS_FN_HELP("intern", Intern, 1, 0,
|
||||
"intern(str)",
|
||||
" Internalize str in the atom table."),
|
||||
|
@ -660,19 +660,6 @@ DumpHeap(JSContext *cx, unsigned argc, jsval *vp)
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
static JSBool
|
||||
Clear(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
if (argc > 0 && !JSVAL_IS_PRIMITIVE(JS_ARGV(cx, vp)[0])) {
|
||||
JS_ClearScope(cx, JSVAL_TO_OBJECT(JS_ARGV(cx, vp)[0]));
|
||||
} else {
|
||||
JS_ReportError(cx, "'clear' requires an object");
|
||||
return false;
|
||||
}
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
SendCommand(JSContext* cx,
|
||||
unsigned argc,
|
||||
@ -843,7 +830,6 @@ static JSFunctionSpec glob_functions[] = {
|
||||
#ifdef JS_GC_ZEAL
|
||||
{"gczeal", GCZeal, 1,0},
|
||||
#endif
|
||||
{"clear", Clear, 1,0},
|
||||
{"options", Options, 0,0},
|
||||
JS_FN("parent", Parent, 1,0),
|
||||
#ifdef DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user