forked from theintern/intern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder.js
More file actions
32 lines (28 loc) · 729 Bytes
/
order.js
File metadata and controls
32 lines (28 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
define([
'./lib/util',
'dojo/Deferred'
], function (util, Deferred) {
var queue = util.createQueue(1);
return {
/**
* AMD plugin for in-order loading of non-AMD JavaScript. Use this when you need to test modules that do not
* have proper dependency management.
*
* @example
* define([ 'intern!object', 'intern/order!jquery.js', 'intern/order!plugin.jquery.js', ... ], ...)
*/
load: function (id, parentRequire, callback) {
queue(function () {
var dfd = new Deferred();
parentRequire([ id ], function (value) {
callback(value);
dfd.resolve();
});
return dfd;
})();
},
normalize: function (id, normalize) {
return normalize(id.replace(/\.js$/, ''));
}
};
});