* Calls the specified function on this amp-script's worker-dom instance. * Accepts variable number of args to pass along to the underlying worker. * * @param {string} unusedFnId - function identifier * @param {...*} unusedFnArgs * @return {!Promise<*>}
(unusedFnId, unusedFnArgs)
| 231 | * @return {!Promise<*>} |
| 232 | */ |
| 233 | callFunction(unusedFnId, unusedFnArgs) { |
| 234 | return this.initialize_.promise.then(() => { |
| 235 | if (!this.workerDom_) { |
| 236 | return Promise.reject( |
| 237 | new Error( |
| 238 | 'Attempted to call a function on an amp-script which failed initialization.' |
| 239 | ) |
| 240 | ); |
| 241 | } |
| 242 | |
| 243 | return this.workerDom_.callFunction.apply(this.workerDom_, arguments); |
| 244 | }); |
| 245 | } |
| 246 | |
| 247 | /** @override */ |
| 248 | layoutCallback() { |
no test coverage detected