Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated NAME_KEY #18124

Merged
merged 1 commit into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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