3.0 source code

This commit is contained in:
agolybev
2015-04-28 17:59:00 +03:00
parent c69fd34bdd
commit 7b3b2248e5
16311 changed files with 1445974 additions and 3108429 deletions

View File

@@ -0,0 +1,54 @@
var globals = {};
var master = new doh.Deferred();
define('a', ['b'], function (b) {
globals.a = 'a';
});
define('b', function () {
return (globals.b = 'b');
});
define('c', function () {
globals.c = 'c';
});
//Register the test
doh.register(
"delayedDefine",
[
{
name: "delayedDefine",
timeout: 5000,
runTest: function () {
return master;
}
}
]
);
doh.run();
//At this point no require calls, so there should be no globals.
doh.is(undefined, globals.a);
doh.is(undefined, globals.b);
doh.is(undefined, globals.c);
require({
baseUrl: './'
},
['a'],
function(a) {
doh.is('a', globals.a);
doh.is('b', globals.b);
doh.is(undefined, globals.c);
setTimeout(function () {
//Make sure nothing new is defined after this require callback.
doh.is('a', globals.a);
doh.is('b', globals.b);
doh.is(undefined, globals.c);
master.callback(true);
}, 15);
}
);