espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

Object.defineProperty can be called on functions and arrays (and the root) #2504

Closed bobrippling closed 2 weeks ago

bobrippling commented 1 month ago

This permits Object.defineProperty(Bangle, ...), for example

Closes #2501

bobrippling commented 1 month ago

Would appreciate an opinion on the jsvIsRoot() part - I guess that's for the global object but am not certain.

gfwilliams commented 1 month ago

I'm pretty sure jsvIsRoot(parent) isn't needed? I thought root was treated as an object so jsvObject should return true?

gfwilliams commented 3 weeks ago

@bobrippling ? any thoughts on this?

bobrippling commented 2 weeks ago

Ah yes you're right - thank you

gfwilliams commented 2 weeks ago

Thanks!