Skip to content
Closed
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
12 changes: 6 additions & 6 deletions packages/@ember/-internals/metal/lib/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type ComputedPropertyCallback = ComputedPropertyGetterFunction | Computed

const DEEP_EACH_REGEX = /\.@each\.[^.]+\./;

function noop(): void {}
function noop(): void { }
/**
`@computed` is a decorator that turns a JavaScript getter and setter into a
computed property, which is a _cached, trackable value_. By default the getter
Expand Down Expand Up @@ -345,7 +345,7 @@ export class ComputedProperty extends ComputedDescriptor {
assert(
`Attempted to use @computed on ${keyName}, but it did not have a getter or a setter. You must either pass a get a function or getter/setter to @computed directly (e.g. \`@computed({ get() { ... } })\`) or apply @computed directly to a getter/setter`,
propertyDesc &&
(typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function')
(typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function')
);

let { get, set } = propertyDesc;
Expand Down Expand Up @@ -374,9 +374,9 @@ export class ComputedProperty extends ComputedDescriptor {
function addArg(property: string): void {
assert(
`Dependent keys containing @each only work one level deep. ` +
`You used the key "${property}" which is invalid. ` +
`Please create an intermediary computed property or ` +
`switch to using tracked properties.`,
`You used the key "${property}" which is invalid. ` +
`Please create an intermediary computed property or ` +
`switch to using tracked properties.`,
DEEP_EACH_REGEX.test(property) === false
);

Expand Down Expand Up @@ -531,7 +531,7 @@ export class ComputedProperty extends ComputedDescriptor {
}

// allows setter to return the same value that is cached already
if (hadCachedValue && cachedValue === ret) {
if (hadCachedValue && Object.is(cachedValue, ret)) {
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@ember/-internals/metal/lib/property_set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function _setProp(obj: object, keyName: string, value: any) {
(obj as any)[keyName] = value;
}

if (currentValue !== value) {
if (!Object.is(currentValue, value)) {
notifyPropertyChange(obj, keyName);
}
}
Expand Down