mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Avoid spurious deprecation warnings when editor URIs are undefined
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
@@ -655,18 +655,24 @@ class Workspace extends Model
|
||||
|
||||
# Removes the item's uri from the list of potential items to reopen.
|
||||
itemOpened: (item) ->
|
||||
if typeof item.getUri is 'function' and not typeof item.getURI is 'function'
|
||||
if typeof item.getURI is 'function'
|
||||
uri = item.getURI()
|
||||
else if typeof item.getUri is 'function'
|
||||
deprecate("Pane items should implement `::getURI` instead of `::getUri`.")
|
||||
uri = item.getUri()
|
||||
|
||||
if uri = item.getURI?() ? item.getUri?()
|
||||
if uri?
|
||||
_.remove(@destroyedItemURIs, uri)
|
||||
|
||||
# Adds the destroyed item's uri to the list of items to reopen.
|
||||
didDestroyPaneItem: ({item}) =>
|
||||
if typeof item.getUri is 'function' and not typeof item.getURI is 'function'
|
||||
if typeof item.getURI is 'function'
|
||||
uri = item.getURI()
|
||||
else if typeof item.getUri is 'function'
|
||||
deprecate("Pane items should implement `::getURI` instead of `::getUri`.")
|
||||
uri = item.getUri()
|
||||
|
||||
if uri = item.getURI?() ? item.getUri?()
|
||||
if uri?
|
||||
@destroyedItemURIs.push(uri)
|
||||
|
||||
# Called by Model superclass when destroyed
|
||||
|
||||
Reference in New Issue
Block a user