Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
dojo.hostenv.name_ = "spidermonkey";
12
dojo.hostenv.println = print;
13
dojo.hostenv.exit = function (exitcode) {
14
	quit(exitcode);
15
};
16
dojo.hostenv.getVersion = function () {
17
	return version();
18
};
19
if (typeof line2pc == "undefined") {
20
	dojo.raise("attempt to use SpiderMonkey host environment when no 'line2pc' global");
21
}
22
function dj_spidermonkey_current_file(depth) {
23
	var s = "";
24
	try {
25
		throw Error("whatever");
26
	}
27
	catch (e) {
28
		s = e.stack;
29
	}
30
	var matches = s.match(/[^@]*\.js/gi);
31
	if (!matches) {
32
		dojo.raise("could not parse stack string: '" + s + "'");
33
	}
34
	var fname = (typeof depth != "undefined" && depth) ? matches[depth + 1] : matches[matches.length - 1];
35
	if (!fname) {
36
		dojo.raise("could not find file name in stack string '" + s + "'");
37
	}
38
	return fname;
39
}
40
if (!dojo.hostenv.library_script_uri_) {
41
	dojo.hostenv.library_script_uri_ = dj_spidermonkey_current_file(0);
42
}
43
dojo.hostenv.loadUri = function (uri) {
44
	var ok = load(uri);
45
	return 1;
46
};
47
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
48