(exp, interceptorFn)
| 16571 | return $parse; |
| 16572 | |
| 16573 | function $parse(exp, interceptorFn) { |
| 16574 | var parsedExpression, oneTime, cacheKey; |
| 16575 | |
| 16576 | switch (typeof exp) { |
| 16577 | case 'string': |
| 16578 | exp = exp.trim(); |
| 16579 | cacheKey = exp; |
| 16580 | |
| 16581 | parsedExpression = cache[cacheKey]; |
| 16582 | |
| 16583 | if (!parsedExpression) { |
| 16584 | if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { |
| 16585 | oneTime = true; |
| 16586 | exp = exp.substring(2); |
| 16587 | } |
| 16588 | var lexer = new Lexer($parseOptions); |
| 16589 | var parser = new Parser(lexer, $filter, $parseOptions); |
| 16590 | parsedExpression = parser.parse(exp); |
| 16591 | if (parsedExpression.constant) { |
| 16592 | parsedExpression.$$watchDelegate = constantWatchDelegate; |
| 16593 | } else if (oneTime) { |
| 16594 | parsedExpression.$$watchDelegate = parsedExpression.literal ? |
| 16595 | oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; |
| 16596 | } else if (parsedExpression.inputs) { |
| 16597 | parsedExpression.$$watchDelegate = inputsWatchDelegate; |
| 16598 | } |
| 16599 | cache[cacheKey] = parsedExpression; |
| 16600 | } |
| 16601 | return addInterceptor(parsedExpression, interceptorFn); |
| 16602 | |
| 16603 | case 'function': |
| 16604 | return addInterceptor(exp, interceptorFn); |
| 16605 | |
| 16606 | default: |
| 16607 | return addInterceptor(noop, interceptorFn); |
| 16608 | } |
| 16609 | } |
| 16610 | |
| 16611 | function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) { |
| 16612 |
no test coverage detected