Skip to content

Commit

Permalink
Merge pull request #15502 from emberjs/jit-fun
Browse files Browse the repository at this point in the history
[BUGFIX release] [Fixes #15492] WorkAround WebKit/JSC JIT WorkARound
  • Loading branch information
stefanpenner authored Jul 14, 2017
2 parents b4b9600 + 82bfd03 commit 2adb0fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
19 changes: 6 additions & 13 deletions packages/ember-metal/lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,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;
}

Expand All @@ -520,14 +517,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;
Expand Down Expand Up @@ -576,7 +569,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;
}
Expand Down
7 changes: 4 additions & 3 deletions packages/ember-runtime/lib/mixins/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//
import { symbol } from 'ember-utils';

import { peekMeta } from 'ember-metal';
import Ember, { // ES6TODO: Ember.A
get,
computed,
Expand All @@ -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';
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 2adb0fd

Please sign in to comment.