Object.defineProperty is bugous by properties inherited with Object.create

By design Issue #4641519

Details

Created
Sep 18, 2015
Privacy
This issue is public.
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

  • use Object.create to inherit a property
  • try to set the enumerable on it with Object.defineProperty
  • it won’t work

Expected Results:

That it does not override the inherited properties with undefined if no value option given.
That it does set the enumerable flag properly by inherited properties if an enumerable option given.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To to “Christian F.”

      Changed Assigned To to “ChakraTriage”

      Changed Assigned To from “ChakraTriage” to “Brahma G.”

      Changed Assigned To from “Brahma G.” to “IE S.”

      Changed Status to “By design”

      Changed Assigned To to “Brian T.”

      Changed Status from “By design”

      Changed Assigned To from “Brian T.” to “IE S.”

      Changed Status to “By design”

    • Hello,

      Thank you for providing this information about the issue. Our behavior is by design and per the ES2015 specification. When using Object.defineProperty, descriptor values not specified are filled in with their default value. In other words, Object.defineProperty({}, 'prop’, {}) is the same as Object.defineProperty({}, 'prop’, { value: undefined, enumerable: false, configurable: false, writable: false }). This behavior is identical across all recently released browsers that I’ve tested.

      Additionally, enumerability does not impact whether a property shadows a like-named property further up the prototype chain. It is expected that when you shadow a property from a prototype that enumerability is determined entirely by the child property’s descriptor rather than the parent’s.  V8’s behavior here is not per spec and is tracked by #705 here: https://code.google.com/p/v8/issues/detail?id=705

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in