Skip to content

Commit f6cd0c4

Browse files
committed
Avoid the Ember global deprecation
* Avoid the Ember global in workflow runtime code. This patch is dependent on #125 which included the code at emberjs/ember-jquery#321
1 parent e9044a2 commit f6cd0c4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

tests/dummy/config/deprecation-workflow.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ self.deprecationWorkflow.config = {
55
workflow: [
66
/*
77
* Actual controlled deprecations
8+
*
9+
* The ember-global log configuration is only required for
10+
* ember-release-with-jquery. All other ember-try scenarios pass with that
11+
* handler removed (and defaulting to a throw).
812
*/
913
{ matchId: 'ember-global', handler: 'log' },
1014

vendor/ember-cli-deprecation-workflow/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const LOG_LIMIT = 100;
3030
}
3131
}
3232

33-
Ember.Debug.registerDeprecationHandler(function handleDeprecationWorkflow(message, options, next){
33+
let registerDeprecationHandler = require.has('@ember/debug') ? require('@ember/debug').registerDeprecationHandler : Ember.Debug.registerDeprecationHandler;
34+
35+
registerDeprecationHandler(function handleDeprecationWorkflow(message, options, next){
3436
let config = self.deprecationWorkflow.config || {};
3537

3638
let matchingWorkflow = detectWorkflow(config, message, options);
@@ -68,7 +70,7 @@ const LOG_LIMIT = 100;
6870
}
6971
});
7072

71-
Ember.Debug.registerDeprecationHandler(function deprecationCollector(message, options, next){
73+
registerDeprecationHandler(function deprecationCollector(message, options, next){
7274
let key = options && options.id || message;
7375
let matchKey = options && key === options.id ? 'matchId' : 'matchMessage';
7476

0 commit comments

Comments
 (0)