mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-04 20:05:03 +00:00
Better file/line number reporting in stack traces in Rhino
This commit is contained in:
1 parent
62284c9218
commit
19a4140f7d
2 files changed
+9
-1
No files matched your search
@@ -151,7 +151,11 @@ function fragment_evaluate_code(aFragment)
|
||||
|
||||
try
|
||||
{
|
||||
#if RHINO
|
||||
compiled = Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(window, "function(){"+GET_CODE(aFragment)+"}", GET_FILE(aFragment).path, 0, null);
|
||||
#else
|
||||
compiled = new Function(GET_CODE(aFragment));
|
||||
#endif
|
||||
}
|
||||
catch(anException)
|
||||
{
|
||||
|
||||
@@ -181,7 +181,11 @@ if (!this.load)
|
||||
alert("Setting up 'load()'");
|
||||
this.load = function(path)
|
||||
{
|
||||
return eval(readFile(path));
|
||||
var contents = readFile(path);
|
||||
if (typeof Packages !== "undefined")
|
||||
return Packages.org.mozilla.javascript.Context.getCurrentContext().evaluateString(window, contents, path, 0, null);
|
||||
else
|
||||
return eval(contents);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user