starting to annotate JavaScript APIs in the standard library

This commit is contained in:
James Strachan
2012-05-24 16:18:59 +01:00
parent 05054bfa49
commit 6b3864a12d
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
package js
/**
* This annotation marks code as being a native JavaScript expression
*/
native
annotation class native(name : String = "") {}
/**
* Represents a function in the standard library
*/
native
annotation class library(name : String = "") {}
@@ -1,13 +1,14 @@
package kotlin.browser
import org.w3c.dom.Document
import js.native
private var _document: Document? = null
/**
* Provides access to the current active browsers DOM for the currently visible page.
*/
var document: Document
native var document: Document
get() = _document!!
set(value) {
_document = value