JS declarations: added eval, typeof, undefined.

#KT-4136 Fixed
This commit is contained in:
Zalim Bashorov
2014-12-24 16:02:13 +03:00
parent 0988d6cace
commit 9ab045e598
14 changed files with 81 additions and 60 deletions
+17 -5
View File
@@ -5,22 +5,34 @@ import java.util.*;
native
public val <T> noImpl: T = throw Exception()
native
public fun eval(expr: String): dynamic = noImpl
native
public fun typeof(a: Any?): String = noImpl
native
public val undefined: Nothing? = noImpl
// Drop this after KT-2093 will be fixed and restore MutableMap.set in Maps.kt from MapsJVM.kt
/** Provides [] access to maps */
[suppress("BASE_WITH_NULLABLE_UPPER_BOUND")]
native public fun <K, V> MutableMap<K, V>.set(key: K, value: V): V? = noImpl
library("println")
library
public fun println() {}
library("println")
library
public fun println(s : Any?) {}
library("print")
library
public fun print(s : Any?) {}
//TODO: consistent parseInt
native public fun parseInt(s: String, radix: Int = 10): Int = noImpl
native
public fun parseInt(s: String, radix: Int = 10): Int = noImpl
library
public fun safeParseInt(s : String) : Int? = noImpl
library
public fun safeParseDouble(s : String) : Double? = noImpl
native public fun js(code: String): dynamic = noImpl
native
public fun js(code: String): dynamic = noImpl