From 90d4834c0169bae14e197a9eac1d36d7e3299a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 11 Jun 2013 13:43:29 -0700 Subject: [PATCH] Clean up jsDump modifications a bit. --- test/lib/helpers.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/lib/helpers.js b/test/lib/helpers.js index aedfb386..cbf3b812 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -10,14 +10,15 @@ * All rights reserved. */ -// Register a jsDump parser for Base and override object parser to handle it - -var objectParser = QUnit.jsDump.parsers.object; - +// Register a jsDump parser for Base. QUnit.jsDump.setParser('Base', function (obj, stack) { return obj.toString(); }); +// Override the default object parser to handle Base objects. +// We need to keep a reference to the previous implementation. +var objectParser = QUnit.jsDump.parsers.object; + QUnit.jsDump.setParser('object', function (obj, stack) { return (obj instanceof Base ? QUnit.jsDump.parsers.Base