Skip to content

Commit 6022738

Browse files
committed
add check for if the target has the property when setting
1 parent fd4d955 commit 6022738

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/bootstrap/loaders.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@
292292
if (typeof value === 'function')
293293
value = methodUnwrapMap.get(value) || value;
294294
if (ReflectSet(target, prop, value, receiver)) {
295-
update(prop, ReflectGet(target, prop, receiver));
295+
if (ObjectHasOwnProperty.call(target, prop)) {
296+
update(prop, ReflectGet(target, prop, receiver));
297+
} else {
298+
update(prop, undefined);
299+
}
296300
return true;
297301
}
298302
return false;

0 commit comments

Comments
 (0)