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
30 lines (28 loc) · 731 Bytes
/
order.js
File metadata and controls
30 lines (28 loc) · 731 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
define([
'./lib/util',
'dojo/Promise'
], function (util, Promise) {
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 () {
return new Promise(function (resolve) {
parentRequire([ id ], function (value) {
callback(value);
resolve();
});
});
})();
},
normalize: function (id, normalize) {
return normalize(id.replace(/\.js$/, ''));
}
};
});