MCPcopy Create free account
hub / github.com/ampproject/amphtml / callTask_

Function callTask_

src/service/vsync-impl.js:453–469  ·  view source on GitHub ↗

* For optimization reasons to stop try/catch from blocking optimization. * @param {function(!VsyncStateDef):undefined|undefined} callback * @param {!VsyncStateDef} state * @return {boolean}

(callback, state)

Source from the content-addressed store, hash-verified

451 * @return {boolean}
452 */
453function callTask_(callback, state) {
454 devAssert(callback);
455 try {
456 const ret = callback(state);
457 if (ret !== undefined) {
458 dev().error(
459 'VSYNC',
460 'callback returned a value but vsync cannot propagate it: %s',
461 callback.toString()
462 );
463 }
464 } catch (e) {
465 rethrowAsync(e);
466 return false;
467 }
468 return true;
469}
470
471/**
472 * @param {!Window} window

Callers 1

runScheduledTasks_Method · 0.85

Calls 6

devAssertFunction · 0.90
devFunction · 0.90
rethrowAsyncFunction · 0.90
callbackFunction · 0.50
errorMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected