#1265 Add context to uncaught javascript exception

Birleştirildi
herby amber/master 2 yıl önce içindeki max/exception_handling işlemelerini 1 ile birleştirdi
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      lang/base/kernel-runtime.js

+ 5 - 0
lang/base/kernel-runtime.js

@@ -343,6 +343,11 @@ define(['./junk-drawer'], function ($goodies) {
             function resultWithNoErrorHandling (worker) {
                 try {
                     return worker(thisContext);
+                } catch (error) {
+                    if (error.context == null) {
+                        error.context = thisContext;
+                    }
+                    throw error;                                
                 } finally {
                     thisContext = null;
                 }