#1265 Add context to uncaught javascript exception

Zlúčené
herby mergnuté 1 commitov z max/exception_handling do amber/master 2 rokov pred
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  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;
                 }