Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
255 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @license RequireJS rhino Copyright (c) 2010, The Dojo Foundation All Rights Reserved. | ||
* Available via the MIT, GPL or new BSD license. | ||
* see: http://github.com/jrburke/requirejs for details | ||
*/ | ||
/*global require: false, readFile: false */ | ||
|
||
/* | ||
TODO: Work out relative paths, that use ./ and such, and allow loading normal | ||
CommonJS modules, by overriding require.get(). | ||
*/ | ||
|
||
/*globals load: false */ | ||
"use strict"; | ||
|
||
require.load = function (moduleName, contextName) { | ||
var url = require.nameToUrl(moduleName, null, contextName), | ||
context = require.s.contexts[contextName]; | ||
|
||
//isDone is used by require.ready() | ||
require.s.isDone = false; | ||
|
||
//Indicate a the module is in process of loading. | ||
context.loaded[moduleName] = false; | ||
|
||
load(url); | ||
|
||
//Mark the module loaded. | ||
context.loaded[moduleName] = true; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Run the tests in Rhino via this command: | ||
* java -jar ../build/lib/rhino/js.jar all-rhino.js | ||
* | ||
* To run with debugger: | ||
* java -classpath ../build/lib/rhino/js.jar org.mozilla.javascript.tools.debugger.Main all-rhino.js | ||
*/ | ||
|
||
//A hack to doh to avoid dojo setup stuff in doh/runner.js | ||
skipDohSetup = true; | ||
|
||
//Load test framework | ||
load("doh/runner.js"); | ||
load("doh/_rhinoRunner.js"); | ||
|
||
//Load require with rhino extension | ||
load("../require.js"); | ||
load("../require/rhino.js"); | ||
|
||
//Load the tests. | ||
load("simple-tests.js"); | ||
load("circular-tests.js"); | ||
load("depoverlap-tests.js"); | ||
|
||
//Hmm, this is an odd requirement, call doh.run() for each test listed above? | ||
//May be because the tests above call doh.run() in a callback sometimes? | ||
doh.run(); | ||
doh.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require({ | ||
baseUrl: "./" | ||
}, | ||
["require", "two", "funcTwo", "funcThree"], | ||
function(require, two, funcTwo, funcThree) { | ||
var args = two.doSomething(); | ||
var twoInst = new funcTwo("TWO"); | ||
doh.register( | ||
"circular", | ||
[ | ||
function circular(t) { | ||
t.is("small", args.size); | ||
t.is("redtwo", args.color); | ||
}, | ||
|
||
function circularFunc(t) { | ||
t.is("TWO", twoInst.name); | ||
t.is("ONE-NESTED", twoInst.oneName()); | ||
t.is("THREE-THREE_SUFFIX", funcThree("THREE")); | ||
} | ||
] | ||
); | ||
doh.run(); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.