Files
hakorune/examples/jit_string_charcode_at.nyash

14 lines
259 B
Plaintext
Raw Normal View History

// Param-string JIT HostCall PoC (charCodeAt)
box Utils {
codeAt(s, i) {
return s.charCodeAt(i)
}
}
u = new Utils()
print(u.codeAt("ABC", 0))
print(u.codeAt("ABC", 1))
print(u.codeAt("ABC", 2))
print(u.codeAt("ABC", 3)) // -1 (out of range)