projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ba03ce
)
Redirect window.onerror to uncaughtException.
author
Cheng Zhao
<zcbenz@gmail.com>
Sun, 15 Dec 2013 08:32:41 +0000
(16:32 +0800)
committer
Cheng Zhao
<zcbenz@gmail.com>
Sun, 15 Dec 2013 08:32:41 +0000
(16:32 +0800)
renderer/lib/init.coffee
patch
|
blob
|
history
diff --git
a/renderer/lib/init.coffee
b/renderer/lib/init.coffee
index 32d3d2ac61d5eb4cee699fc20a9ceb54df1a819b..f481146ace6255078792eddd9d1e9b65de7e477d 100644
(file)
--- a/
renderer/lib/init.coffee
+++ b/
renderer/lib/init.coffee
@@
-37,3
+37,11
@@
if window.location.protocol is 'file:'
else
global.__filename = __filename
global.__dirname = __dirname
+
+# Redirect window.onerror to uncaughtException.
+window.onerror = (error) ->
+ if global.process.listeners('uncaughtException').length > 0
+ global.process.emit 'uncaughtException', error
+ true
+ else
+ false