pass typed data back and forth with #extern. close #17
This commit is contained in:
@@ -7,6 +7,7 @@ import kiss.Prelude;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class ExternTestCase extends Test {
|
||||
#if (sys || hxnodejs)
|
||||
function testExternPython() {
|
||||
_testExternPython();
|
||||
}
|
||||
@@ -14,4 +15,5 @@ class ExternTestCase extends Test {
|
||||
function testExternJavaScript() {
|
||||
_testExternJavaScript();
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
@@ -1,13 +1,10 @@
|
||||
(function _testExternPython []
|
||||
(Assert.isTrue
|
||||
(#extern Bool python []
|
||||
(#if python
|
||||
true
|
||||
false))))
|
||||
(#extern Bool python [:String passingString "Hello python!"]
|
||||
(python.NativeStringTools.startswith passingString "Hello"))))
|
||||
|
||||
(function _testExternJavaScript []
|
||||
(Assert.isTrue
|
||||
(#extern Bool js []
|
||||
(#if js
|
||||
true
|
||||
false))))
|
||||
(Assert.equals 18
|
||||
(let [jsToEval "5+6+7"]
|
||||
(#extern Int js [:String jsToEval _]
|
||||
(js.Lib.eval jsToEval)))))
|
Reference in New Issue
Block a user