Subj : JS Shell: throw {} To : netscape.public.mozilla.jseng From : Christian Biesinger Date : Sat Dec 25 2004 11:39 pm Hi, I was playing around a bit with js shell... I noticed this: js> throw {} can't convert undefined to an integer Is this the expected result? I was expecting something along the lines of "uncaught exception: object", maybe even "uncaught exception: {}" A second issue: js> throw { toString: function() { return "foo" } } can't convert undefined to an integer Why did this not print "uncaught exception: foo"? Compare: js> throw 42 uncaught exception: 42 js> throw "foo" uncaught exception: foo Throwing {} does seem to work: js> uneval({}); ({}) js> try { throw {}; } catch (e) { print(uneval(e)); } ({}) This is with latest CVS, Linux, "make -f Makefile.ref". -biesi .