MCPcopy Index your code
hub / github.com/moxiecode/plupload / localRequire

Function localRequire

tests/js/require.js:1402–1465  ·  view source on GitHub ↗
(deps, callback, errback)

Source from the content-addressed store, hash-verified

1400 options = options || {};
1401
1402 function localRequire(deps, callback, errback) {
1403 var id, map, requireMod;
1404
1405 if (options.enableBuildCallback && callback && isFunction(callback)) {
1406 callback.__requireJsBuild = true;
1407 }
1408
1409 if (typeof deps === 'string') {
1410 if (isFunction(callback)) {
1411 //Invalid call
1412 return onError(makeError('requireargs', 'Invalid require call'), errback);
1413 }
1414
1415 //If require|exports|module are requested, get the
1416 //value for them from the special handlers. Caveat:
1417 //this only works while module is being defined.
1418 if (relMap && hasProp(handlers, deps)) {
1419 return handlers[deps](registry[relMap.id]);
1420 }
1421
1422 //Synchronous access to one module. If require.get is
1423 //available (as in the Node adapter), prefer that.
1424 if (req.get) {
1425 return req.get(context, deps, relMap, localRequire);
1426 }
1427
1428 //Normalize module name, if it contains . or ..
1429 map = makeModuleMap(deps, relMap, false, true);
1430 id = map.id;
1431
1432 if (!hasProp(defined, id)) {
1433 return onError(makeError('notloaded', 'Module name "' +
1434 id +
1435 '" has not been loaded yet for context: ' +
1436 contextName +
1437 (relMap ? '' : '. Use require([])')));
1438 }
1439 return defined[id];
1440 }
1441
1442 //Grab defines waiting in the global queue.
1443 intakeDefines();
1444
1445 //Mark all the dependencies as needing to be loaded.
1446 context.nextTick(function () {
1447 //Some defines could have been added since the
1448 //require call, collect them.
1449 intakeDefines();
1450
1451 requireMod = getModule(makeModuleMap(null, relMap));
1452
1453 //Store if map config should be applied to this require
1454 //call for dependencies.
1455 requireMod.skipMap = options.skipMap;
1456
1457 requireMod.init(deps, callback, errback, {
1458 enabled: true
1459 });

Callers 1

newContextFunction · 0.85

Calls 8

isFunctionFunction · 0.85
makeErrorFunction · 0.85
hasPropFunction · 0.85
makeModuleMapFunction · 0.85
intakeDefinesFunction · 0.85
getModuleFunction · 0.85
checkLoadedFunction · 0.85
onErrorFunction · 0.70

Tested by

no test coverage detected