From a0d0b8e2b2c0e9743ff6104756939be3b074d355 Mon Sep 17 00:00:00 2001 From: bekzod Date: Thu, 20 Jun 2019 20:28:28 +0500 Subject: [PATCH] remove deprecated NAME_KEY --- packages/@ember/-internals/metal/lib/mixin.ts | 3 --- .../metal/tests/mixin/introspection_test.js | 15 +-------------- packages/@ember/-internals/utils/index.ts | 1 - packages/ember/index.js | 12 ------------ packages/ember/tests/reexports_test.js | 6 ------ 5 files changed, 1 insertion(+), 36 deletions(-) diff --git a/packages/@ember/-internals/metal/lib/mixin.ts b/packages/@ember/-internals/metal/lib/mixin.ts index b6dce62fc6e..e9c788c4f73 100644 --- a/packages/@ember/-internals/metal/lib/mixin.ts +++ b/packages/@ember/-internals/metal/lib/mixin.ts @@ -9,7 +9,6 @@ import { getOwnPropertyDescriptors, guidFor, makeArray, - NAME_KEY, ROOT, setObservers, wrap, @@ -596,7 +595,6 @@ export default class Mixin { this._without = undefined; if (DEBUG) { - this[NAME_KEY] = undefined; /* In debug builds, we seal mixins to help avoid performance pitfalls. @@ -744,7 +742,6 @@ type MixinLike = Mixin | { [key: string]: any }; Mixin.prototype.toString = classToString; if (DEBUG) { - Mixin.prototype[NAME_KEY] = undefined; Object.seal(Mixin.prototype); } diff --git a/packages/@ember/-internals/metal/tests/mixin/introspection_test.js b/packages/@ember/-internals/metal/tests/mixin/introspection_test.js index b3149159a18..83ce11febe1 100644 --- a/packages/@ember/-internals/metal/tests/mixin/introspection_test.js +++ b/packages/@ember/-internals/metal/tests/mixin/introspection_test.js @@ -2,7 +2,7 @@ // as well as methods vs props. We are just keeping these for testing; the // current impl doesn't care about the differences as much... -import { guidFor, NAME_KEY } from '@ember/-internals/utils'; +import { guidFor } from '@ember/-internals/utils'; import { mixin, Mixin } from '../..'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; @@ -58,18 +58,5 @@ moduleFor( 'should return included mixins' ); } - - ['@test setting a NAME_KEY on a mixin does not error'](assert) { - assert.expect(0); - - let instance = Mixin.create(); - instance[NAME_KEY] = 'My special name!'; - } - - ['@test setting a NAME_KEY on a mixin instance does not error'](assert) { - assert.expect(0); - - Mixin.create({ [NAME_KEY]: 'My special name' }); - } } ); diff --git a/packages/@ember/-internals/utils/index.ts b/packages/@ember/-internals/utils/index.ts index fa851c579cf..662b9629aee 100644 --- a/packages/@ember/-internals/utils/index.ts +++ b/packages/@ember/-internals/utils/index.ts @@ -40,4 +40,3 @@ export { } from './lib/mandatory-setter'; import symbol from './lib/symbol'; -export const NAME_KEY = symbol('NAME_KEY'); diff --git a/packages/ember/index.js b/packages/ember/index.js index ed1c878e7f8..d5e4c913632 100644 --- a/packages/ember/index.js +++ b/packages/ember/index.js @@ -195,18 +195,6 @@ Ember.tryInvoke = utils.tryInvoke; Ember.wrap = utils.wrap; Ember.uuid = utils.uuid; -Object.defineProperty(Ember, 'NAME_KEY', { - enumerable: false, - get() { - deprecate('Using `Ember.NAME_KEY` is deprecated, override `.toString` instead', false, { - id: 'ember-name-key-usage', - until: '3.9.0', - }); - - return utils.NAME_KEY; - }, -}); - // ****@ember/-internals/container**** Ember.Container = Container; Ember.Registry = Registry; diff --git a/packages/ember/tests/reexports_test.js b/packages/ember/tests/reexports_test.js index cc34700f0b3..16f8b41daff 100644 --- a/packages/ember/tests/reexports_test.js +++ b/packages/ember/tests/reexports_test.js @@ -38,12 +38,6 @@ moduleFor( }, /EXTEND_PROTOTYPES is deprecated/); } - ['@test Ember.NAME_KEY is deprecated']() { - expectDeprecation(() => { - Ember.NAME_KEY; - }, 'Using `Ember.NAME_KEY` is deprecated, override `.toString` instead'); - } - '@test Ember.FEATURES is exported'(assert) { for (let feature in FEATURES) { assert.equal(