File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -428,16 +428,8 @@ module.exports = function() {
428428 const descs = ObjectGetOwnPropertyDescriptors ( obj ) ;
429429 enqueue ( proto ) ;
430430 ArrayPrototypeForEach ( ReflectOwnKeys ( descs ) , ( name ) => {
431- // TODO: Uncurried form
432- // TODO: getOwnPropertyDescriptors is guaranteed to return well-formed
433- // descriptors, but they still inherit from Object.prototype. If
434- // someone has poisoned Object.prototype to add 'value' or 'get'
435- // properties, then a simple 'if ("value" in desc)' or 'desc.value'
436- // test could be confused. We use hasOwnProperty to be sure about
437- // whether 'value' is present or not, which tells us for sure that
438- // this is a data property.
439431 const desc = descs [ name ] ;
440- if ( 'value' in desc ) {
432+ if ( ObjectPrototypeHasOwnProperty ( desc , 'value' ) ) {
441433 // todo uncurried form
442434 enqueue ( desc . value ) ;
443435 } else {
@@ -489,7 +481,7 @@ module.exports = function() {
489481 * objects succeed if otherwise possible.
490482 */
491483 function enableDerivedOverride ( obj , prop , desc ) {
492- if ( 'value' in desc && desc . configurable ) {
484+ if ( ObjectPrototypeHasOwnProperty ( desc , 'value' ) && desc . configurable ) {
493485 const value = desc . value ;
494486
495487 function getter ( ) {
You can’t perform that action at this time.
0 commit comments