Skip to content

Commit

Permalink
remove deprecated NAME_KEY (#18124)
Browse files Browse the repository at this point in the history
remove deprecated NAME_KEY
  • Loading branch information
Chris Garrett authored Jun 26, 2019
2 parents ac455c6 + 0b7879a commit 8b90e83
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 38 deletions.
3 changes: 0 additions & 3 deletions packages/@ember/-internals/metal/lib/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
getOwnPropertyDescriptors,
guidFor,
makeArray,
NAME_KEY,
ROOT,
setObservers,
wrap,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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' });
}
}
);
3 changes: 0 additions & 3 deletions packages/@ember/-internals/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ export {
teardownMandatorySetter,
setWithMandatorySetter,
} from './lib/mandatory-setter';

import symbol from './lib/symbol';
export const NAME_KEY = symbol('NAME_KEY');
12 changes: 0 additions & 12 deletions packages/ember/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions packages/ember/tests/reexports_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8b90e83

Please sign in to comment.