#1265 Add context to uncaught javascript exception

Sapludināts
herby sapludināja 1 revīzijas no max/exception_handling uz amber/master 2 gadi atpakaļ
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  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;
                 }