starting to annotate JavaScript APIs in the standard library
This commit is contained in:
@@ -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
|
package kotlin.browser
|
||||||
|
|
||||||
import org.w3c.dom.Document
|
import org.w3c.dom.Document
|
||||||
|
import js.native
|
||||||
|
|
||||||
private var _document: Document? = null
|
private var _document: Document? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides access to the current active browsers DOM for the currently visible page.
|
* Provides access to the current active browsers DOM for the currently visible page.
|
||||||
*/
|
*/
|
||||||
var document: Document
|
native var document: Document
|
||||||
get() = _document!!
|
get() = _document!!
|
||||||
set(value) {
|
set(value) {
|
||||||
_document = value
|
_document = value
|
||||||
|
|||||||
Reference in New Issue
Block a user