[seed] Use the correct context for adding globals to new import contexts



commit 6d6594fc7b9007e26e0dd684448e730a2549cc37
Author: Robert Carr <racarr mireia (none)>
Date:   Sun Apr 12 17:57:15 2009 -0400

    Use the correct context for adding globals to new import contexts
---
 examples/browser/TabbedBrowser.js |    1 +
 examples/browser/main.js          |   13 ++++++-------
 libseed/seed-importer.c           |    6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/examples/browser/TabbedBrowser.js b/examples/browser/TabbedBrowser.js
index 43f9680..a9e2614 100644
--- a/examples/browser/TabbedBrowser.js
+++ b/examples/browser/TabbedBrowser.js
@@ -2,6 +2,7 @@ Gtk = imports.gi.Gtk;
 WebKit = imports.gi.WebKit;
 
 BrowserSettings = imports.BrowserSettings;
+BrowserView = imports.BrowserView;
 
 TabbedBrowser = new GType({
     parent: Gtk.Notebook.type,
diff --git a/examples/browser/main.js b/examples/browser/main.js
index 85ec244..00ef319 100755
--- a/examples/browser/main.js
+++ b/examples/browser/main.js
@@ -5,12 +5,11 @@ WebKit = imports.gi.WebKit;
 
 Gtk.init(null, null);
 
-BrowserSettings = imports.BrowserSettings;
-BrowserView = imports.BrowserView;
-Seed.include("BrowserStatusbar.js");
-Seed.include("BrowserTab.js");
-Seed.include("TabbedBrowser.js");
-Seed.include("BrowserToolbar.js");
+TabbedBrowser = imports.TabbedBrowser;
+//Seed.include("BrowserStatusbar.js");
+//Seed.include("BrowserTab.js");
+//Seed.include("TabbedBrowser.js");
+//Seed.include("BrowserToolbar.js");
 
 // Test for Gtk >= 2.16 (otherwise don't have a progress bar)
 
@@ -25,7 +24,7 @@ window = new Gtk.Window({title: "Browser"});
 window.resize(800, 600);
 window.signal.hide.connect(function () { Gtk.main_quit(); });
 
-browser = new TabbedBrowser();
+browser = new TabbedBrowser.TabbedBrowser();
 window.add(browser);
 window.show_all();
 
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 9f0f88e..9be66a9 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -510,9 +510,9 @@ seed_importer_handle_file (JSContextRef ctx,
   
   nctx = JSGlobalContextCreateInGroup (context_group, 0);
   global = JSContextGetGlobalObject (nctx);
-  seed_object_set_property (ctx, global, "imports", importer);
-  seed_object_set_property (ctx, global, "GType", seed_gtype_constructor);
-  seed_object_set_property (ctx, global, "Seed", seed_obj_ref);
+  seed_object_set_property (nctx, global, "imports", importer);
+  seed_object_set_property (nctx, global, "GType", seed_gtype_constructor);
+  seed_object_set_property (nctx, global, "Seed", seed_obj_ref);
 
   JSEvaluateScript (nctx, file_contents, NULL, file_name, 0, exception);
 



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