Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 472019f

Browse files
committed
chore($parse): name anonymous functions for better debugging
1 parent a17578a commit 472019f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ng/parse.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ Lexer.prototype = {
308308
token.constant = true;
309309
} else {
310310
var getter = getterFn(ident, this.options, this.text);
311-
token.fn = extend(function(self, locals) {
312-
return (getter(self, locals));
311+
// TODO(perf): consider exposing the getter reference
312+
token.fn = extend(function $parsePathGetter(self, locals) {
313+
return getter(self, locals);
313314
}, {
314315
assign: function(self, value) {
315316
return setter(self, ident, value, parser.text);
@@ -676,7 +677,7 @@ Parser.prototype = {
676677
var field = this.expect().text;
677678
var getter = getterFn(field, this.options, this.text);
678679

679-
return extend(function(scope, locals, self) {
680+
return extend(function $parseFieldAccess(scope, locals, self) {
680681
return getter(self || object(scope, locals));
681682
}, {
682683
assign: function(scope, value, locals) {
@@ -693,7 +694,7 @@ Parser.prototype = {
693694
var indexFn = this.expression();
694695
this.consume(']');
695696

696-
return extend(function(self, locals) {
697+
return extend(function $parseObjectIndex(self, locals) {
697698
var o = obj(self, locals),
698699
i = indexFn(self, locals),
699700
v;
@@ -726,7 +727,7 @@ Parser.prototype = {
726727
// we can safely reuse the array across invocations
727728
var args = argsFn.length ? [] : null;
728729

729-
return function(scope, locals) {
730+
return function $parseFunctionCall(scope, locals) {
730731
var context = contextGetter ? contextGetter(scope, locals) : scope;
731732
var fn = fnGetter(scope, locals, context) || noop;
732733

0 commit comments

Comments
 (0)