filbert icon indicating copy to clipboard operation
filbert copied to clipboard

list.pop(index) doesn't work

Open Bryukh opened this issue 9 years ago • 3 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

Bryukh avatar Jun 16 '16 16:06 Bryukh

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.

Xavion3 avatar Jun 16 '16 20:06 Xavion3

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

kyay10 avatar Jan 10 '18 15:01 kyay10

it is fixed right now

kyay10 avatar Jan 20 '18 04:01 kyay10