MCPcopy Index your code
hub / github.com/ampproject/amphtml / executeAction

Method executeAction

src/base-element.js:727–741  ·  view source on GitHub ↗

* Requests the element to execute the specified method. If method must have * been previously registered using registerAction, otherwise an * error is thrown. * @param {!./service/action-impl.ActionInvocation} invocation The invocation data. * @param {boolean=} unusedDeferred Whe

(invocation, unusedDeferred)

Source from the content-addressed store, hash-verified

725 * @return {*} TODO(#23582): Specify return type
726 */
727 executeAction(invocation, unusedDeferred) {
728 let {method} = invocation;
729 // If the default action has an alias, the handler will be stored under it.
730 if (method === DEFAULT_ACTION) {
731 method = this['defaultActionAlias_'] || method;
732 }
733 initActionMap(this);
734 const holder = this['actionMap_'][method];
735 const {tagName} = this.element;
736 userAssert(holder, `Method not found: ${method} in ${tagName}`);
737 const {handler, minTrust} = holder;
738 if (invocation.satisfiesTrust(minTrust)) {
739 return handler(invocation);
740 }
741 }
742
743 /**
744 * Utility method that forwards the given list of non-bubbling events

Callers 2

executionAction_Method · 0.45

Calls 4

userAssertFunction · 0.90
initActionMapFunction · 0.85
satisfiesTrustMethod · 0.80
handlerFunction · 0.50

Tested by

no test coverage detected