Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
2bb647bd
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2bb647bd
编写于
5月 25, 2012
作者:
P
Pavel V. Talanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some magic to make test work
上级
f03ce079
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
38 deletion
+32
-38
js/js.libraries/src/core/dom.kt
js/js.libraries/src/core/dom.kt
+25
-19
js/js.libraries/src/stdlib/browser.kt
js/js.libraries/src/stdlib/browser.kt
+1
-1
js/js.tests/test/org/jetbrains/k2js/test/semantics/StdLibTest.java
...ts/test/org/jetbrains/k2js/test/semantics/StdLibTest.java
+3
-17
js/js.translator/src/org/jetbrains/k2js/config/Config.java
js/js.translator/src/org/jetbrains/k2js/config/Config.java
+3
-1
未找到文件。
js/js.libraries/src/core/dom.kt
浏览文件 @
2bb647bd
package
org.w3c.dom
import
js.noImpl
/**
* A stub class definition so we can work with the DOM APIs as native objects
*/
native
public
interface
Document
:
Node
{
native
public
trait
Document
:
Node
{
fun
getElementById
(
id
:
String
)
:
Element
=
js
.
noImpl
fun
createTextNode
(
text
:
String
)
:
Node
=
js
.
noImpl
}
native
public
interface
Attr
:
Node
{}
native
public
interface
CDATASection
:
Text
{}
native
public
interface
CharacterData
:
Node
{}
native
public
interface
Comment
:
CharacterData
{}
native
public
interface
DOMImplementation
{}
native
public
interface
DocumentType
:
Node
{}
native
public
interface
Element
:
Node
{}
native
public
interface
Entity
:
Node
{}
native
public
interface
EntityReference
:
Node
{}
native
public
interface
NameList
{}
native
public
interface
NamedNodeMap
{}
native
public
interface
Node
{}
native
public
interface
NodeList
{}
native
public
interface
Notation
:
Node
{}
native
public
interface
ProcessingInstruction
:
Node
{}
native
public
interface
Text
:
CharacterData
{}
native
public
interface
TypeInfo
{}
native
public
interface
UserDataHandler
{}
native
public
trait
Attr
:
Node
{}
native
public
trait
CDATASection
:
Text
{}
native
public
trait
CharacterData
:
Node
{}
native
public
trait
Comment
:
CharacterData
{}
native
public
trait
DOMImplementation
{}
native
public
trait
DocumentType
:
Node
{}
native
public
trait
Element
:
Node
{
fun
appendChild
(
child
:
Node
)
:
Unit
=
js
.
noImpl
}
native
public
trait
Entity
:
Node
{}
native
public
trait
EntityReference
:
Node
{}
native
public
trait
NameList
{}
native
public
trait
NamedNodeMap
{}
native
public
trait
Node
{}
native
public
trait
NodeList
{}
native
public
trait
Notation
:
Node
{}
native
public
trait
ProcessingInstruction
:
Node
{}
native
public
trait
Text
:
CharacterData
{}
native
public
trait
TypeInfo
{}
native
public
trait
UserDataHandler
{}
js/js.libraries/src/stdlib/browser.kt
浏览文件 @
2bb647bd
package
kotlin.browser
import
org.w3c.dom.Document
import
js.native
import
js.library
import
org.w3c.dom.Document
/**
* Provides access to the current active browsers DOM for the currently visible page.
...
...
js/js.tests/test/org/jetbrains/k2js/test/semantics/StdLibTest.java
浏览文件 @
2bb647bd
...
...
@@ -21,7 +21,6 @@ import org.jetbrains.k2js.config.EcmaVersion;
import
org.jetbrains.k2js.facade.MainCallParameters
;
import
org.jetbrains.k2js.test.SingleFileTranslationTest
;
import
java.io.File
;
import
java.util.Arrays
;
import
java.util.EnumSet
;
import
java.util.List
;
...
...
@@ -38,29 +37,16 @@ public final class StdLibTest extends SingleFileTranslationTest {
public
void
testDummy
()
{
}
public
void
TODO_testBrowserDocumentAcces
s
()
throws
Exception
{
runFunctionOutputTest
(
"browserDocumentAccess.kt"
,
"test.browser"
,
"foo"
,
"Hello World!"
);
public
void
testBrowserDocumentAccessCompile
s
()
throws
Exception
{
generateJavaScriptFiles
(
"browserDocumentAccess.kt"
,
MainCallParameters
.
noCall
(),
EcmaVersion
.
all
()
);
}
@Override
protected
void
generateJavaScriptFiles
(
@NotNull
String
kotlinFilename
,
@NotNull
MainCallParameters
mainCallParameters
,
@NotNull
EnumSet
<
EcmaVersion
>
ecmaVersions
)
throws
Exception
{
String
stdlibdir
=
pathToTestFiles
()
+
"../../../../libraries/stdlib/src/"
;
String
jscoredir
=
pathToTestFiles
()
+
"../../../js.libraries/src/core/"
;
String
dom
=
jscoredir
+
"dom.kt"
;
String
jsbrowser
=
jscoredir
+
"../stdlib/browser.kt"
;
String
stdlibBrowser
=
stdlibdir
+
"kotlin/browser/Properties.kt"
;
List
<
String
>
files
=
Arrays
.
asList
(
getInputFilePath
(
kotlinFilename
),
dom
,
jsbrowser
);
List
<
String
>
files
=
Arrays
.
asList
(
getInputFilePath
(
kotlinFilename
));
generateJavaScriptFiles
(
files
,
kotlinFilename
,
mainCallParameters
,
ecmaVersions
);
}
@Override
protected
boolean
shouldCreateOut
()
{
return
false
;
}
}
js/js.translator/src/org/jetbrains/k2js/config/Config.java
浏览文件 @
2bb647bd
...
...
@@ -65,7 +65,9 @@ public abstract class Config {
"/html5/canvas.kt"
,
"/html5/files.kt"
,
"/html5/image.kt"
,
"/stdlib/JUMaps.kt"
"/stdlib/JUMaps.kt"
,
"/stdlib/browser.kt"
,
"/core/dom.kt"
);
protected
static
final
String
LIBRARIES_LOCATION
=
"js/js.libraries/src"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录