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

Method assert

src/utils/log.js:388–402  ·  view source on GitHub ↗

* Throws an error if the first argument isn't trueish. * * Supports argument substitution into the message via %s placeholders. * * Throws an error object that has two extra properties: * - associatedElement: This is the first element provided in the var args. * It can be used fo

(shouldBeTrueish, opt_message, var_args)

Source from the content-addressed store, hash-verified

386 * @closurePrimitive {asserts.truthy}
387 */
388 assert(shouldBeTrueish, opt_message, var_args) {
389 if (isArray(opt_message)) {
390 return this.assert.apply(
391 this,
392 [shouldBeTrueish].concat(
393 this.expandMessageArgs_(/** @type {!Array} */ (opt_message))
394 )
395 );
396 }
397
398 return assertions.assert.apply(
399 null,
400 [this.suffix_].concat(Array.prototype.slice.call(arguments))
401 );
402 }
403
404 /**
405 * Throws an error if the first argument isn't an Element

Callers 15

output.jsFile · 0.80
input.jsFile · 0.80
output.jsFile · 0.80
input.jsFile · 0.80
output.jsFile · 0.80
input.jsFile · 0.80
output.jsFile · 0.80
input.jsFile · 0.80
output.jsFile · 0.80
input.jsFile · 0.80
output.jsFile · 0.80
input.jsFile · 0.80

Calls 4

expandMessageArgs_Method · 0.95
isArrayFunction · 0.85
applyMethod · 0.80
concatMethod · 0.80

Tested by

no test coverage detected