[seed] Update examples and tests to import JSON now that it is a seperate module.



commit fdf5d14209b6112da5a8a6ae69bc2206ba026bd5
Author: Robert Carr <racarr svn gnome org>
Date:   Sat May 23 21:27:46 2009 -0400

    Update examples and tests to import JSON now that it is a seperate module.
---
 ChangeLog                                   |    4 ++--
 examples/json-reddit.js                     |    2 ++
 examples/pango.js                           |    2 ++
 tests/javascript/everything.js              |    2 ++
 tests/javascript/introspect.js              |    2 ++
 tests/javascript/json.js                    |    1 +
 tests/javascript/signals/signal-userdata.js |    2 ++
 tests/javascript/sqlite.js                  |   13 +++++++------
 8 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d5d73e3..a1c0272 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,8 +16,8 @@
   crash that happened sometimes with C modules.
 * Clutter animatev wrapper looks up property type wrapper now, so as to avoid having to pass
   [GObject.TYPE_FOO, bar]
-* Implement some varargs functions which can be implemented on top of non vararg variants
-  in JavaScript extensions.
+* Implement some varargs functions which can be implemented on top of non vararg variants in JavaScript extensions.
+* JSON stuff (stringify,parse) is now in gnome-js-common.
 
 == Seed 0.7, "Another Side of Bob Dylan" (2009.05.13) ==
 * Support for library init methods.
diff --git a/examples/json-reddit.js b/examples/json-reddit.js
index 9c2324e..01777f9 100755
--- a/examples/json-reddit.js
+++ b/examples/json-reddit.js
@@ -2,6 +2,8 @@
 
 Gio = imports.gi.Gio;
 
+JSON = imports.JSON;
+
 var redditurl = Gio.file_new_for_uri("http://reddit.com/.json";);
 var reddit = JSON.parse(redditurl.read().get_contents());
 
diff --git a/examples/pango.js b/examples/pango.js
index 25b251b..5c6824f 100755
--- a/examples/pango.js
+++ b/examples/pango.js
@@ -13,6 +13,8 @@ Gdk = imports.gi.Gdk;
 Gio = imports.gi.Gio;
 GLib = imports.gi.GLib;
 
+JSON = imports.JSON;
+
 Gtk.init(Seed.argv);
 GtkClutter.init(Seed.argv);
 
diff --git a/tests/javascript/everything.js b/tests/javascript/everything.js
index c4619b6..4124ba5 100755
--- a/tests/javascript/everything.js
+++ b/tests/javascript/everything.js
@@ -7,6 +7,8 @@
 Everything = imports.gi.Everything;
 GObject = imports.gi.GObject;
 
+JSON = imports.JSON;
+
 with(Everything)
 {
 Seed.print(test_boolean(true));
diff --git a/tests/javascript/introspect.js b/tests/javascript/introspect.js
index 814f090..f398bc3 100755
--- a/tests/javascript/introspect.js
+++ b/tests/javascript/introspect.js
@@ -5,6 +5,8 @@
 // STDERR:
 
 Gtk = imports.gi.Gtk;
+JSON = imports.JSON; 
+
 Gtk.init(Seed.argv);
 win = new Gtk.Window();
 Seed.print(JSON.stringify(Seed.introspect(win.set_opacity)));
diff --git a/tests/javascript/json.js b/tests/javascript/json.js
index 78b959c..5422cb9 100755
--- a/tests/javascript/json.js
+++ b/tests/javascript/json.js
@@ -3,6 +3,7 @@
 // STDIN:
 // STDOUT:
 // STDERR:
+JSON = imports.JSON;
 
 a = {test: 3,
      hello: "Goodbye",
diff --git a/tests/javascript/signals/signal-userdata.js b/tests/javascript/signals/signal-userdata.js
index 300e2af..e899963 100755
--- a/tests/javascript/signals/signal-userdata.js
+++ b/tests/javascript/signals/signal-userdata.js
@@ -5,6 +5,8 @@
 // STDERR:
 
 Gtk = imports.gi.Gtk;
+JSON = imports.JSON;
+
 Gtk.init(Seed.argv);
 
 function userdata_test(widget, user_data)
diff --git a/tests/javascript/sqlite.js b/tests/javascript/sqlite.js
index 1ac1a03..1fc4570 100755
--- a/tests/javascript/sqlite.js
+++ b/tests/javascript/sqlite.js
@@ -5,13 +5,12 @@
 // STDERR:
 Gio = imports.gi.Gio;
 sqlite = imports.sqlite;
+JSON = imports.JSON;
 
-try
-{
-	Gio.file_new_for_path("/tmp/.seed_test.db")["delete"]();
+try{
+    Gio.file_new_for_path("/tmp/.seed_test.db")["delete"]();
 }
-catch(e)
-{
+catch(e){
 }
 
 d = new sqlite.Database("/tmp/.seed_test.db");
@@ -21,6 +20,8 @@ d.exec("insert into t1 (data,num) values ('This is sample data',3);");
 d.exec("insert into t1 (data,num) values ('More sample data',6);");
 d.exec("insert into t1 (data,num) values ('And a little more',9);");
 
-d.exec("select * from t1", function(results){Seed.print(JSON.stringify(results));});
+d.exec("select * from t1", function(results){
+    Seed.print(JSON.stringify(results));
+});
 
 d.close();



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