Assign atom.lastUncaughtError in window.onerror handler

This commit is contained in:
Nathan Sobo
2014-08-25 16:36:03 -06:00
parent 69aa34954f
commit c4f5a3516b

View File

@@ -111,6 +111,7 @@ class Atom extends Model
remote.getCurrentWindow()
workspaceViewParentSelector: 'body'
lastUncaughtError: null
# Call .loadOrCreate instead
constructor: (@state) ->
@@ -125,6 +126,7 @@ class Atom extends Model
window.onerror = =>
@openDevTools()
@executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()')
@lastUncaughtError = Array::slice.call(arguments)
@emit 'uncaught-error', arguments...
@unsubscribe()