Redirect window.onerror to uncaughtException.
This commit is contained in:
parent
7ba03ce23d
commit
0a84c30d3b
1 changed files with 8 additions and 0 deletions
|
@ -37,3 +37,11 @@ if window.location.protocol is 'file:'
|
||||||
else
|
else
|
||||||
global.__filename = __filename
|
global.__filename = __filename
|
||||||
global.__dirname = __dirname
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue