function.bind is not available in Safari
This commit is contained in:
parent
3fcbaa4c7c
commit
2d9382fb47
1 changed files with 5 additions and 1 deletions
|
|
@ -62,12 +62,16 @@ var define = function(id, deps, factory) {
|
||||||
if (id.indexOf("text!") === 0)
|
if (id.indexOf("text!") === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var req = function(deps, factory) {
|
||||||
|
return require(id, deps, factory);
|
||||||
|
}
|
||||||
|
|
||||||
require.modules[id] = {
|
require.modules[id] = {
|
||||||
factory: function() {
|
factory: function() {
|
||||||
var module = {
|
var module = {
|
||||||
exports: {}
|
exports: {}
|
||||||
};
|
};
|
||||||
var returnExports = factory(require.bind(null, id), module.exports, module);
|
var returnExports = factory(req, module.exports, module);
|
||||||
if (returnExports)
|
if (returnExports)
|
||||||
module.exports = returnExports;
|
module.exports = returnExports;
|
||||||
return module;
|
return module;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue