[gjs] test: avoid immediate GC on the Test object



commit 6de94ed0c2b6db19bb65c7a92ca65f2032e24865
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Apr 10 14:01:53 2014 -0700

    test: avoid immediate GC on the Test object
    
    We need to keep this variable alive, otherwise it will be immediately
    garbage collected now that we trigger GC when we exit JS.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725099

 installed-tests/js/testGDBus.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/installed-tests/js/testGDBus.js b/installed-tests/js/testGDBus.js
index 7fb1215..4e5c8ec 100644
--- a/installed-tests/js/testGDBus.js
+++ b/installed-tests/js/testGDBus.js
@@ -211,11 +211,12 @@ Test.prototype = {
 };
 
 var own_name_id;
+var test;
 
 function testExportStuff() {
     let loop = GLib.MainLoop.new(null, false);
 
-    new Test();
+    test = new Test();
 
     own_name_id = Gio.DBus.session.own_name('org.gnome.gjs.Test',
                                             Gio.BusNameOwnerFlags.NONE,
@@ -259,6 +260,7 @@ function testFrobateStuff() {
 
     let theResult, theExcp;
     proxy.frobateStuffRemote({}, function(result, excp) {
+        JSUnit.assertNull(excp);
         [theResult] = result;
         theExcp = excp;
         loop.quit();


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