diff --git a/packages/ember-metal/lib/meta.js b/packages/ember-metal/lib/meta.js index d9ae04f007b..48fec6604d4 100644 --- a/packages/ember-metal/lib/meta.js +++ b/packages/ember-metal/lib/meta.js @@ -509,16 +509,13 @@ if (HAS_NATIVE_WEAKMAP) { peekMeta = function WeakMap_peekParentMeta(obj) { let pointer = obj; let meta; - while (pointer !== undefined && pointer !== null) { + while (pointer !== undefined && null !== pointer) { meta = metaStore.get(pointer); // jshint loopfunc:true 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..13609685455 100644 --- a/packages/ember-runtime/lib/mixins/array.js +++ b/packages/ember-runtime/lib/mixins/array.js @@ -638,7 +638,7 @@ const ArrayMixin = Mixin.create(Enumerable, { function EachProxy(content) { this._content = content; this._keys = undefined; - this.__ember_meta__ = null; + this.__ember_meta__ = undefined; } EachProxy.prototype = {