From 110be11a05cc4fced8fb91edb8a5d535b9f5ce21 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 13 Jun 2012 09:06:54 +0200 Subject: [PATCH] Ox.test: handle non-null values for which JSON.stringify returns 'null' --- source/Ox/js/JavaScript.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/JavaScript.js b/source/Ox/js/JavaScript.js index 4bf17452..ac7c998a 100644 --- a/source/Ox/js/JavaScript.js +++ b/source/Ox/js/JavaScript.js @@ -822,7 +822,10 @@ Ox.test = function(argument, callback) { } if (!isAsync && test.expected) { Ox.test.data[id].results.push({ - actual: JSON.stringify(actual), + actual: Ox.isEqual(actual, -0) ? '-0' + : Ox.isNaN(actual) ? 'NaN' + : Ox.isUndefined(actual) ? 'undefined' + : JSON.stringify(actual), expected: test.expected, name: item.name, section: item.section,