* Print out the current state in the console. * @param {(!Element|string)=} opt_elementOrExpr * @private
(opt_elementOrExpr)
| 1674 | * @private |
| 1675 | */ |
| 1676 | debugPrintState_(opt_elementOrExpr) { |
| 1677 | if (opt_elementOrExpr) { |
| 1678 | if (typeof opt_elementOrExpr == 'string') { |
| 1679 | const value = getValueForExpr(this.state_, opt_elementOrExpr); |
| 1680 | user().info(TAG, value); |
| 1681 | } else if (opt_elementOrExpr.nodeType == Node.ELEMENT_NODE) { |
| 1682 | const element = user().assertElement(opt_elementOrExpr); |
| 1683 | this.debugPrintElement_(element); |
| 1684 | } else { |
| 1685 | user().info( |
| 1686 | TAG, |
| 1687 | 'Invalid argument. Pass a JSON expression or an ' + |
| 1688 | 'element instead e.g. AMP.printState("foo.bar") or ' + |
| 1689 | 'AMP.printState($0) after selecting an element.' |
| 1690 | ); |
| 1691 | } |
| 1692 | } else { |
| 1693 | user().info(TAG, this.state_); |
| 1694 | } |
| 1695 | } |
| 1696 | |
| 1697 | /** |
| 1698 | * Print out the element's bound attributes and respective expression values. |
nothing calls this directly
no test coverage detected