Re: libseed-list something broke with upgrade
- From: Jonatan Liljedahl <lijon kymatica com>
- To: libseed-list gnome org
- Subject: Re: libseed-list something broke with upgrade
- Date: Tue, 13 Jul 2010 19:07:21 +0200
With some more debug printing, it seems that Seed.include(fn) doesn't
evaluate the included script in the same context!
lijon kymatix:~/Coding/seed$ seed foo.js
*** running defaults_script in seed_init ctx 0xb604ae24
*** seed_include /usr/local/share/seed/extensions/Seed.js on ctx 0xb5c160a0
Running Seed.js
setting searchPath..
Setting __script_path__
*** seed exec js file on ctx 0xb604ae24
/usr/share/gnome-js,/usr/local/lib/seed,/usr/local/share/seed,/usr/local/lib/seed,/usr/local/share/seed,/usr/lib/seed,/usr/share/seed
** (seed:22492): CRITICAL **: Line 2 in foo.js: ReferenceError Can't
find variable: __script_path__
If you compare the ctx pointers, the context in seed_include() is not
the same as the one executing foo.js and running defaults_script
(Seed.include("extensions/Seed.js")), but it should - or else any
variables declared in the included file will not be "exported".
BTW, a cleaner way to run Seed.js than to eval a script with
"Seed.include(...)" would IMHO be something like this:
seed_evaluate (eng->context,
seed_script_new_from_file (eng->context,
SEED_PREFIX_PATH "extensions/Seed.js"),
NULL);
Trying this in seed_init_with_context_and_group() didn't help though.
Any ideas?
/Jonatan
On 07/13/2010 06:25 PM, Jonatan Liljedahl wrote:
I just recompiled Seed from current git, after upgrading to ubuntu 10.04
and upgrading some gobject-introspection stuff to be able to compile the
latest Seed.
It built fine, but something happened with import.searchPath. With this
file:
// foo.js
print(imports.searchPath);
print(__script_path__);
// EOF
and a modified extensions/Seed.js with debug-prints like this:
print("Running Seed.js");
if(!imports.searchPath || (imports.searchPath.length == 0))
{
print("setting searchPath..");
imports.searchPath = [ "/usr/share/gnome-js",
"/usr/local/lib/seed",
"/usr/local/share/seed",
"/usr/local/lib/seed",
"/usr/local/share/seed",
"/usr/lib/seed",
"/usr/share/seed" ];
if(Seed.argv.length > 1)
{
print("Setting __script_path__");
__script_path__ = GLib.path_get_dirname(Seed.argv[1]);
...
I get this output when running 'seed foo.js':
Running Seed.js
setting searchPath..
Setting __script_path__
/usr/share/gnome-js,/usr/local/lib/seed,/usr/local/share/seed,/usr/local/lib/seed,/usr/local/share/seed,/usr/lib/seed,/usr/share/seed
** (seed:19398): CRITICAL **: Line 2 in foo.js: ReferenceError Can't
find variable: __script_path__
As you see, __script_path__ didn't stick and '.' didn't get added to
searchPath.
Also I noticed that the 'GLib' variable is no longer automatically
available in new contexts as it used to be (since Seed.js exports it as
a toplevel variable). What's going on? This situation breaks the import
system...
/Jonatan
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]