Skip to content

Commit

Permalink
Merge pull request #20429 from emberjs/consistent-return
Browse files Browse the repository at this point in the history
[BUGFIX stable] TS lint-level error in `mixins/-proxy.ts`
  • Loading branch information
chriskrycho authored Apr 3, 2023
2 parents 7c6fec2 + 6b386ae commit 16b1b97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/@ember/-internals/runtime/lib/mixins/-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ const ProxyMixin = Mixin.create({

unknownProperty(key: string) {
let content = contentFor(this);
if (content) {
return get(content, key);
}
return content ? get(content, key) : undefined;
},

setUnknownProperty(key: string, value: unknown) {
Expand Down
1 change: 1 addition & 0 deletions packages/@ember/debug/lib/deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ if (DEBUG) {
captureErrorForStack = () => {
try {
__fail__.fail();
return;
} catch (e) {
return e;
}
Expand Down
9 changes: 3 additions & 6 deletions packages/@ember/object/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ interface Observable {
Remove an observer you have previously registered on this object. Pass
the same key, target, and method you passed to `addObserver()` and your
target will no longer receive notifications.
@method removeObserver
@param {String} key The key to observe
@param {Object} target The target object to invoke
Expand Down Expand Up @@ -400,7 +400,7 @@ interface Observable {
This allows you to inspect the value of a computed property
without accidentally invoking it if it is intended to be
generated lazily.
@method cacheFor
@param {String} keyName
@return {Object} The cached value of the computed property, if any
Expand Down Expand Up @@ -526,10 +526,7 @@ const Observable = Mixin.create({

cacheFor(keyName: string) {
let meta = peekMeta(this);

if (meta !== null) {
return meta.valueFor(keyName);
}
return meta !== null ? meta.valueFor(keyName) : undefined;
},
});

Expand Down

0 comments on commit 16b1b97

Please sign in to comment.