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

Method dispatchEventForTesting_

extensions/amp-bind/0.1/bind-impl.js:1762–1773  ·  view source on GitHub ↗

* @param {string} name * @private

(name)

Source from the content-addressed store, hash-verified

1760 * @private
1761 */
1762 dispatchEventForTesting_(name) {
1763 if (getMode().test) {
1764 let event;
1765 if (typeof this.localWin_.Event === 'function') {
1766 event = new Event(name, {bubbles: true, cancelable: true});
1767 } else {
1768 event = this.localWin_.document.createEvent('Event');
1769 event.initEvent(name, /* bubbles */ true, /* cancelable */ true);
1770 }
1771 this.localWin_.dispatchEvent(event);
1772 }
1773 }
1774}
1775
1776class BindWalker {

Callers 3

setStateMethod · 0.95
initialize_Method · 0.95
onDomUpdate_Method · 0.95

Calls 1

getModeFunction · 0.90

Tested by

no test coverage detected