01:package jsint;
02:
03:/**
04: * A jsint.JschemeThrowable is used to support throwing and catching
05: * of objects in Jscheme programs.
06: * @author Timothy J. Hickey, Copyright 2000, tim@cs.brandeis.edu, <a href="license.txt">license</a>
07: * subsequently modified by Jscheme project members
08: * licensed under zlib licence (see license.txt)
09: */
10:
11:public class JschemeThrowable extends RuntimeException {
12: public Object contents;
13:
14: public JschemeThrowable(Object contents) {
15: this .contents = contents;
16: }
17:
18: public JschemeThrowable(String message, Object contents) {
19: super (message);
20: this .contents = contents;
21: }
22:
23: public String toString(){
24: return ("JschemeThrowable:[["+ U.stringify(this .getMessage(),false)+
25: ","+ U.stringify(contents,false))+"]]";
26: }
27:
28: /** Clever performance trick i found in
29: http://docs.msdnaa.net/ark_new/Webfiles/WhitePapers/Babel01/bab12.pdf
30: **/
31: public Throwable fillInStackTrace() {
32: return this;
33: }
34:}
|