Fix an issue with asc not finding bundled library files in the browser; Minor cleanup

This commit is contained in:
dcodeIO
2018-03-21 23:27:53 +01:00
parent d4c46b036e
commit 00e6d613a9
12 changed files with 138 additions and 100 deletions

View File

@ -152,15 +152,15 @@ function i64_to_f64(value: I64): f64 {
import { CharCode } from "../../util";
@global
function i64_to_string(value: I64): string {
function i64_to_string(value: I64, unsigned: bool = false): string {
var chars = new Array<u16>();
if (value < 0) {
if (!unsigned && value < 0) {
chars.push(CharCode.MINUS);
value = -value;
}
do {
chars.push(CharCode._0 + (value % 10));
value /= 10;
chars.push(CharCode._0 + (<u64>value % 10));
value = <u64>value / 10;
} while (value);
return String.fromCharCodes(chars);
}