From 261ad43c81de08032f9fbe0331031f8ee0fe14d2 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 15 Nov 2019 12:52:09 +0100 Subject: [PATCH] component: Add component reference to the mouse event handler deprecation warnings This makes the deprecations a lot more actionable because it's easier to see what component is causing the deprecation without having to open the debugger. --- packages/@ember/-internals/glimmer/lib/component.ts | 6 +++--- .../glimmer/tests/integration/event-dispatcher-test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@ember/-internals/glimmer/lib/component.ts b/packages/@ember/-internals/glimmer/lib/component.ts index 10d3ab44f1c..fb55ad0e47b 100644 --- a/packages/@ember/-internals/glimmer/lib/component.ts +++ b/packages/@ember/-internals/glimmer/lib/component.ts @@ -747,7 +747,7 @@ const Component = CoreView.extend( } deprecate( - `Using \`mouseEnter\` event handler methods in components has been deprecated.`, + `${this}: Using \`mouseEnter\` event handler methods in components has been deprecated.`, this.mouseEnter === undefined, { id: 'ember-views.event-dispatcher.mouseenter-leave-move', @@ -756,7 +756,7 @@ const Component = CoreView.extend( } ); deprecate( - `Using \`mouseLeave\` event handler methods in components has been deprecated.`, + `${this}: Using \`mouseLeave\` event handler methods in components has been deprecated.`, this.mouseLeave === undefined, { id: 'ember-views.event-dispatcher.mouseenter-leave-move', @@ -765,7 +765,7 @@ const Component = CoreView.extend( } ); deprecate( - `Using \`mouseMove\` event handler methods in components has been deprecated.`, + `${this}: Using \`mouseMove\` event handler methods in components has been deprecated.`, this.mouseMove === undefined, { id: 'ember-views.event-dispatcher.mouseenter-leave-move', diff --git a/packages/@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js b/packages/@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js index 81fcb628d30..fd34dac2c8f 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js @@ -403,7 +403,7 @@ moduleFor( }); expectDeprecation( - 'Using `mouseMove` event handler methods in components has been deprecated.' + /Using `mouseMove` event handler methods in components has been deprecated\./ ); this.render(`{{x-foo}}`);