MCPcopy Create free account
hub / github.com/webpack/webpack / onAccepted

Function onAccepted

lib/hmr/JavascriptHotModuleReplacement.runtime.js:504–546  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

502 }
503
504 var onAccepted = function () {
505 // Load self accepted modules
506 for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) {
507 var item = outdatedSelfAcceptedModules[o];
508 var moduleId = item.module;
509 try {
510 item.require(moduleId);
511 } catch (err) {
512 if (typeof item.errorHandler === "function") {
513 try {
514 item.errorHandler(err, {
515 moduleId: moduleId,
516 module: $moduleCache$[moduleId]
517 });
518 } catch (err1) {
519 if (options.onErrored) {
520 options.onErrored({
521 type: "self-accept-error-handler-errored",
522 moduleId: moduleId,
523 error: err1,
524 originalError: err
525 });
526 }
527 if (!options.ignoreErrored) {
528 reportError(err1);
529 reportError(err);
530 }
531 }
532 } else {
533 if (options.onErrored) {
534 options.onErrored({
535 type: "self-accept-errored",
536 moduleId: moduleId,
537 error: err
538 });
539 }
540 if (!options.ignoreErrored) {
541 reportError(err);
542 }
543 }
544 }
545 }
546 };
547
548 return Promise.all(acceptPromises)
549 .then(onAccepted)

Callers

nothing calls this directly

Calls 2

requireMethod · 0.80
reportErrorFunction · 0.70

Tested by

no test coverage detected