2014-02-04 10:26:58 -08:00
|
|
|
'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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2014-02-05 12:00:08 -08:00
|
|
|
|