mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 00:41:32 +00:00
Implement itoa32/64 for base 10 (#151)
This commit is contained in:
@ -14,6 +14,16 @@ export class String {
|
||||
|
||||
readonly length: i32; // capped to [0, MAX_LENGTH]
|
||||
|
||||
static fromCharCode(code: i32): String {
|
||||
var out = allocate(1);
|
||||
store<u16>(
|
||||
changetype<usize>(out),
|
||||
<u16>code,
|
||||
HEADER_SIZE
|
||||
);
|
||||
return out;
|
||||
}
|
||||
|
||||
@operator("[]")
|
||||
charAt(pos: i32): String {
|
||||
assert(this !== null);
|
||||
|
Reference in New Issue
Block a user