Special case printing -0

Use the 1/x trick to determine if a value is -0 and special case the
printing of it.

[closes #496]
This commit is contained in:
Sheel Choksi
2014-02-09 14:14:33 -08:00
parent 83c0ea7f91
commit 7cf899a4ea
3 changed files with 5 additions and 0 deletions

View File

@@ -11,6 +11,8 @@ getJasmineRequireObj().pp = function(j$) {
this.emitScalar('undefined');
} else if (value === null) {
this.emitScalar('null');
} else if (value === 0 && 1/value === -Infinity) {
this.emitScalar('-0');
} else if (value === j$.getGlobal()) {
this.emitScalar('<global>');
} else if (value.jasmineToString) {