Skip to content

Commit

Permalink
avoid boolean coercion in property_set
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Oct 2, 2017
1 parent 04b6f42 commit cbb0ecb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ember-metal/lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export class Meta {
}

peekWatching(subkey) {
return this._findInherited('_watching', subkey);
return this._findInherited('_watching', subkey);
}

writeMixins(subkey, value) {
Expand Down
4 changes: 1 addition & 3 deletions packages/ember-metal/lib/property_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
propertyWillChange,
propertyDidChange
} from './property_events';

import {
isPath
} from './path_cache';
Expand Down Expand Up @@ -98,10 +97,9 @@ function setPath(root, path, value, tolerant) {
assert('Property set failed: You passed an empty path', keyName.trim().length > 0)

let newPath = parts.join('.');

let newRoot = getPath(root, newPath);

if (newRoot) {
if (newRoot !== null && newRoot !== undefined) {
return set(newRoot, keyName, value);
} else if (!tolerant) {
throw new EmberError(`Property set failed: object in path "${newPath}" could not be found or was destroyed.`);
Expand Down

0 comments on commit cbb0ecb

Please sign in to comment.