fix IE null ref exception

This commit is contained in:
Leo Horie 2014-10-03 13:31:02 -04:00
parent 35d328f416
commit 50173f0e74
4 changed files with 15 additions and 8 deletions

View file

@ -1,10 +1,15 @@
if (!this.console) {
var log = function(value) {document.write("<pre>" + value + "</pre>")}
this.console = {log: log, error: log}
}
function test(condition) {
var duration = 0
var start = 0
var result = true
test.total++
if (typeof performance != "undefined") {
if (this.performance != null && performance.now) {
start = performance.now()
}
try {
@ -15,7 +20,7 @@ function test(condition) {
console.error(e)
test.failures.push(condition)
}
if (typeof performance != "undefined") {
if (this.performance != null && performance.now) {
duration = performance.now() - start
}