Skip to main content

DeprecationWarning

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

ParamTypeDescription
messagestringThe deprecation message to be displayed.
[oncePerCaller]booleanIf 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]numberOnly 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

ParamTypeDescription
outboundObjectthe object with the old event to dispatch
inboundObjectthe object with the new event to map to the old event
oldEventNamestringthe name of the old event
newEventNamestringthe name of the new event
[canonicalOutboundName]stringthe canonical name of the old event
[canonicalInboundName]stringthe canonical name of the new event

deprecateConstant(obj, oldId, newId)

Create a deprecation warning and action for updated constants

Kind: global function

ParamTypeDescription
objObject
oldIdstringMenu Id
newIdstringMenu Id