differentmatt / filbert

JavaScript parser of Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

list.pop(index) doesn't work

Bryukh opened this issue · comments

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

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.

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

it is fixed right now