-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DEPRECATION] #14754 deprecate canDispatchToEventManager
#15078
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -538,7 +538,16 @@ export default Mixin.create({ | |
let owner = getOwner(this); | ||
let dispatcher = owner && owner.lookup('event_dispatcher:main'); | ||
|
||
if (dispatcher && dispatcher.canDispatchToEventManager === null) { | ||
deprecate( | ||
`[DEPRECATED] \`canDispatchToEventManager\` has been deprecated.`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have this message mention |
||
!('canDispatchToEventManager' in dispatcher), | ||
{ | ||
id: 'ember-views.event-dispatcher.canDispatchToEventManager', | ||
until: '3.0.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's change this to 2.16.0 |
||
} | ||
); | ||
|
||
if (dispatcher && !('canDispatchToEventManager' in dispatcher)) { | ||
dispatcher.canDispatchToEventManager = true; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import { assign, getOwner } from 'ember-utils'; | ||
import { assert } from 'ember-debug'; | ||
import { get, set, isNone, run } from 'ember-metal'; | ||
import { deprecate } from 'ember-debug'; | ||
import { Object as EmberObject } from 'ember-runtime'; | ||
import jQuery from './jquery'; | ||
import ActionManager from './action_manager'; | ||
|
@@ -129,13 +130,22 @@ export default EmberObject.extend({ | |
@type boolean | ||
@default false | ||
@since 1.7.0 | ||
@deprecated | ||
@private | ||
*/ | ||
canDispatchToEventManager: null, | ||
|
||
init() { | ||
this._super(); | ||
assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', environment.hasDOM); | ||
|
||
deprecate( | ||
`[DEPRECATED] \`canDispatchToEventManager\` has been deprecated.`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's mention which file this is in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, you should not need to prefix the message with |
||
!('canDispatchToEventManager' in this), | ||
{ | ||
id: 'ember-views.event-dispatcher.canDispatchToEventManager', | ||
until: '3.0.0' | ||
} | ||
); | ||
}, | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, we should not need to force this to be
null
in this test, the default ofundefined
should be enough