diff --git a/packages/ember-metal/lib/meta.js b/packages/ember-metal/lib/meta.js index d9ae04f007b..d386c43ec7f 100644 --- a/packages/ember-metal/lib/meta.js +++ b/packages/ember-metal/lib/meta.js @@ -515,10 +515,7 @@ if (HAS_NATIVE_WEAKMAP) { if (DEBUG) { counters.peekCalls++; } - // stop if we find a `null` value, since - // that means the meta was deleted - // any other truthy value is a "real" meta - if (meta === null || meta !== undefined) { + if (meta !== undefined) { return meta; } @@ -530,14 +527,10 @@ if (HAS_NATIVE_WEAKMAP) { }; } else { setMeta = function Fallback_setMeta(obj, meta) { - // if `null` already, just set it to the new value - // otherwise define property first - if (obj[META_FIELD] !== null) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - Object.defineProperty(obj, META_FIELD, META_DESC); - } + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(EMBER_META_PROPERTY); + } else { + Object.defineProperty(obj, META_FIELD, META_DESC); } obj[META_FIELD] = meta; @@ -586,7 +579,7 @@ export function meta(obj) { let parent; // remove this code, in-favor of explicit parent - if (maybeMeta !== undefined && maybeMeta !== null) { + if (maybeMeta !== undefined) { if (maybeMeta.source === obj) { return maybeMeta; } diff --git a/packages/ember-runtime/lib/mixins/array.js b/packages/ember-runtime/lib/mixins/array.js index 55f9690041f..1fe9f3ae821 100644 --- a/packages/ember-runtime/lib/mixins/array.js +++ b/packages/ember-runtime/lib/mixins/array.js @@ -8,7 +8,6 @@ // import { symbol } from 'ember-utils'; -import { peekMeta } from 'ember-metal'; import Ember, { // ES6TODO: Ember.A get, computed, @@ -24,7 +23,9 @@ import Ember, { // ES6TODO: Ember.A _addBeforeObserver, _removeBeforeObserver, addObserver, - removeObserver + removeObserver, + meta, + peekMeta } from 'ember-metal'; import { deprecate, assert } from 'ember-debug'; import Enumerable from './enumerable'; @@ -638,7 +639,7 @@ const ArrayMixin = Mixin.create(Enumerable, { function EachProxy(content) { this._content = content; this._keys = undefined; - this.__ember_meta__ = null; + meta(this); } EachProxy.prototype = {