Clean up jsDump modifications a bit.

This commit is contained in:
Jürg Lehni 2013-06-11 13:43:29 -07:00
parent 3a043e0023
commit 90d4834c01

View file

@ -10,14 +10,15 @@
* All rights reserved. * All rights reserved.
*/ */
// Register a jsDump parser for Base and override object parser to handle it // Register a jsDump parser for Base.
var objectParser = QUnit.jsDump.parsers.object;
QUnit.jsDump.setParser('Base', function (obj, stack) { QUnit.jsDump.setParser('Base', function (obj, stack) {
return obj.toString(); 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) { QUnit.jsDump.setParser('object', function (obj, stack) {
return (obj instanceof Base return (obj instanceof Base
? QUnit.jsDump.parsers.Base ? QUnit.jsDump.parsers.Base