MCPcopy Create free account
hub / github.com/SAP/ui5-builder / closeModule

Method closeModule

lib/lbt/bundle/Builder.js:207–227  ·  view source on GitHub ↗
(resolvedModule)

Source from the content-addressed store, hash-verified

205 }
206
207 closeModule(resolvedModule) {
208 if ( resolvedModule.containsCoreSync ) {
209 if ( this.getEffectiveUi5MajorVersion() >= 2 ) {
210 throw new Error("Requiring sap/ui/core/Core synchronously is not supported as of UI5 Version 2");
211 }
212 this.outW.ensureNewLine(); // for clarity and to avoid issues with single line comments
213 this.writeWithSourceMap(
214 `// as this module contains the Core, we ensure that the Core has been booted\n` +
215 `sap.ui.getCore?.().boot?.();`);
216 }
217 if ( this.shouldDecorate && this.options.addTryCatchRestartWrapper ) {
218 this.outW.ensureNewLine(); // for clarity and to avoid issues with single line comments
219 this.writeWithSourceMap(
220 `} catch(oError) {\n` +
221 `if (oError.name != "Restart") { throw oError; }\n` +
222 `}`);
223 }
224 if (this.options.sourceMap) {
225 this.outW.writeln(`//# sourceMappingURL=${path.posix.basename(resolvedModule.name)}.map`);
226 }
227 }
228
229 async addSection(section) {
230 this.ensureRawDeclarations();

Callers 1

_createBundleMethod · 0.95

Calls 4

writeWithSourceMapMethod · 0.95
ensureNewLineMethod · 0.80
writelnMethod · 0.80

Tested by

no test coverage detected