[gjs] system: fix return value of gc() and breakpoint()
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] system: fix return value of gc() and breakpoint()
- Date: Fri, 27 Jun 2014 20:14:41 +0000 (UTC)
commit 569712f46a22c21ff3f78ad157c0be9e85f7aed5
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Wed Apr 30 21:51:05 2014 +0200
system: fix return value of gc() and breakpoint()
These need to return void (undefined), and not themselves (which
is what happens if SET_RVAL() is not called, due to spidermonkey
reusing the slot for arguments.callee)
modules/system.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/modules/system.cpp b/modules/system.cpp
index b12f766..51f14ef 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -91,6 +91,7 @@ gjs_breakpoint(JSContext *context,
if (!gjs_parse_args(context, "breakpoint", "", argc, argv))
return JS_FALSE;
G_BREAKPOINT();
+ JS_SET_RVAL(context, vp, JSVAL_VOID);
return JS_TRUE;
}
@@ -103,6 +104,7 @@ gjs_gc(JSContext *context,
if (!gjs_parse_args(context, "gc", "", argc, argv))
return JS_FALSE;
JS_GC(JS_GetRuntime(context));
+ JS_SET_RVAL(context, vp, JSVAL_VOID);
return JS_TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]