[gjs] context: Fix crash



commit 0bdf36bb5f66fbb6debc7a6b57b2d632991084c0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 15 16:23:26 2014 -0500

    context: Fix crash
    
    We need to be in a compartment to call gjs_log_exception

 gjs/context.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index c99b583..2bafa91 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -593,6 +593,8 @@ gjs_context_eval(GjsContext   *js_context,
     gboolean ret = FALSE;
     jsval retval;
 
+    JSAutoCompartment ac(js_context->context, js_context->global);
+
     g_object_ref(G_OBJECT(js_context));
 
     if (!gjs_eval_with_scope(js_context->context, NULL, script, script_len, filename, &retval)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]