summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-03-07 23:22:51 +0100
committerportix <portix@gmx.net>2014-03-07 23:22:51 +0100
commitbaba30024300cf49d74c37fae59fa6942d0676cb (patch)
tree9d29dad4de6e326694f55810faec890278f58eb8
parent0afe7a02afe5cc7d39e1f921e564664c5f0c25b7 (diff)
downloaddwb-baba30024300cf49d74c37fae59fa6942d0676cb.zip
Removing namespace modules
-rw-r--r--scripts/lib/dwb.js.in5
-rw-r--r--scripts/lib/extensions.js.in7
-rw-r--r--src/scripts.c22
3 files changed, 10 insertions, 24 deletions
diff --git a/scripts/lib/dwb.js.in b/scripts/lib/dwb.js.in
index 670ca965..470fb754 100644
--- a/scripts/lib/dwb.js.in
+++ b/scripts/lib/dwb.js.in
@@ -5,7 +5,6 @@
var tabs = namespace("tabs");
var timer = namespace("timer");
var util = namespace("util");
- var modules = namespace("modules");
var _modules = {};
var _requires = {};
@@ -31,7 +30,7 @@
detail = name.split("!");
name = detail[0];
if (!_modules[name]) {
- modules.include(detail.slice(1).join("!"));
+ include(detail.slice(1).join("!"));
}
}
if (_modules[name])
@@ -700,7 +699,7 @@
value : function(relPath, global)
{
var dirName = path.substring(0, path.lastIndexOf("/") + 1);
- return modules.include(dirName + relPath, global);
+ return include(dirName + relPath, global);
}
}
});
diff --git a/scripts/lib/extensions.js.in b/scripts/lib/extensions.js.in
index 39456fc7..c90433f3 100644
--- a/scripts/lib/extensions.js.in
+++ b/scripts/lib/extensions.js.in
@@ -106,7 +106,6 @@
var io = namespace("io");
var system = namespace("system");
var util = namespace("util");
- var modules = namespace("modules");
var _config = {};
var _registered = {};
@@ -118,9 +117,9 @@
function _getPlugin(name, filename)
{
if (system.fileTest(filename, FileTest.exists))
- return modules.include(filename);
+ return include(filename);
else if (system.fileTest(filename + ".exar", FileTest.exists))
- return modules.include(filename + ".exar");
+ return include(filename + ".exar");
return null;
};
function _getStack(offset)
@@ -267,7 +266,7 @@
{
try
{
- config = modules.include(data.configDir + "/extensionrc");
+ config = include(data.configDir + "/extensionrc");
}
catch (e)
{
diff --git a/src/scripts.c b/src/scripts.c
index fb29779d..fec38f3e 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -56,8 +56,8 @@
#define SCRIPT_TEMPLATE_XSTART "try{"\
"var exports=arguments[0];"\
"_initNewContext(this,arguments,'%s');"\
-"var xinclude=namespace('modules')._xinclude.bind(this,this.path);"\
-"var xgettext=namespace('modules')._xgettext.bind(this,this.path);"\
+"var xinclude=_xinclude.bind(this,this.path);"\
+"var xgettext=_xgettext.bind(this,this.path);"\
"const script=this;"\
"if(!exports.id)Object.defineProperty(exports,'id',{value:script.generateId()});"\
"var xprovide=function(n,m,o){provide(n+exports.id,m,o);};"\
@@ -241,7 +241,6 @@ enum {
NAMESPACE_EXTENSIONS,
NAMESPACE_GUI,
NAMESPACE_IO,
- NAMESPACE_MODULES,
NAMESPACE_NET,
NAMESPACE_SIGNALS,
NAMESPACE_SYSTEM,
@@ -2309,7 +2308,6 @@ global_namespace(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject,
[NAMESPACE_EXTENSIONS] = "extensions",
[NAMESPACE_GUI] = "gui",
[NAMESPACE_IO] = "io",
- [NAMESPACE_MODULES] = "modules",
[NAMESPACE_NET] = "net",
[NAMESPACE_SIGNALS] = "signals",
[NAMESPACE_SYSTEM] = "system",
@@ -2418,7 +2416,6 @@ do_include(JSContextRef ctx, const char *path, const char *script, gboolean glob
* script.
*
* @name include
- * @memberOf modules
* @function
* @param {String} path
* The path to the script
@@ -6466,6 +6463,9 @@ create_global_object()
{ "exit", global_exit, kJSDefaultAttributes },
{ "_bind", global_bind, kJSDefaultAttributes },
{ "unbind", global_unbind, kJSDefaultAttributes },
+ { "include", global_include, kJSDefaultAttributes },
+ { "_xinclude", global_xinclude, kJSDefaultAttributes },
+ { "_xgettext", global_xget_text, kJSDefaultAttributes },
{ 0, 0, 0 },
};
@@ -6496,18 +6496,6 @@ create_global_object()
* */
js_set_object_number_property(ctx, global_object, "version", API_VERSION, NULL);
- JSStaticFunction module_functions[] = {
- { "include", global_include, kJSDefaultAttributes },
- { "_xinclude", global_xinclude, kJSDefaultAttributes },
- { "_xgettext", global_xget_text, kJSDefaultAttributes },
- { 0, 0, 0 },
- };
- class = create_class("modules", module_functions, NULL, NULL);
- s_ctx->namespaces[NAMESPACE_MODULES] = create_object(ctx, class, global_object, kJSDefaultAttributes, "modules", NULL);
- JSClassRelease(class);
-
-
-
JSStaticValue data_values[] = {
{ "profile", data_get_profile, NULL, kJSDefaultAttributes },
{ "sessionName", data_get_session_name, NULL, kJSDefaultAttributes },