| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -428,16 +428,8 @@ module.exports = function() { | |||
| 428 | 428 | const descs = ObjectGetOwnPropertyDescriptors(obj); | |
| 429 | 429 | enqueue(proto); | |
| 430 | 430 | 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. | ||
| 439 | 431 | const desc = descs[name]; | |
| 440 | - if ('value' in desc) { | ||
| 432 | + if (ObjectPrototypeHasOwnProperty(desc, 'value')) { | ||
| 441 | 433 | // todo uncurried form | |
| 442 | 434 | enqueue(desc.value); | |
| 443 | 435 | } else { | |
@@ -489,7 +481,7 @@ module.exports = function() { | |||
| 489 | 481 | * objects succeed if otherwise possible. | |
| 490 | 482 | */ | |
| 491 | 483 | function enableDerivedOverride(obj, prop, desc) { | |
| 492 | - if ('value' in desc && desc.configurable) { | ||
| 484 | + if (ObjectPrototypeHasOwnProperty(desc, 'value') && desc.configurable) { | ||
| 493 | 485 | const value = desc.value; | |
| 494 | 486 | ||
| 495 | 487 | function getter() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments