2015-12-16 13:00:13 -08:00
|
|
|
class Slots {
|
2016-01-01 11:49:00 -08:00
|
|
|
foreign static def noSet
|
|
|
|
|
foreign static def getSlots(bool, num, string, bytes, value)
|
|
|
|
|
foreign static def setSlots(a, b, c, d)
|
|
|
|
|
foreign static def ensure()
|
|
|
|
|
foreign static def ensureOutsideForeign()
|
2015-12-16 13:00:13 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If nothing is set in the return slot, it retains its previous value, the
|
|
|
|
|
// receiver.
|
|
|
|
|
System.print(Slots.noSet == Slots) // expect: true
|
|
|
|
|
|
|
|
|
|
var value = ["value"]
|
2015-12-28 07:43:17 -08:00
|
|
|
System.print(Slots.getSlots(true, "by\0te", 12.34, "str", value) == value)
|
|
|
|
|
// expect: true
|
2015-12-16 13:00:13 -08:00
|
|
|
|
2015-12-28 07:43:17 -08:00
|
|
|
System.print(Slots.setSlots(value, 0, 0, 0) == value)
|
|
|
|
|
// expect: true
|
2015-12-16 16:28:26 -08:00
|
|
|
|
2015-12-28 07:43:17 -08:00
|
|
|
System.print(Slots.ensure())
|
|
|
|
|
// expect: 1 -> 20 (190)
|
|
|
|
|
|
|
|
|
|
System.print(Slots.ensureOutsideForeign())
|
|
|
|
|
// expect: 0 -> 20 (190)
|