File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
var _ = require ( './util' )
2
- var MAX_UPDATE_COUNT = 10
2
+ var config = require ( './config' )
3
3
4
4
// we have two separate queues: one for directive updates
5
5
// and one for user watcher registered via $watch().
@@ -70,7 +70,7 @@ exports.push = function (job) {
70
70
} else {
71
71
has [ id ] ++
72
72
// detect possible infinite update loops
73
- if ( has [ id ] > MAX_UPDATE_COUNT ) {
73
+ if ( has [ id ] > config . _maxUpdateCount ) {
74
74
_ . warn (
75
75
'You may have an infinite update loop for the ' +
76
76
'watcher with expression: "' + job . expression + '".'
@@ -92,4 +92,4 @@ exports.push = function (job) {
92
92
_ . nextTick ( flush )
93
93
}
94
94
}
95
- }
95
+ }
Original file line number Diff line number Diff line change @@ -85,7 +85,13 @@ module.exports = {
85
85
ONE_WAY : 0 ,
86
86
TWO_WAY : 1 ,
87
87
ONE_TIME : 2
88
- }
88
+ } ,
89
+
90
+ /**
91
+ * Max circular updates allowed in a batcher flush cycle.
92
+ */
93
+
94
+ _maxUpdateCount : 100
89
95
90
96
}
91
97
You can’t perform that action at this time.
0 commit comments