()
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public synchronized Throwable getCause() { |
| 87 | Throwable cause = super.getCause(); |
| 88 | if (cause != null) { |
| 89 | return cause; |
| 90 | } |
| 91 | |
| 92 | if (this.value instanceof JSObject) { |
| 93 | Object jsCause = ((JSObject) this.value).get(this.context, "cause"); |
| 94 | if (jsCause instanceof Throwable) { |
| 95 | return (Throwable) jsCause; |
| 96 | } else if (jsCause != null && jsCause != Types.UNDEFINED) { |
| 97 | return new ThrowException(this.context, jsCause); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | return null; |
| 102 | } |
| 103 | |
| 104 | } |