You are reading a single comment by @WebReflection and its replies. Click here to read the full conversation.
  • In Espruino Pico 1v76 I've noticed that Object.getOwnPropertyDescriptor is present, and returns a descriptor object, but everything else available in ES5 to actually define properties through descriptors is missing:

    Object.defineProperty;
    Object.defineProperties;
    Object.create(null, {test: {get: function () {return 123}}}).test;
    Object.create(null, {test: {value: 456}}).test;
    

    All these are undefined and I wonder why, at this point, Object.getOwnPropertyDescriptor is available. It kinda misleads features detection.

    As summary: is there any plan to bring the ability to define properties through descriptors, or, if not, could we just drop getOwnPropertyDescriptor so no code would be confused about its presence?

    Thanks!

About