Navigation Menu

Skip to content

Commit

Permalink
Added a "crankyLoad" function that mimic's Rhino's "load" function ex…
Browse files Browse the repository at this point in the history
…cept that it lets any parsing exceptions bubble up. This correctly causes the build to fail if a test file has a syntax error. However, it's currently commented-out because I must upgrade Rhino to 1.7R2 for it to work, and that was breaking tests. BRB
  • Loading branch information
Larry Karnowski committed May 22, 2009
1 parent 759a76f commit 665e367
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test.js
@@ -1,6 +1,17 @@
// Init
load("dist/env.rhino.js");

// Must upgrade Rhino to 1.7R2 for this function to work.
// function crankyLoad() {
// var context = Packages.org.mozilla.javascript.Context.currentContext;
// var SourceReader = Packages.org.mozilla.javascript.tools.SourceReader;
//
// for(var i=0; i < arguments.length; i++) {
// var filename = arguments[i];
// var source = SourceReader.readFileOrUrl(filename, true, "UTF-8");
// context.evaluateString(this, source, filename, 0, null);
// }
// }

window.onload = function(){
print("Handling onload for test.js");
Expand Down

0 comments on commit 665e367

Please sign in to comment.