Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 2.64 KB

DeprecationWarning.md

File metadata and controls

63 lines (47 loc) · 2.64 KB

Import :

const DeprecationWarning = brackets.getModule("utils/DeprecationWarning")

EventDispatcher

Utilities functions to display deprecation warning in the console.

Kind: global variable

deprecationWarning(message, [oncePerCaller], [callerStackPos])

Show deprecation warning with the call stack if it has never been displayed before.

Kind: global function

Param Type Description
message string The deprecation message to be displayed.
[oncePerCaller] boolean If true, displays the message once for each unique call location. If false (the default), only displays the message once no matter where it's called from. Note that setting this to true can cause a slight performance hit (because it has to generate a stack trace), so don't set this for functions that you expect to be called from performance- sensitive code (e.g. tight loops).
[callerStackPos] number Only used if oncePerCaller=true. Overrides the Error().stack depth where the client-code caller can be found. Only needed if extra shim layers are involved.

deprecateEvent(outbound, inbound, oldEventName, newEventName, [canonicalOutboundName], [canonicalInboundName])

Show a deprecation warning if there are listeners for the event

   DeprecationWarning.deprecateEvent(exports,
                                     MainViewManager,
                                     "workingSetAdd",
                                     "workingSetAdd",
                                     "DocumentManager.workingSetAdd",
                                     "MainViewManager.workingSetAdd");

Kind: global function

Param Type Description
outbound Object the object with the old event to dispatch
inbound Object the object with the new event to map to the old event
oldEventName string the name of the old event
newEventName string the name of the new event
[canonicalOutboundName] string the canonical name of the old event
[canonicalInboundName] string the canonical name of the new event

deprecateConstant(obj, oldId, newId)

Create a deprecation warning and action for updated constants

Kind: global function

Param Type Description
obj Object
oldId string Menu Id
newId string Menu Id