|
@@ -861,20 +861,9 @@ function RuntimeBrik(brikz, st) {
|
|
|
try {
|
|
|
return inContext(worker, setup);
|
|
|
} catch(error) {
|
|
|
- if(error.smalltalkError) {
|
|
|
- handleError(error);
|
|
|
- } else {
|
|
|
- var errorWrapper = st.JavaScriptException._on_(error);
|
|
|
- try {errorWrapper._signal();} catch(ex) {}
|
|
|
- errorWrapper._context_(st.getThisContext());
|
|
|
- handleError(errorWrapper);
|
|
|
- }
|
|
|
-
|
|
|
- st.thisContext = undefined;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ handleError(error);
|
|
|
+ } finally {
|
|
|
+ st.thisContext = null;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -886,11 +875,25 @@ function RuntimeBrik(brikz, st) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ function wrappedError(error) {
|
|
|
+ var errorWrapper = st.JavaScriptException._on_(error);
|
|
|
+ try { errorWrapper._signal(); } catch (ex) {}
|
|
|
+ errorWrapper._context_(st.getThisContext());
|
|
|
+ return errorWrapper;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
(See the Smalltalk class ErrorHandler and its subclasses */
|
|
|
|
|
|
function handleError(error) {
|
|
|
+ if (!error.smalltalkError) {
|
|
|
+ error = wrappedError(error);
|
|
|
+ }
|
|
|
st.ErrorHandler._current()._handleError_(error);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|