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

[BUGFIX release] [Fixes #15492] WorkAround WebKit/JSC JIT WorkARound #15502

Merged
merged 1 commit into from
Jul 14, 2017
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
19 changes: 6 additions & 13 deletions packages/ember-metal/lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
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