Rewrite ArrayList, AbstractList, AbstractCollection in kotlin.

AbstractList is imported from GWT.
#KT-12386
This commit is contained in:
Ilya Gorbunov
2016-08-19 22:18:32 +03:00
parent 0abf94c2f4
commit 75069143c7
17 changed files with 535 additions and 418 deletions
@@ -1,3 +1,19 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package templates
import templates.Family.*
@@ -11,9 +27,7 @@ fun specialJS(): List<GenericFunction> {
returns("List<T>")
body(ArraysOfObjects) {
"""
val al = ArrayList<T>()
al.asDynamic().array = this // black dynamic magic
return al
return ArrayList<T>(this as Array<Any?>)
"""
}