environment: move more init stuff here from main.js

Move some more environment-initializationy stuff from main.js to
environment.js, and be more careful about not importing shell JS
modules until after the environment has been fully patched.

Change gnome-shell-plugin to call Environment.init() before
Main.start(); this means that Environment.init() now runs before any
shell JS modules (besides environment itself) have been imported.

Make run-js-test create a ShellGlobal and use its js_context, so that
the shell_global_set_property_mutable() stuff in Environment.init()
will work correctly in tests as well.

https://bugzilla.gnome.org/show_bug.cgi?id=649203
This commit is contained in:
Dan Winship
2011-04-30 10:27:36 -04:00
parent 0e42de9149
commit 7921954a31
4 changed files with 51 additions and 50 deletions

View File

@ -178,7 +178,8 @@ gnome_shell_plugin_start (MetaPlugin *plugin)
gjs_context = _shell_global_get_gjs_context (shell_plugin->global);
if (!gjs_context_eval (gjs_context,
"const Main = imports.ui.main; Main.start();",
"imports.ui.environment.init();"
"imports.ui.main.start();",
-1,
"<main>",
&status,