Skip to content

Commit 0108e71

Browse files
committed
debug & benchmark updates
1 parent 590a7ee commit 0108e71

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

examples/todomvc/js/benchmark.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
// toggle them one by one
44
// then delete them one by one
55

6-
// do not run when testing in PhantomJS
7-
if (window.location.search === '?benchmark=1') {
8-
runBenchmark()
9-
}
6+
(function () {
107

11-
function runBenchmark () {
8+
var benchSetting = window.location.search.match(/\bbenchmark=(\d+)/)
9+
if (!benchSetting) return
1210

13-
var itemsToAdd = 200,
11+
var itemsToAdd = +benchSetting[1],
1412
now = window.performance && window.performance.now
1513
? function () { return window.performance.now(); }
1614
: Date.now,
@@ -74,4 +72,4 @@ function runBenchmark () {
7472
}
7573
}, 0)
7674

77-
}
75+
})()

src/utils.js

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ var utils = module.exports = {
187187
warn: function() {
188188
if (!config.silent && console) {
189189
console.warn(join.call(arguments, ' '))
190+
if (config.debug) {
191+
console.trace()
192+
}
190193
}
191194
},
192195

0 commit comments

Comments
 (0)