forked from Mirror/wren
I've got some ideas on how to tweak the embedding API, but I want to see what performance impact they have first, so this adds a little benchmark that just calls a foreign method a ton of times.
24 lines
623 B
Plaintext
24 lines
623 B
Plaintext
class Returns {
|
|
foreign static implicitNull
|
|
|
|
foreign static returnInt
|
|
foreign static returnFloat
|
|
|
|
foreign static returnTrue
|
|
foreign static returnFalse
|
|
|
|
foreign static returnString
|
|
foreign static returnBytes
|
|
}
|
|
|
|
System.print(Returns.implicitNull == null) // expect: true
|
|
|
|
System.print(Returns.returnInt) // expect: 123456
|
|
System.print(Returns.returnFloat) // expect: 123.456
|
|
|
|
System.print(Returns.returnTrue) // expect: true
|
|
System.print(Returns.returnFalse) // expect: false
|
|
|
|
System.print(Returns.returnString) // expect: a string
|
|
System.print(Returns.returnBytes.bytes.toList) // expect: [97, 0, 98, 0, 99]
|