seed r348 - in trunk: libseed modules/sqlite src
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r348 - in trunk: libseed modules/sqlite src
- Date: Tue, 25 Nov 2008 06:45:11 +0000 (UTC)
Author: racarr
Date: Tue Nov 25 06:45:10 2008
New Revision: 348
URL: http://svn.gnome.org/viewvc/seed?rev=348&view=rev
Log:
No global context usage in seed-api.c
Modified:
trunk/libseed/seed-api.c
trunk/libseed/seed.h
trunk/modules/sqlite/seed-sqlite.c
trunk/src/main.c
Modified: trunk/libseed/seed-api.c
==============================================================================
--- trunk/libseed/seed-api.c (original)
+++ trunk/libseed/seed-api.c Tue Nov 25 06:45:10 2008
@@ -1,11 +1,15 @@
#include "seed-private.h"
-JSObjectRef seed_make_object(JSClassRef class, gpointer private)
+JSObjectRef seed_make_object(JSContextRef ctx,
+ JSClassRef class,
+ gpointer private)
{
- return JSObjectMake(eng->context, class, private);
+ return JSObjectMake(ctx, class, private);
}
-SeedScript *seed_make_script(const gchar * js, const gchar * source_url,
+SeedScript *seed_make_script(JSContextRef ctx,
+ const gchar * js,
+ const gchar * source_url,
gint line_number)
{
SeedScript *ret = g_new0(SeedScript, 1);
@@ -24,7 +28,9 @@
return ret;
}
-JSValueRef seed_evaluate(SeedScript * js, JSObjectRef this)
+JSValueRef seed_evaluate(JSContextRef ctx,
+ SeedScript * js,
+ JSObjectRef this)
{
JSValueRef ret;
Modified: trunk/libseed/seed.h
==============================================================================
--- trunk/libseed/seed.h (original)
+++ trunk/libseed/seed.h Tue Nov 25 06:45:10 2008
@@ -52,7 +52,8 @@
*/
SeedEngine * seed_init(gint * argc, gchar *** argv);
-SeedScript *seed_make_script(const gchar * s, const gchar * source_url,
+SeedScript *seed_make_script(SeedContext ctx,
+ const gchar * s, const gchar * source_url,
gint line_number);
SeedException seed_script_exception(SeedScript * s);
void seed_make_exception(SeedContext ctx, SeedException e,
@@ -63,13 +64,15 @@
gchar *seed_exception_get_file(SeedContext ctx, SeedException e);
gchar *seed_exception_to_string(SeedContext ctx, SeedException e);
-SeedValue seed_evaluate(SeedScript * s, SeedObject this);
+SeedValue seed_evaluate(SeedContext ctx,
+ SeedScript * s, SeedObject this);
/*
* seed-api.c
*/
-SeedObject seed_make_object(SeedClass class, gpointer private);
+SeedObject seed_make_object(SeedContext ctx,
+ SeedClass class, gpointer private);
/*
* seed-types.c
Modified: trunk/modules/sqlite/seed-sqlite.c
==============================================================================
--- trunk/modules/sqlite/seed-sqlite.c (original)
+++ trunk/modules/sqlite/seed-sqlite.c Tue Nov 25 06:45:10 2008
@@ -7,7 +7,7 @@
void seed_module_init(SeedEngine * eng)
{
- SeedObject namespace_ref = seed_make_object(0, 0);
+ SeedObject namespace_ref = seed_make_object(eng->context, 0, 0);
seed_object_set_property(eng->global, "sqlite", namespace_ref);
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Tue Nov 25 06:45:10 2008
@@ -33,11 +33,11 @@
{
SeedScript * script;
- script = seed_make_script("while(1) { try { Seed.print(eval("
+ script = seed_make_script(eng->context, "while(1) { try { Seed.print(eval("
"Seed.readline(\"> \"))); } catch(e) {"
"Seed.print(e.name + \" \" + e.message);}}",
NULL, 0);
- seed_evaluate(script, 0);
+ seed_evaluate(eng->context, script, 0);
g_free(script);
}
@@ -62,7 +62,7 @@
buffer++;
buffer++;
}
- script = seed_make_script(buffer, argv[1], 1);
+ script = seed_make_script(eng->context, buffer, argv[1], 1);
if (e = seed_script_exception(script))
{
g_critical("%s. %s in %s at line %d",
@@ -72,7 +72,7 @@
seed_exception_get_line(eng->context, e));
exit(1);
}
- seed_evaluate(script, 0);
+ seed_evaluate(eng->context, script, 0);
if (e = seed_script_exception(script))
g_critical("%s. %s in %s at line %d",
seed_exception_get_name(eng->context, e),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]