MCPcopy
hub / github.com/ampproject/amphtml / build

Method build

src/service/resource.js:323–342  ·  view source on GitHub ↗

* Requests the resource's element to be built. See AmpElement.build * for details. * @return {?Promise}

()

Source from the content-addressed store, hash-verified

321 * @return {?Promise}
322 */
323 build() {
324 if (this.isBuilding_ || !this.element.isUpgraded()) {
325 return null;
326 }
327 this.isBuilding_ = true;
328 return this.element.buildInternal().then(
329 () => {
330 this.isBuilding_ = false;
331 this.state_ = ResourceState_Enum.NOT_LAID_OUT;
332 // TODO(dvoytenko): merge with the standard BUILT signal.
333 this.element.signals().signal('res-built');
334 },
335 (reason) => {
336 this.maybeReportErrorOnBuildFailure(reason);
337 this.isBuilding_ = false;
338 this.element.signals().rejectSignal('res-built', reason);
339 throw reason;
340 }
341 );
342 }
343
344 /**
345 * @param {*} reason

Callers 14

constructorMethod · 0.95
buildCompilerFunction · 0.45
getDependenciesFunction · 0.45
getModuleGraphFunction · 0.45
createDriverFunction · 0.45
buildNewServerFunction · 0.45
test-resource.jsFile · 0.45
test-amp-img-v1.jsFile · 0.45
getStubbedImgFunction · 0.45

Calls 7

isUpgradedMethod · 0.80
buildInternalMethod · 0.80
rejectSignalMethod · 0.80
thenMethod · 0.45
signalMethod · 0.45
signalsMethod · 0.45

Tested by

no test coverage detected