You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
338 B
18 lines
338 B
11 years ago
|
'use strict';
|
||
|
|
||
|
if (typeof require === 'undefined') {
|
||
|
var that = this;
|
||
|
that.require = function(name) {
|
||
|
var split = name.split('/');
|
||
|
if (split.length > 0) {
|
||
|
name = split.pop();
|
||
|
}
|
||
|
var module = that[name];
|
||
|
if (!module) {
|
||
|
throw new Error('Cannot find module "'+name+'"');
|
||
|
}
|
||
|
return module;
|
||
|
};
|
||
|
|
||
|
}
|