Skip to content

Commit

Permalink
make proxies trackable objects, remove custom tagForProperty logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed Apr 3, 2019
1 parent 7d94591 commit 1770c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/@ember/-internals/metal/lib/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ export function tagForProperty(object: any, propertyKey: string | symbol, _meta?
if (objectType !== 'function' && (objectType !== 'object' || object === null)) {
return CONSTANT_TAG;
}

let meta = _meta === undefined ? metaFor(object) : _meta;

if (isProxy(object)) {
if (!EMBER_METAL_TRACKED_PROPERTIES && isProxy(object)) {
return tagFor(object, meta);
}

let tags = meta.writableTags();
let tag = tags[propertyKey];

if (tag) {
return tag;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/@ember/-internals/runtime/lib/mixins/-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
tagFor,
computed,
} from '@ember/-internals/metal';
import { setProxy } from '@ember/-internals/utils';
import { setProxy, TRACKABLE_OBJECT } from '@ember/-internals/utils';
import { assert } from '@ember/debug';

function contentPropertyDidChange(content, contentKey) {
Expand Down Expand Up @@ -44,6 +44,8 @@ export function contentFor(proxy, m) {
@private
*/
export default Mixin.create({
[TRACKABLE_OBJECT]: true,

/**
The object whose properties will be forwarded.
Expand Down

0 comments on commit 1770c33

Please sign in to comment.