ccxvii / mujs

An embeddable Javascript interpreter in C.
http://mujs.com/
ISC License
812 stars 98 forks source link

Object.keys and Object.getOwnPropertyNames on Array returns indices twice #189

Closed siggi-gross closed 8 months ago

siggi-gross commented 8 months ago

Expected:

Object.keys([1,2,3])
["0","1","2"]
Object.getOwnPropertyNames([1,2,3])
["length","0","1","2"]

Result:

["0", "1", "2", "0", "1", "2"]
["0", "1", "2", "length", "0", "1", "2"]

and also with js_Iteratoror for (i in arr)

ccxvii commented 8 months ago

I cannot reproduce this behavior. Which version?

siggi-gross commented 8 months ago

sorry for bothering you, finally found it...

I broke it myself (in jsR_setindex)