File tree 3 files changed +8
-31
lines changed
3 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ export namespace JSON {
336
336
}
337
337
}
338
338
339
- function __serialize < T > ( src : T , staticSize : bool = false ) : void {
339
+ export function __serialize < T > ( src : T , staticSize : bool = false ) : void {
340
340
if ( isBoolean < T > ( ) ) {
341
341
serializeBool ( src as bool , staticSize ) ;
342
342
} else if ( isInteger < T > ( ) ) {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables";
35
35
store < u32 > ( bs . offset , escaped , 8 ) ;
36
36
bs . offset += 12 ;
37
37
} else {
38
- if ( ! staticSize ) bs . ensureSize ( 4 ) ;
38
+ if ( ! staticSize ) bs . ensureSize ( 2 ) ;
39
39
store < u32 > ( bs . offset , escaped , 0 ) ;
40
40
bs . offset += 4 ;
41
41
}
Original file line number Diff line number Diff line change 1
- import { JSON } from "." ;
2
- import { bytes } from "./util/bytes" ;
3
- import { deserializeObject_NEW } from "./deserialize/simple/object" ;
4
-
5
-
6
1
@json
7
2
class Vec3 {
8
- x : i8 = 1 ;
9
- y : i8 = 2 ;
10
- z : i8 = 3 ;
11
- xyx : i8 = 0 ;
12
- }
13
-
14
- const vec : Vec3 = {
15
- x : 1 ,
16
- y : 2 ,
17
- z : 3 ,
18
- } ;
19
- // const serialized = JSON.stringify<Vec3>(vec);
20
- // const ss = '{ "x":1,"y":2,"z":3}'
21
- // const s = changetype<usize>(ss);
22
- // console.log("Serialized: " + serialized);
23
- // const deserialized = deserializeObject_NEW<Vec3>(s, s + bytes(ss))
24
- // console.log("Deserialized: " + JSON.stringify(deserialized));
25
-
26
- // function str(start: usize, end: usize): string {
27
- // const size = end - start;
28
- // const out = __new(size, idof<string>());
29
- // memory.copy(out, start, size);
30
- // return changetype<string>(out);
31
- // }
3
+ a : i16 = 1
4
+ ab : i16 = 2 ;
5
+ abc : i16 = 3 ;
6
+ abcd : i16 = 4 ;
7
+ abcde : i16 = 5 ;
8
+ }
You can’t perform that action at this time.
0 commit comments