Skip to content

Commit

Permalink
improve tracked detection
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Nov 10, 2023
1 parent ba75238 commit 9908462
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ember_debug/object-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ try {
}
}

let TrackedDescriptor;
try {
let metal = EmberLoader.require('@ember/-internals/metal');
TrackedDescriptor = metal.TrackedDescriptor

Check failure on line 82 in ember_debug/object-inspector.js

View workflow job for this annotation

GitHub Actions / Test

Insert `;`

tagForProperty = metal.tagForProperty;
// If track was not already loaded, use metal's version (the previous version)
Expand Down Expand Up @@ -968,6 +970,10 @@ function addProperties(properties, hash) {
if (desc.get) {
options.isGetter = true;
options.canTrack = true;
options.isTracked = desc instanceof TrackedDescriptor;
if (options.isTracked) {
options.code = '';
}
if (!desc.set) {
options.readOnly = true;
}
Expand Down Expand Up @@ -1115,12 +1121,6 @@ function calculateCPs(
tagInfo.tag = track(() => {
value = calculateCP(object, item, errorsForObject);
});
if (tagInfo.tag === tagForProperty(object, item.name)) {
if (!item.isComputed && !item.isService) {
item.code = '';
item.isTracked = true;
}
}
tagInfo.revision = tagValue(tagInfo.tag);
item.dependentKeys = getTrackedDependencies(
object,
Expand Down

0 comments on commit 9908462

Please sign in to comment.