Skip to content

Commit

Permalink
add check for if the target has the property when setting
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed May 9, 2018
1 parent fd4d955 commit 6022738
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@
if (typeof value === 'function')
value = methodUnwrapMap.get(value) || value;
if (ReflectSet(target, prop, value, receiver)) {
update(prop, ReflectGet(target, prop, receiver));
if (ObjectHasOwnProperty.call(target, prop)) {
update(prop, ReflectGet(target, prop, receiver));
} else {
update(prop, undefined);
}
return true;
}
return false;
Expand Down

0 comments on commit 6022738

Please sign in to comment.