Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(patchProperty): return null as the default value (#413)
Browse files Browse the repository at this point in the history
Closes #319
  • Loading branch information
jahtalab authored and mhevery committed Aug 22, 2016
1 parent 3b4c20b commit 396942b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ export function patchProperty(obj, prop) {
}
};

// The getter would return undefined for unassigned properties but the default value of an unassigned property is null
desc.get = function () {
return this[_prop];
return this[_prop] || null;
};

Object.defineProperty(obj, prop, desc);
Expand Down

0 comments on commit 396942b

Please sign in to comment.