Implement itoa32/64 for base 10 (#151)

This commit is contained in:
Max Graey
2018-07-13 16:40:37 +03:00
committed by Daniel Wirtz
parent 5ce57a6434
commit d7c1c608bd
13 changed files with 4369 additions and 829 deletions

View File

@ -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);