#1265 Add context to uncaught javascript exception

병합
herby max/exception_handling 에서 amber/master 로 1 commits 를 머지했습니다 2 년 전
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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;
                 }