differentmatt / filbert

JavaScript parser of Python
Other
133 stars 27 forks source link

list.pop(index) doesn't work #80

Open Bryukh opened 8 years ago

Bryukh commented 8 years ago

list.pop([index]) with index doesn't work correctly. It always pop the last element and ignores index argument.

array = [1, 2, 3]
array.pop(0)
hero.debug(array[0]) # got 1
Xavion3 commented 8 years ago

This just looks like a case of stupid code, looks like it's checking for undefined with !arg which makes it treat 0 as no argument. Can't test now but just changing this line to if (i === undefined) will likely fix things.

kyay10 commented 6 years ago

i fixed it and made a pull request, i am just waiting for someone to merge it

kyay10 commented 6 years ago

it is fixed right now