Skip to content

Commit

Permalink
fix #392, #393
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed May 5, 2018
1 parent 7f048d7 commit f40efd8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/es6.reflect.set.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ function set(target, propertyKey, V /* , receiver */) {
}
if (has(ownDesc, 'value')) {
if (ownDesc.writable === false || !isObject(receiver)) return false;
existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
} else dP.f(receiver, propertyKey, createDesc(0, V));
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
Expand Down

0 comments on commit f40efd8

Please sign in to comment.