MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / on

Function on

public/javascripts/require.js:506–523  ·  view source on GitHub ↗
(depMap, name, fn)

Source from the content-addressed store, hash-verified

504 }
505
506 function on(depMap, name, fn) {
507 var id = depMap.id,
508 mod = getOwn(registry, id);
509
510 if (hasProp(defined, id) &&
511 (!mod || mod.defineEmitComplete)) {
512 if (name === 'defined') {
513 fn(defined[id]);
514 }
515 } else {
516 mod = getModule(depMap);
517 if (mod.error && name === 'error') {
518 fn(mod.error);
519 } else {
520 mod.on(name, fn);
521 }
522 }
523 }
524
525 function onError(err, errback) {
526 var ids = err.requireModules,

Callers 1

newContextFunction · 0.70

Calls 4

getOwnFunction · 0.85
hasPropFunction · 0.85
getModuleFunction · 0.85
fnFunction · 0.70

Tested by

no test coverage detected