Skip to content

Commit

Permalink
remove deprecated NAME_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Jun 20, 2019
1 parent 55f876e commit a0d0b8e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 36 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' });
}
}
);
1 change: 0 additions & 1 deletion packages/@ember/-internals/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ export {
} 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 a0d0b8e

Please sign in to comment.