Disable deprecations unless in dev/spec mode

These are currently adding ~200ms to startup so temporarily disable
until the grim performance is improved and/or core and bundled packages
are updated to not call deprecated APIs.
This commit is contained in:
Kevin Sawicki
2014-09-24 10:23:10 -07:00
parent 7fdffdd201
commit 371e25af69

View File

@@ -158,6 +158,12 @@ class Atom extends Model
#
# Call after this instance has been assigned to the `atom` global.
initialize: ->
# Disable deprecations unless in dev mode or spec mode so that regular
# editor performance isn't impacted by generating stack traces for
# deprecated calls.
unless @inDevMode() or @inSpecMode()
require('grim').deprecate = ->
window.onerror = =>
@openDevTools()
@executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()')