Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
81 lines
1.8 KiB
JavaScript
81 lines
1.8 KiB
JavaScript
"use strict";
|
|
|
|
const LoaderLoadingError = require("./LoaderLoadingError");
|
|
|
|
let url;
|
|
|
|
function handleResult(loader, module, callback) {
|
|
if (typeof module !== "function" && typeof module !== "object") {
|
|
return callback(
|
|
new LoaderLoadingError(
|
|
`Module '${
|
|
loader.path
|
|
}' is not a loader (export function or es6 module)`
|
|
)
|
|
);
|
|
}
|
|
|
|
loader.normal = typeof module === "function" ? module : module.default;
|
|
loader.pitch = module.pitch;
|
|
loader.raw = module.raw;
|
|
|
|
if (
|
|
typeof loader.normal !== "function" &&
|
|
typeof loader.pitch !== "function"
|
|
) {
|
|
return callback(
|
|
new LoaderLoadingError(
|
|
`Module '${
|
|
loader.path
|
|
}' is not a loader (must have normal or pitch function)`
|
|
)
|
|
);
|
|
}
|
|
callback();
|
|
}
|
|
|
|
module.exports = function loadLoader(loader, callback) {
|
|
if (loader.type === "module") {
|
|
try {
|
|
if (url === undefined) url = require("url");
|
|
|
|
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
|
const loaderUrl = url.pathToFileURL(loader.path);
|
|
// eslint-disable-next-line no-eval
|
|
const modulePromise = eval(
|
|
`import(${JSON.stringify(loaderUrl.toString())})`
|
|
);
|
|
|
|
modulePromise.then((module) => {
|
|
handleResult(loader, module, callback);
|
|
}, callback);
|
|
} catch (err) {
|
|
callback(err);
|
|
}
|
|
} else {
|
|
let loadedModule;
|
|
|
|
try {
|
|
loadedModule = require(loader.path);
|
|
} catch (err) {
|
|
// it is possible for node to choke on a require if the FD descriptor
|
|
// limit has been reached. give it a chance to recover.
|
|
if (err instanceof Error && err.code === "EMFILE") {
|
|
const retry = loadLoader.bind(null, loader, callback);
|
|
|
|
if (typeof setImmediate === "function") {
|
|
// node >= 0.9.0
|
|
return setImmediate(retry);
|
|
}
|
|
|
|
// node < 0.9.0
|
|
return process.nextTick(retry);
|
|
}
|
|
|
|
return callback(err);
|
|
}
|
|
|
|
return handleResult(loader, loadedModule, callback);
|
|
}
|
|
};
|