ArrayList.add bug in Javascript backend?


#1

I have a simple program:

ArrayList<Int>().add(0, 0)

The generated JS:

  (new Kotlin.ArrayList).add(0, 0);

However in kotlinLib.js I can only find the 1-param overload of add():
  Kotlin.AbstractList = Kotlin.$createClass({            add:function (element) {            throw Kotlin.$new(Kotlin.Exceptions.UnsupportedOperationException)();            },
...
  Kotlin.ArrayList = Kotlin.$createClass({   add:function (element) {            this.array[this.$size++] = element;   },

Is this a bug?


#2

Yes it looks like the JS code doesn't support the add(index, element) method. Could you raise an issue please? A patch would be even more awesome :)


#3

Done: http://youtrack.jetbrains.com/issue/KT-2434