| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 20f40c2 commit 96f19a1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1097,20 +1097,26 @@ function defaultResolveImplForCJSLoading(specifier, parent, isMain, options) { | |||
| 1097 | 1097 | return wrapResolveFilename(specifier, parent, isMain, options); | |
| 1098 | 1098 | } | |
| 1099 | 1099 | ||
| 1100 | + /** | ||
| 1101 | + * @typedef {{ | ||
| 1102 | + * resolved?: {url?: string, format?: string, filename: string}, | ||
| 1103 | + * shouldSkipModuleHooks?: boolean, | ||
| 1104 | + * source?: string|ArrayBufferView|ArrayBuffer, | ||
| 1105 | + * requireResolveOptions?: ResolveFilenameOptions, | ||
| 1106 | + * }} CJSModuleLoadInternalOptions | ||
| 1107 | + */ | ||
| 1108 | + | ||
| 1100 | 1109 | /** | |
| 1101 | 1110 | * Resolve a module request for CommonJS, invoking hooks from module.registerHooks() | |
| 1102 | 1111 | * if necessary. | |
| 1103 | 1112 | * @param {string} specifier | |
| 1104 | 1113 | * @param {Module|undefined} parent | |
| 1105 | 1114 | * @param {boolean} isMain | |
| 1106 | - * @param {object} internalResolveOptions | ||
| 1107 | - * @param {boolean} internalResolveOptions.shouldSkipModuleHooks Whether to skip module hooks. | ||
| 1108 | - * @param {ResolveFilenameOptions} internalResolveOptions.requireResolveOptions Options from require.resolve(). | ||
| 1109 | - * Only used when it comes from require.resolve(). | ||
| 1115 | + * @param {CJSModuleLoadInternalOptions} internalOptions | ||
| 1110 | 1116 | * @returns {{url?: string, format?: string, parentURL?: string, filename: string}} | |
| 1111 | 1117 | */ | |
| 1112 | - function resolveForCJSWithHooks(specifier, parent, isMain, internalResolveOptions) { | ||
| 1113 | - const { requireResolveOptions, shouldSkipModuleHooks } = internalResolveOptions; | ||
| 1118 | + function resolveForCJSWithHooks(specifier, parent, isMain, internalOptions) { | ||
| 1119 | + const { requireResolveOptions, shouldSkipModuleHooks } = internalOptions; | ||
| 1114 | 1120 | const defaultResolveImpl = requireResolveOptions ? | |
| 1115 | 1121 | wrapResolveFilename : defaultResolveImplForCJSLoading; | |
| 1116 | 1122 | // Fast path: no hooks, just return simple results. | |
@@ -1257,10 +1263,10 @@ function loadBuiltinWithHooks(id, url, format) { | |||
| 1257 | 1263 | * @param {string} request Specifier of module to load via `require` | |
| 1258 | 1264 | * @param {Module} parent Absolute path of the module importing the child | |
| 1259 | 1265 | * @param {boolean} isMain Whether the module is the main entry point | |
| 1260 | - * @param {object|undefined} internalResolveOptions Additional options for loading the module | ||
| 1266 | + * @param {CJSModuleLoadInternalOptions|undefined} internalOptions Additional options for loading the module | ||
| 1261 | 1267 | * @returns {object} | |
| 1262 | 1268 | */ | |
| 1263 | - Module._load = function(request, parent, isMain, internalResolveOptions = kEmptyObject) { | ||
| 1269 | + Module._load = function(request, parent, isMain, internalOptions = kEmptyObject) { | ||
| 1264 | 1270 | let relResolveCacheIdentifier; | |
| 1265 | 1271 | if (parent) { | |
| 1266 | 1272 | debug('Module._load REQUEST %s parent: %s', request, parent.id); | |
@@ -1284,7 +1290,10 @@ Module._load = function(request, parent, isMain, internalResolveOptions = kEmpty | |||
| 1284 | 1290 | } | |
| 1285 | 1291 | } | |
| 1286 | 1292 | ||
| 1287 | - const resolveResult = resolveForCJSWithHooks(request, parent, isMain, internalResolveOptions); | ||
| 1293 | + // If the module has been resolved by a short-circuiting synchronous resolve hook, | ||
| 1294 | + // avoid running the default resolution from disk again. | ||
| 1295 | + const resolveResult = internalOptions.resolved ?? | ||
| 1296 | + resolveForCJSWithHooks(request, parent, isMain, internalOptions); | ||
| 1288 | 1297 | let { format } = resolveResult; | |
| 1289 | 1298 | const { url, filename } = resolveResult; | |
| 1290 | 1299 | ||
@@ -1372,6 +1381,14 @@ Module._load = function(request, parent, isMain, internalResolveOptions = kEmpty | |||
| 1372 | 1381 | module[kLastModuleParent] = parent; | |
| 1373 | 1382 | } | |
| 1374 | 1383 | ||
| 1384 | + // The module source was provided by a short-circuiting synchronous hook, | ||
| 1385 | + // assign them into the module to avoid triggering the default load step again. | ||
| 1386 | + if (internalOptions.source !== undefined) { | ||
| 1387 | + module[kModuleSource] ??= internalOptions.source; | ||
| 1388 | + module[kURL] ??= url; | ||
| 1389 | + module[kFormat] ??= format; | ||
| 1390 | + } | ||
| 1391 | + | ||
| 1375 | 1392 | if (parent !== undefined) { | |
| 1376 | 1393 | relativeResolveCache[relResolveCacheIdentifier] = filename; | |
| 1377 | 1394 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -145,7 +145,6 @@ function defaultLoadSync(url, context = kEmptyObject) { | |||
| 145 | 145 | ||
| 146 | 146 | throwIfUnsupportedURLScheme(urlInstance, false); | |
| 147 | 147 | ||
| 148 | - let shouldBeReloadedByCJSLoader = false; | ||
| 149 | 148 | if (urlInstance.protocol === 'node:') { | |
| 150 | 149 | source = null; | |
| 151 | 150 | format ??= 'builtin'; | |
@@ -160,10 +159,6 @@ function defaultLoadSync(url, context = kEmptyObject) { | |||
| 160 | 159 | ||
| 161 | 160 | // Now that we have the source for the module, run `defaultGetFormat` to detect its format. | |
| 162 | 161 | format ??= defaultGetFormat(urlInstance, context); | |
| 163 | - | ||
| 164 | - // For backward compatibility reasons, we need to let go through Module._load | ||
| 165 | - // again. | ||
| 166 | - shouldBeReloadedByCJSLoader = (format === 'commonjs'); | ||
| 167 | 162 | } | |
| 168 | 163 | validateAttributes(url, format, importAttributes); | |
| 169 | 164 | ||
@@ -172,7 +167,6 @@ function defaultLoadSync(url, context = kEmptyObject) { | |||
| 172 | 167 | format, | |
| 173 | 168 | responseURL, | |
| 174 | 169 | source, | |
| 175 | - shouldBeReloadedByCJSLoader, | ||
| 176 | 170 | }; | |
| 177 | 171 | } | |
| 178 | 172 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -124,7 +124,19 @@ const { defaultLoadSync, throwUnknownModuleFormat } = require('internal/modules/ | |||
| 124 | 124 | */ | |
| 125 | 125 | ||
| 126 | 126 | /** | |
| 127 | - * @typedef {{ format: ModuleFormat, source: ModuleSource, translatorKey: string }} TranslateContext | ||
| 127 | + * @typedef {{format: string, url: string, isResolvedBySyncHooks: boolean}} ResolveResult | ||
| 128 | + */ | ||
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * @typedef {{ | ||
| 132 | + * url: string, | ||
| 133 | + * format: ModuleFormat, | ||
| 134 | + * source: ModuleSource, | ||
| 135 | + * responseURL?: string, | ||
| 136 | + * translatorKey: string, | ||
| 137 | + * isResolvedBySyncHooks: boolean, | ||
| 138 | + * isSourceLoadedSynchronously: boolean, | ||
| 139 | + * }} TranslateContext | ||
| 128 | 140 | */ | |
| 129 | 141 | ||
| 130 | 142 | /** | |
@@ -385,19 +397,25 @@ class ModuleLoader { | |||
| 385 | 397 | /** | |
| 386 | 398 | * Load a module and translate it into a ModuleWrap for require(esm). | |
| 387 | 399 | * This is run synchronously, and the translator always return a ModuleWrap synchronously. | |
| 388 | - * @param {string} url URL of the module to be translated. | ||
| 400 | + * @param {ResolveResult} resolveResult Result from the resolve step. | ||
| 389 | 401 | * @param {object} loadContext See {@link load} | |
| 390 | 402 | * @param {string|undefined} parentURL URL of the parent module. Undefined if it's the entry point. | |
| 391 | 403 | * @param {ModuleRequest} request Module request. | |
| 392 | 404 | * @returns {ModuleWrap} | |
| 393 | 405 | */ | |
| 394 | - loadAndTranslateForImportInRequiredESM(url, loadContext, parentURL, request) { | ||
| 406 | + loadAndTranslateForImportInRequiredESM(resolveResult, loadContext, parentURL, request) { | ||
| 407 | + const { url } = resolveResult; | ||
| 395 | 408 | const loadResult = this.#loadSync(url, loadContext); | |
| 396 | 409 | // Use the synchronous commonjs translator which can deal with cycles. | |
| 397 | 410 | const formatFromLoad = loadResult.format; | |
| 398 | 411 | const translatorKey = (formatFromLoad === 'commonjs' || formatFromLoad === 'commonjs-typescript') ? | |
| 399 | 412 | 'commonjs-sync' : formatFromLoad; | |
| 400 | - const translateContext = { ...loadResult, translatorKey, __proto__: null }; | ||
| 413 | + const translateContext = { | ||
| 414 | + ...resolveResult, | ||
| 415 | + ...loadResult, | ||
| 416 | + translatorKey, | ||
| 417 | + __proto__: null, | ||
| 418 | + }; | ||
| 401 | 419 | const wrap = this.#translate(url, translateContext, parentURL); | |
| 402 | 420 | assert(wrap instanceof ModuleWrap, `Translator used for require(${url}) should not be async`); | |
| 403 | 421 | ||
@@ -446,12 +464,13 @@ class ModuleLoader { | |||
| 446 | 464 | /** | |
| 447 | 465 | * Load a module and translate it into a ModuleWrap for require() in imported CJS. | |
| 448 | 466 | * This is run synchronously, and the translator always return a ModuleWrap synchronously. | |
| 449 | - * @param {string} url URL of the module to be translated. | ||
| 467 | + * @param {ResolveResult} resolveResult Result from the resolve step. | ||
| 450 | 468 | * @param {object} loadContext See {@link load} | |
| 451 | 469 | * @param {string|undefined} parentURL URL of the parent module. Undefined if it's the entry point. | |
| 452 | 470 | * @returns {ModuleWrap} | |
| 453 | 471 | */ | |
| 454 | - loadAndTranslateForRequireInImportedCJS(url, loadContext, parentURL) { | ||
| 472 | + loadAndTranslateForRequireInImportedCJS(resolveResult, loadContext, parentURL) { | ||
| 473 | + const { url } = resolveResult; | ||
| 455 | 474 | const loadResult = this.#loadSync(url, loadContext); | |
| 456 | 475 | const formatFromLoad = loadResult.format; | |
| 457 | 476 | ||
@@ -473,7 +492,12 @@ class ModuleLoader { | |||
| 473 | 492 | translatorKey = 'require-commonjs-typescript'; | |
| 474 | 493 | } | |
| 475 | 494 | ||
| 476 | - const translateContext = { ...loadResult, translatorKey, __proto__: null }; | ||
| 495 | + const translateContext = { | ||
| 496 | + ...resolveResult, | ||
| 497 | + ...loadResult, | ||
| 498 | + translatorKey, | ||
| 499 | + __proto__: null, | ||
| 500 | + }; | ||
| 477 | 501 | const wrap = this.#translate(url, translateContext, parentURL); | |
| 478 | 502 | assert(wrap instanceof ModuleWrap, `Translator used for require(${url}) should not be async`); | |
| 479 | 503 | return wrap; | |
@@ -482,15 +506,21 @@ class ModuleLoader { | |||
| 482 | 506 | /** | |
| 483 | 507 | * Load a module and translate it into a ModuleWrap for ordinary imported ESM. | |
| 484 | 508 | * This may be run asynchronously if there are asynchronous module loader hooks registered. | |
| 485 | - * @param {string} url URL of the module to be translated. | ||
| 509 | + * @param {ResolveResult} resolveResult Result from the resolve step. | ||
| 486 | 510 | * @param {object} loadContext See {@link load} | |
| 487 | 511 | * @param {string|undefined} parentURL URL of the parent module. Undefined if it's the entry point. | |
| 488 | 512 | * @returns {Promise<ModuleWrap>|ModuleWrap} | |
| 489 | 513 | */ | |
| 490 | - loadAndTranslate(url, loadContext, parentURL) { | ||
| 514 | + loadAndTranslate(resolveResult, loadContext, parentURL) { | ||
| 515 | + const { url } = resolveResult; | ||
| 491 | 516 | const maybePromise = this.load(url, loadContext); | |
| 492 | 517 | const afterLoad = (loadResult) => { | |
| 493 | - const translateContext = { ...loadResult, translatorKey: loadResult.format, __proto__: null }; | ||
| 518 | + const translateContext = { | ||
| 519 | + ...resolveResult, | ||
| 520 | + ...loadResult, | ||
| 521 | + translatorKey: loadResult.format, | ||
| 522 | + __proto__: null, | ||
| 523 | + }; | ||
| 494 | 524 | return this.#translate(url, translateContext, parentURL); | |
| 495 | 525 | }; | |
| 496 | 526 | if (isPromise(maybePromise)) { | |
@@ -506,7 +536,7 @@ class ModuleLoader { | |||
| 506 | 536 | * the module should be linked by the time this returns. Otherwise it may still have | |
| 507 | 537 | * pending module requests. | |
| 508 | 538 | * @param {string} parentURL See {@link getOrCreateModuleJob} | |
| 509 | - * @param {{format: string, url: string}} resolveResult | ||
| 539 | + * @param {ResolveResult} resolveResult | ||
| 510 | 540 | * @param {ModuleRequest} request Module request. | |
| 511 | 541 | * @param {ModuleRequestType} requestType Type of the module request. | |
| 512 | 542 | * @returns {ModuleJobBase} The (possibly pending) module job | |
@@ -545,11 +575,11 @@ class ModuleLoader { | |||
| 545 | 575 | ||
| 546 | 576 | let moduleOrModulePromise; | |
| 547 | 577 | if (requestType === kRequireInImportedCJS) { | |
| 548 | - moduleOrModulePromise = this.loadAndTranslateForRequireInImportedCJS(url, context, parentURL); | ||
| 578 | + moduleOrModulePromise = this.loadAndTranslateForRequireInImportedCJS(resolveResult, context, parentURL); | ||
| 549 | 579 | } else if (requestType === kImportInRequiredESM) { | |
| 550 | - moduleOrModulePromise = this.loadAndTranslateForImportInRequiredESM(url, context, parentURL, request); | ||
| 580 | + moduleOrModulePromise = this.loadAndTranslateForImportInRequiredESM(resolveResult, context, parentURL, request); | ||
| 551 | 581 | } else { | |
| 552 | - moduleOrModulePromise = this.loadAndTranslate(url, context, parentURL); | ||
| 582 | + moduleOrModulePromise = this.loadAndTranslate(resolveResult, context, parentURL); | ||
| 553 | 583 | } | |
| 554 | 584 | ||
| 555 | 585 | if (requestType === kImportInRequiredESM || requestType === kRequireInImportedCJS || | |
@@ -663,7 +693,7 @@ class ModuleLoader { | |||
| 663 | 693 | * @param {string} [parentURL] The URL of the module where the module request is initiated. | |
| 664 | 694 | * It's undefined if it's from the root module. | |
| 665 | 695 | * @param {ModuleRequest} request Module request. | |
| 666 | - * @returns {Promise<{format: string, url: string}>|{format: string, url: string}} | ||
| 696 | + * @returns {Promise<ResolveResult>|ResolveResult} | ||
| 667 | 697 | */ | |
| 668 | 698 | #resolve(parentURL, request) { | |
| 669 | 699 | if (this.isForAsyncLoaderHookWorker) { | |
@@ -699,15 +729,18 @@ class ModuleLoader { | |||
| 699 | 729 | /** | |
| 700 | 730 | * This is the default resolve step for module.registerHooks(), which incorporates asynchronous hooks | |
| 701 | 731 | * from module.register() which are run in a blocking fashion for it to be synchronous. | |
| 732 | + * @param {{isResolvedByDefaultResolve: boolean}} out Output object to track whether the default resolve was used | ||
| 733 | + * without polluting the user-visible resolve result. | ||
| 702 | 734 | * @param {string|URL} specifier See {@link resolveSync}. | |
| 703 | 735 | * @param {{ parentURL?: string, importAttributes: ImportAttributes, conditions?: string[]}} context | |
| 704 | 736 | * See {@link resolveSync}. | |
| 705 | 737 | * @returns {{ format: string, url: string }} | |
| 706 | 738 | */ | |
| 707 | - #resolveAndMaybeBlockOnLoaderThread(specifier, context) { | ||
| 739 | + #resolveAndMaybeBlockOnLoaderThread(out, specifier, context) { | ||
| 708 | 740 | if (this.#asyncLoaderHooks?.resolveSync) { | |
| 709 | 741 | return this.#asyncLoaderHooks.resolveSync(specifier, context.parentURL, context.importAttributes); | |
| 710 | 742 | } | |
| 743 | + out.isResolvedByDefaultResolve = true; | ||
| 711 | 744 | return this.#cachedDefaultResolve(specifier, context); | |
| 712 | 745 | } | |
| 713 | 746 | ||
@@ -722,31 +755,45 @@ class ModuleLoader { | |||
| 722 | 755 | * @param {boolean} [shouldSkipSyncHooks] Whether to skip the synchronous hooks registered by module.registerHooks(). | |
| 723 | 756 | * This is used to maintain compatibility for the re-invented require.resolve (in imported CJS customized | |
| 724 | 757 | * by module.register()`) which invokes the CJS resolution separately from the hook chain. | |
| 725 | - * @returns {{ format: string, url: string }} | ||
| 758 | + * @returns {ResolveResult} | ||
| 726 | 759 | */ | |
| 727 | 760 | resolveSync(parentURL, request, shouldSkipSyncHooks = false) { | |
| 728 | 761 | const specifier = `${request.specifier}`; | |
| 729 | 762 | const importAttributes = request.attributes ?? kEmptyObject; | |
| 763 | + // Use an output parameter to track the state and avoid polluting the user-visible resolve results. | ||
| 764 | + const out = { isResolvedByDefaultResolve: false, __proto__: null }; | ||
| 730 | 765 | ||
| 766 | + let result; | ||
| 767 | + let isResolvedBySyncHooks = false; | ||
| 731 | 768 | if (!shouldSkipSyncHooks && syncResolveHooks.length) { | |
| 732 | 769 | // Has module.registerHooks() hooks, chain the asynchronous hooks in the default step. | |
| 733 | - return resolveWithSyncHooks(specifier, parentURL, importAttributes, this.#defaultConditions, | ||
| 734 | - this.#resolveAndMaybeBlockOnLoaderThread.bind(this)); | ||
| 770 | + result = resolveWithSyncHooks(specifier, parentURL, importAttributes, this.#defaultConditions, | ||
| 771 | + this.#resolveAndMaybeBlockOnLoaderThread.bind(this, out)); | ||
| 772 | + // If the default step ran, sync hooks did not short-circuit the resolution. | ||
| 773 | + isResolvedBySyncHooks = !out.isResolvedByDefaultResolve; | ||
| 774 | + } else { | ||
| 775 | + const context = { | ||
| 776 | + ...request, | ||
| 777 | + conditions: this.#defaultConditions, | ||
| 778 | + parentURL, | ||
| 779 | + importAttributes, | ||
| 780 | + __proto__: null, | ||
| 781 | + }; | ||
| 782 | + result = this.#resolveAndMaybeBlockOnLoaderThread(out, specifier, context); | ||
| 735 | 783 | } | |
| 736 | - const context = { | ||
| 737 | - ...request, | ||
| 738 | - conditions: this.#defaultConditions, | ||
| 739 | - parentURL, | ||
| 740 | - importAttributes, | ||
| 741 | - __proto__: null, | ||
| 742 | - }; | ||
| 743 | - return this.#resolveAndMaybeBlockOnLoaderThread(specifier, context); | ||
| 784 | + result.isResolvedBySyncHooks = isResolvedBySyncHooks; | ||
| 785 | + return result; | ||
| 744 | 786 | } | |
| 745 | 787 | ||
| 746 | 788 | /** | |
| 747 | 789 | * Provide source that is understood by one of Node's translators. Handles customization hooks, | |
| 748 | 790 | * if any. | |
| 749 | - * @typedef { {format: ModuleFormat, source: ModuleSource }} LoadResult | ||
| 791 | + * @typedef {{ | ||
| 792 | + * format: ModuleFormat, | ||
| 793 | + * source: ModuleSource, | ||
| 794 | + * responseURL?: string, | ||
| 795 | + * isSourceLoadedSynchronously: boolean, | ||
| 796 | + * }} LoadResult | ||
| 750 | 797 | * @param {string} url The URL of the module to be loaded. | |
| 751 | 798 | * @param {object} context Metadata about the module | |
| 752 | 799 | * @returns {Promise<LoadResult> | LoadResult}} | |
@@ -762,14 +809,19 @@ class ModuleLoader { | |||
| 762 | 809 | /** | |
| 763 | 810 | * This is the default load step for module.registerHooks(), which incorporates asynchronous hooks | |
| 764 | 811 | * from module.register() which are run in a blocking fashion for it to be synchronous. | |
| 812 | + * @param {{isSourceLoadedSynchronously: boolean}} out | ||
| 813 | + * Output object to track whether the source was loaded synchronously without polluting | ||
| 814 | + * the user-visible load result. | ||
| 765 | 815 | * @param {string} url See {@link load} | |
| 766 | 816 | * @param {object} context See {@link load} | |
| 767 | 817 | * @returns {{ format: ModuleFormat, source: ModuleSource }} | |
| 768 | 818 | */ | |
| 769 | - #loadAndMaybeBlockOnLoaderThread(url, context) { | ||
| 819 | + #loadAndMaybeBlockOnLoaderThread(out, url, context) { | ||
| 770 | 820 | if (this.#asyncLoaderHooks?.loadSync) { | |
| 821 | + out.isSourceLoadedSynchronously = false; | ||
| 771 | 822 | return this.#asyncLoaderHooks.loadSync(url, context); | |
| 772 | 823 | } | |
| 824 | + out.isSourceLoadedSynchronously = true; | ||
| 773 | 825 | return defaultLoadSync(url, context); | |
| 774 | 826 | } | |
| 775 | 827 | ||
@@ -780,17 +832,32 @@ class ModuleLoader { | |||
| 780 | 832 | * This is here to support `require()` in imported CJS and `module.registerHooks()` hooks. | |
| 781 | 833 | * @param {string} url See {@link load} | |
| 782 | 834 | * @param {object} [context] See {@link load} | |
| 783 | - * @returns {{ format: ModuleFormat, source: ModuleSource }} | ||
| 835 | + * @returns {LoadResult} | ||
| 784 | 836 | */ | |
| 785 | 837 | #loadSync(url, context) { | |
| 838 | + // Use an output parameter to track the state and avoid polluting the user-visible resolve results. | ||
| 839 | + const out = { | ||
| 840 | + isSourceLoadedSynchronously: true, | ||
| 841 | + __proto__: null, | ||
| 842 | + }; | ||
| 843 | + let result; | ||
| 786 | 844 | if (syncLoadHooks.length) { | |
| 787 | 845 | // Has module.registerHooks() hooks, chain the asynchronous hooks in the default step. | |
| 788 | 846 | // TODO(joyeecheung): construct the ModuleLoadContext in the loaders directly instead | |
| 789 | 847 | // of converting them from plain objects in the hooks. | |
| 790 | - return loadWithSyncHooks(url, context.format, context.importAttributes, this.#defaultConditions, | ||
| 791 | - this.#loadAndMaybeBlockOnLoaderThread.bind(this), validateLoadSloppy); | ||
| 848 | + result = loadWithSyncHooks( | ||
| 849 | + url, | ||
| 850 | + context.format, | ||
| 851 | + context.importAttributes, | ||
| 852 | + this.#defaultConditions, | ||
| 853 | + this.#loadAndMaybeBlockOnLoaderThread.bind(this, out), | ||
| 854 | + validateLoadSloppy, | ||
| 855 | + ); | ||
| 856 | + } else { | ||
| 857 | + result = this.#loadAndMaybeBlockOnLoaderThread(out, url, context); | ||
| 792 | 858 | } | |
| 793 | - return this.#loadAndMaybeBlockOnLoaderThread(url, context); | ||
| 859 | + result.isSourceLoadedSynchronously = out.isSourceLoadedSynchronously; | ||
| 860 | + return result; | ||
| 794 | 861 | } | |
| 795 | 862 | ||
| 796 | 863 | validateLoadResult(url, format) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments