whet 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/HxOverrides.js +6 -6
- package/bin/Lambda.js +10 -10
- package/bin/Reflect.js +2 -2
- package/bin/Std.js +1 -1
- package/bin/genes/Register.d.ts +11 -1
- package/bin/genes/Register.js +69 -40
- package/bin/genes/util/EsMap.js +5 -5
- package/bin/haxe/Exception.js +1 -1
- package/bin/haxe/crypto/Crc32.js +5 -5
- package/bin/haxe/ds/List.js +1 -1
- package/bin/haxe/io/Bytes.js +8 -8
- package/bin/haxe/io/BytesBuffer.js +6 -6
- package/bin/haxe/io/Output.js +7 -7
- package/bin/haxe/zip/Compress.js +2 -2
- package/bin/haxe/zip/Tools.js +1 -1
- package/bin/haxe/zip/Writer.js +18 -18
- package/bin/js/Boot.js +25 -25
- package/bin/js/node/buffer/Buffer.js +1 -1
- package/bin/whet/Log.js +7 -7
- package/bin/whet/Project.js +6 -6
- package/bin/whet/Source.js +7 -7
- package/bin/whet/SourceHash.js +49 -55
- package/bin/whet/SourceId.js +12 -12
- package/bin/whet/Stone.js +40 -40
- package/bin/whet/Utils.js +12 -12
- package/bin/whet/Whet.js +23 -23
- package/bin/whet/cache/BaseCache.js +21 -21
- package/bin/whet/cache/CacheManager.js +13 -13
- package/bin/whet/cache/FileCache.js +97 -101
- package/bin/whet/cache/MemoryCache.js +12 -12
- package/bin/whet/magic/RoutePathType.js +15 -15
- package/bin/whet/magic/StoneId.js +2 -2
- package/bin/whet/route/RouteResult.js +1 -1
- package/bin/whet/route/Router.js +128 -132
- package/bin/whet/stones/Files.js +47 -53
- package/bin/whet/stones/JsonStone.js +16 -16
- package/bin/whet/stones/RemoteFile.js +4 -4
- package/bin/whet/stones/Server.js +17 -17
- package/bin/whet/stones/Zip.js +16 -18
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +1 -0
- package/bin/whet/stones/haxe/HaxeBuild.js +25 -23
- package/bin/whet/stones/haxe/Hxml.js +71 -70
- package/package.json +1 -1
- package/bin/haxe/Log.d.ts +0 -33
- package/bin/haxe/Log.js +0 -61
- package/bin/js/lib/ArrayBuffer.d.ts +0 -4
- package/bin/js/lib/ArrayBuffer.js +0 -24
package/bin/HxOverrides.js
CHANGED
|
@@ -5,11 +5,11 @@ const $global = Register.$global
|
|
|
5
5
|
export const HxOverrides = Register.global("$hxClasses")["HxOverrides"] =
|
|
6
6
|
class HxOverrides {
|
|
7
7
|
static dateStr(date) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
let m = date.getMonth() + 1;
|
|
9
|
+
let d = date.getDate();
|
|
10
|
+
let h = date.getHours();
|
|
11
|
+
let mi = date.getMinutes();
|
|
12
|
+
let s = date.getSeconds();
|
|
13
13
|
return date.getFullYear() + "-" + ((m < 10) ? "0" + m : "" + m) + "-" + ((d < 10) ? "0" + d : "" + d) + " " + ((h < 10) ? "0" + h : "" + h) + ":" + ((mi < 10) ? "0" + mi : "" + mi) + ":" + ((s < 10) ? "0" + s : "" + s);
|
|
14
14
|
}
|
|
15
15
|
static substr(s, pos, len) {
|
|
@@ -25,7 +25,7 @@ class HxOverrides {
|
|
|
25
25
|
return s.substr(pos, len);
|
|
26
26
|
}
|
|
27
27
|
static remove(a, obj) {
|
|
28
|
-
|
|
28
|
+
let i = a.indexOf(obj);
|
|
29
29
|
if (i == -1) {
|
|
30
30
|
return false;
|
|
31
31
|
};
|
package/bin/Lambda.js
CHANGED
|
@@ -26,8 +26,8 @@ class Lambda {
|
|
|
26
26
|
If `it` is a List, this function returns a copy of it.
|
|
27
27
|
*/
|
|
28
28
|
static list(it) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
let l = new List();
|
|
30
|
+
let i = Register.getIterator(it);
|
|
31
31
|
while (i.hasNext()) l.add(i.next());
|
|
32
32
|
return l;
|
|
33
33
|
}
|
|
@@ -43,7 +43,7 @@ class Lambda {
|
|
|
43
43
|
If `f` is null, the result is unspecified.
|
|
44
44
|
*/
|
|
45
45
|
static exists(it, f) {
|
|
46
|
-
|
|
46
|
+
let x = Register.getIterator(it);
|
|
47
47
|
while (x.hasNext()) if (f(x.next())) {
|
|
48
48
|
return true;
|
|
49
49
|
};
|
|
@@ -63,7 +63,7 @@ class Lambda {
|
|
|
63
63
|
If `f` is null, the result is unspecified.
|
|
64
64
|
*/
|
|
65
65
|
static foreach(it, f) {
|
|
66
|
-
|
|
66
|
+
let x = Register.getIterator(it);
|
|
67
67
|
while (x.hasNext()) if (!f(x.next())) {
|
|
68
68
|
return false;
|
|
69
69
|
};
|
|
@@ -83,7 +83,7 @@ class Lambda {
|
|
|
83
83
|
If `it` or `f` are null, the result is unspecified.
|
|
84
84
|
*/
|
|
85
85
|
static fold(it, f, first) {
|
|
86
|
-
|
|
86
|
+
let x = Register.getIterator(it);
|
|
87
87
|
while (x.hasNext()) first = f(x.next(), first);
|
|
88
88
|
return first;
|
|
89
89
|
}
|
|
@@ -95,15 +95,15 @@ class Lambda {
|
|
|
95
95
|
This function traverses all elements.
|
|
96
96
|
*/
|
|
97
97
|
static count(it, pred) {
|
|
98
|
-
|
|
98
|
+
let n = 0;
|
|
99
99
|
if (pred == null) {
|
|
100
|
-
|
|
100
|
+
let _ = Register.getIterator(it);
|
|
101
101
|
while (_.hasNext()) {
|
|
102
102
|
_.next();
|
|
103
103
|
++n;
|
|
104
104
|
};
|
|
105
105
|
} else {
|
|
106
|
-
|
|
106
|
+
let x = Register.getIterator(it);
|
|
107
107
|
while (x.hasNext()) if (pred(x.next())) {
|
|
108
108
|
++n;
|
|
109
109
|
};
|
|
@@ -122,9 +122,9 @@ class Lambda {
|
|
|
122
122
|
If `f` is null, the result is unspecified.
|
|
123
123
|
*/
|
|
124
124
|
static find(it, f) {
|
|
125
|
-
|
|
125
|
+
let v = Register.getIterator(it);
|
|
126
126
|
while (v.hasNext()) {
|
|
127
|
-
|
|
127
|
+
let v1 = v.next();
|
|
128
128
|
if (f(v1)) {
|
|
129
129
|
return v1;
|
|
130
130
|
};
|
package/bin/Reflect.js
CHANGED
|
@@ -20,9 +20,9 @@ class Reflect {
|
|
|
20
20
|
If `o` is null, the result is unspecified.
|
|
21
21
|
*/
|
|
22
22
|
static fields(o) {
|
|
23
|
-
|
|
23
|
+
let a = [];
|
|
24
24
|
if (o != null) {
|
|
25
|
-
|
|
25
|
+
let hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
26
26
|
for( var f in o ) {;
|
|
27
27
|
if (f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o, f)) {
|
|
28
28
|
a.push(f);
|
package/bin/Std.js
CHANGED
package/bin/genes/Register.d.ts
CHANGED
|
@@ -7,9 +7,19 @@ export declare class Register {
|
|
|
7
7
|
static global(name: number): any
|
|
8
8
|
static createStatic<T>(obj: {
|
|
9
9
|
}, name: string, get: (() => T)): void
|
|
10
|
-
static
|
|
10
|
+
static iterator<T>(a: T[]): (() => Iterator<T>)
|
|
11
|
+
static getIterator<T>(a: T[]): Iterator<T>
|
|
12
|
+
protected static mkIter<T>(a: T[]): Iterator<T>
|
|
11
13
|
static extend(superClass: any): void
|
|
12
14
|
static inherits(resolve: any, defer?: boolean): void
|
|
13
15
|
protected static fid: number
|
|
14
16
|
static bind(o: any, m: any): null | any
|
|
15
17
|
}
|
|
18
|
+
|
|
19
|
+
export declare class ArrayIterator<T> {
|
|
20
|
+
constructor(array: T[])
|
|
21
|
+
protected array: T[]
|
|
22
|
+
protected current: number
|
|
23
|
+
hasNext(): boolean
|
|
24
|
+
next(): T
|
|
25
|
+
}
|
package/bin/genes/Register.js
CHANGED
|
@@ -8,7 +8,7 @@ export class Register {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
static createStatic(obj, name, get) {
|
|
11
|
-
|
|
11
|
+
let value = null;
|
|
12
12
|
Object.defineProperty(obj, name, {"enumerable": true, "get": function () {
|
|
13
13
|
if (get != null) {
|
|
14
14
|
value = get();
|
|
@@ -23,55 +23,64 @@ export class Register {
|
|
|
23
23
|
value = v;
|
|
24
24
|
}});
|
|
25
25
|
}
|
|
26
|
-
static
|
|
26
|
+
static iterator(a) {
|
|
27
|
+
if (!Array.isArray(a)) {
|
|
28
|
+
return typeof a.iterator === "function" ? a.iterator.bind(a) : a.iterator;
|
|
29
|
+
} else {
|
|
30
|
+
let a1 = a;
|
|
31
|
+
return function () {
|
|
32
|
+
return Register.mkIter(a1);
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static getIterator(a) {
|
|
27
37
|
if (!Array.isArray(a)) {
|
|
28
38
|
return a.iterator();
|
|
29
39
|
} else {
|
|
30
|
-
return
|
|
31
|
-
return this.cur < this.arr.length;
|
|
32
|
-
}, "next": function () {
|
|
33
|
-
return this.arr[this.cur++];
|
|
34
|
-
}};
|
|
40
|
+
return Register.mkIter(a);
|
|
35
41
|
};
|
|
36
42
|
}
|
|
43
|
+
static mkIter(a) {
|
|
44
|
+
return new ArrayIterator(a);
|
|
45
|
+
}
|
|
37
46
|
static extend(superClass) {
|
|
38
|
-
|
|
39
|
-
function res() {
|
|
40
|
-
this.new.apply(this, arguments)
|
|
41
|
-
}
|
|
42
|
-
Object.setPrototypeOf(res.prototype, superClass.prototype)
|
|
43
|
-
return res
|
|
47
|
+
|
|
48
|
+
function res() {
|
|
49
|
+
this.new.apply(this, arguments)
|
|
50
|
+
}
|
|
51
|
+
Object.setPrototypeOf(res.prototype, superClass.prototype)
|
|
52
|
+
return res
|
|
44
53
|
;
|
|
45
54
|
}
|
|
46
55
|
static inherits(resolve, defer) {
|
|
47
56
|
if (defer == null) {
|
|
48
57
|
defer = false;
|
|
49
58
|
};
|
|
50
|
-
|
|
51
|
-
function res() {
|
|
52
|
-
if (defer && resolve && res.__init__) res.__init__()
|
|
53
|
-
this.new.apply(this, arguments)
|
|
54
|
-
}
|
|
55
|
-
if (!defer) {
|
|
56
|
-
if (resolve && resolve.__init__) {
|
|
57
|
-
defer = true
|
|
58
|
-
res.__init__ = () => {
|
|
59
|
-
resolve.__init__()
|
|
60
|
-
Object.setPrototypeOf(res.prototype, resolve.prototype)
|
|
61
|
-
res.__init__ = undefined
|
|
62
|
-
}
|
|
63
|
-
} else if (resolve) {
|
|
64
|
-
Object.setPrototypeOf(res.prototype, resolve.prototype)
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
res.__init__ = () => {
|
|
68
|
-
const superClass = resolve()
|
|
69
|
-
if (superClass.__init__) superClass.__init__()
|
|
70
|
-
Object.setPrototypeOf(res.prototype, superClass.prototype)
|
|
71
|
-
res.__init__ = undefined
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return res
|
|
59
|
+
|
|
60
|
+
function res() {
|
|
61
|
+
if (defer && resolve && res.__init__) res.__init__()
|
|
62
|
+
this.new.apply(this, arguments)
|
|
63
|
+
}
|
|
64
|
+
if (!defer) {
|
|
65
|
+
if (resolve && resolve.__init__) {
|
|
66
|
+
defer = true
|
|
67
|
+
res.__init__ = () => {
|
|
68
|
+
resolve.__init__()
|
|
69
|
+
Object.setPrototypeOf(res.prototype, resolve.prototype)
|
|
70
|
+
res.__init__ = undefined
|
|
71
|
+
}
|
|
72
|
+
} else if (resolve) {
|
|
73
|
+
Object.setPrototypeOf(res.prototype, resolve.prototype)
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
res.__init__ = () => {
|
|
77
|
+
const superClass = resolve()
|
|
78
|
+
if (superClass.__init__) superClass.__init__()
|
|
79
|
+
Object.setPrototypeOf(res.prototype, superClass.prototype)
|
|
80
|
+
res.__init__ = undefined
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return res
|
|
75
84
|
;
|
|
76
85
|
}
|
|
77
86
|
static bind(o, m) {
|
|
@@ -81,7 +90,7 @@ export class Register {
|
|
|
81
90
|
if (m.__id__ == null) {
|
|
82
91
|
m.__id__ = Register.fid++;
|
|
83
92
|
};
|
|
84
|
-
|
|
93
|
+
let f = null;
|
|
85
94
|
if (o.hx__closures__ == null) {
|
|
86
95
|
o.hx__closures__ = {};
|
|
87
96
|
} else {
|
|
@@ -104,4 +113,24 @@ export class Register {
|
|
|
104
113
|
|
|
105
114
|
Register.$global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : undefined
|
|
106
115
|
Register.globals = {}
|
|
107
|
-
Register.fid = 0
|
|
116
|
+
Register.fid = 0
|
|
117
|
+
export const ArrayIterator = Register.global("$hxClasses")["genes._Register.ArrayIterator"] =
|
|
118
|
+
class ArrayIterator extends Register.inherits() {
|
|
119
|
+
new(array) {
|
|
120
|
+
this.current = 0;
|
|
121
|
+
this.array = array;
|
|
122
|
+
}
|
|
123
|
+
hasNext() {
|
|
124
|
+
return this.current < this.array.length;
|
|
125
|
+
}
|
|
126
|
+
next() {
|
|
127
|
+
return this.array[this.current++];
|
|
128
|
+
}
|
|
129
|
+
static get __name__() {
|
|
130
|
+
return "genes._Register.ArrayIterator"
|
|
131
|
+
}
|
|
132
|
+
get __class__() {
|
|
133
|
+
return ArrayIterator
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
package/bin/genes/util/EsMap.js
CHANGED
|
@@ -20,10 +20,10 @@ class EsMap extends Register.inherits() {
|
|
|
20
20
|
return EsMap.adaptIterator(this.inst.keys());
|
|
21
21
|
}
|
|
22
22
|
static adaptIterator(from) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
let value;
|
|
24
|
+
let done;
|
|
25
|
+
let queue = function () {
|
|
26
|
+
let data = from.next();
|
|
27
27
|
value = data.value;
|
|
28
28
|
done = data.done;
|
|
29
29
|
};
|
|
@@ -36,7 +36,7 @@ class EsMap extends Register.inherits() {
|
|
|
36
36
|
if (done == null) {
|
|
37
37
|
queue();
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
let pending = value;
|
|
40
40
|
queue();
|
|
41
41
|
return pending;
|
|
42
42
|
}};
|
package/bin/haxe/Exception.js
CHANGED
package/bin/haxe/crypto/Crc32.js
CHANGED
|
@@ -12,12 +12,12 @@ class Crc32 {
|
|
|
12
12
|
Calculates the CRC32 of the given data bytes
|
|
13
13
|
*/
|
|
14
14
|
static make(data) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
let c_crc = -1;
|
|
16
|
+
let len = data.length;
|
|
17
|
+
let b = data.b.bufferValue;
|
|
18
|
+
let _g = 0;
|
|
19
19
|
while (_g < len) {
|
|
20
|
-
|
|
20
|
+
let tmp = (c_crc ^ b.bytes[_g++]) & 255;
|
|
21
21
|
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
22
22
|
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
23
23
|
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
package/bin/haxe/ds/List.js
CHANGED
package/bin/haxe/io/Bytes.js
CHANGED
|
@@ -32,21 +32,21 @@ class Bytes extends Register.inherits() {
|
|
|
32
32
|
*/
|
|
33
33
|
static ofString(s, encoding) {
|
|
34
34
|
if (encoding == Encoding.RawNative) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
let buf = new Uint8Array(s.length << 1);
|
|
36
|
+
let _g = 0;
|
|
37
|
+
let _g1 = s.length;
|
|
38
38
|
while (_g < _g1) {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
let i = _g++;
|
|
40
|
+
let c = s.charCodeAt(i);
|
|
41
41
|
buf[i << 1] = c & 255;
|
|
42
42
|
buf[i << 1 | 1] = c >> 8;
|
|
43
43
|
};
|
|
44
44
|
return new Bytes(buf.buffer);
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
let a = new Array();
|
|
47
|
+
let i = 0;
|
|
48
48
|
while (i < s.length) {
|
|
49
|
-
|
|
49
|
+
let c = s.charCodeAt(i++);
|
|
50
50
|
if (55296 <= c && c <= 56319) {
|
|
51
51
|
c = c - 55232 << 10 | s.charCodeAt(i++) & 1023;
|
|
52
52
|
};
|
|
@@ -27,16 +27,16 @@ class BytesBuffer extends Register.inherits() {
|
|
|
27
27
|
if (this.size == 0) {
|
|
28
28
|
return;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
let sub = new Uint8Array(src.b.buffer, src.b.byteOffset + pos, len);
|
|
31
31
|
this.u8.set(sub, this.pos);
|
|
32
32
|
this.pos += len;
|
|
33
33
|
}
|
|
34
34
|
grow(delta) {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
let req = this.pos + delta;
|
|
36
|
+
let nsize = (this.size == 0) ? 16 : this.size;
|
|
37
37
|
while (nsize < req) nsize = nsize * 3 >> 1;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
let nbuf = new ArrayBuffer(nsize);
|
|
39
|
+
let nu8 = new Uint8Array(nbuf);
|
|
40
40
|
if (this.size > 0) {
|
|
41
41
|
nu8.set(this.u8);
|
|
42
42
|
};
|
|
@@ -54,7 +54,7 @@ class BytesBuffer extends Register.inherits() {
|
|
|
54
54
|
if (this.size == 0) {
|
|
55
55
|
return new Bytes(new ArrayBuffer(0));
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
let b = new Bytes(this.buffer);
|
|
58
58
|
b.length = this.pos;
|
|
59
59
|
return b;
|
|
60
60
|
}
|
package/bin/haxe/io/Output.js
CHANGED
|
@@ -33,8 +33,8 @@ class Output {
|
|
|
33
33
|
if (pos < 0 || len < 0 || pos + len > s.length) {
|
|
34
34
|
throw Exception.thrown(Error__1.OutsideBounds);
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
let b = s.b;
|
|
37
|
+
let k = len;
|
|
38
38
|
while (k > 0) {
|
|
39
39
|
this.writeByte(b[pos]);
|
|
40
40
|
++pos;
|
|
@@ -47,10 +47,10 @@ class Output {
|
|
|
47
47
|
Write all bytes stored in `s`.
|
|
48
48
|
*/
|
|
49
49
|
write(s) {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
let l = s.length;
|
|
51
|
+
let p = 0;
|
|
52
52
|
while (l > 0) {
|
|
53
|
-
|
|
53
|
+
let k = this.writeBytes(s, p, l);
|
|
54
54
|
if (k == 0) {
|
|
55
55
|
throw Exception.thrown(Error__1.Blocked);
|
|
56
56
|
};
|
|
@@ -66,7 +66,7 @@ class Output {
|
|
|
66
66
|
*/
|
|
67
67
|
writeFullBytes(s, pos, len) {
|
|
68
68
|
while (len > 0) {
|
|
69
|
-
|
|
69
|
+
let k = this.writeBytes(s, pos, len);
|
|
70
70
|
pos += k;
|
|
71
71
|
len -= k;
|
|
72
72
|
};
|
|
@@ -113,7 +113,7 @@ class Output {
|
|
|
113
113
|
Write `s` string.
|
|
114
114
|
*/
|
|
115
115
|
writeString(s, encoding) {
|
|
116
|
-
|
|
116
|
+
let b = Bytes.ofString(s, encoding);
|
|
117
117
|
this.writeFullBytes(b, 0, b.length);
|
|
118
118
|
}
|
|
119
119
|
static get __name__() {
|
package/bin/haxe/zip/Compress.js
CHANGED
|
@@ -8,8 +8,8 @@ const $global = Register.$global
|
|
|
8
8
|
export const Compress = Register.global("$hxClasses")["haxe.zip.Compress"] =
|
|
9
9
|
class Compress {
|
|
10
10
|
static run(s, level) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
let data = s.b;
|
|
12
|
+
let buffer = Zlib.deflateSync(Buffer.from(data.buffer, data.byteOffset, s.length), {"level": level});
|
|
13
13
|
return Helper.bytesOfBuffer(buffer);
|
|
14
14
|
}
|
|
15
15
|
static get __name__() {
|
package/bin/haxe/zip/Tools.js
CHANGED
package/bin/haxe/zip/Writer.js
CHANGED
|
@@ -18,12 +18,12 @@ class Writer extends Register.inherits() {
|
|
|
18
18
|
this.o.writeUInt16(date.getFullYear() - 1980 << 9 | date.getMonth() + 1 << 5 | date.getDate());
|
|
19
19
|
}
|
|
20
20
|
writeEntryHeader(f) {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let o = this.o;
|
|
22
|
+
let flags = 0;
|
|
23
23
|
if (f.extraFields != null) {
|
|
24
|
-
|
|
24
|
+
let _g_head = f.extraFields.h;
|
|
25
25
|
while (_g_head != null) {
|
|
26
|
-
|
|
26
|
+
let val = _g_head.item;
|
|
27
27
|
_g_head = _g_head.next;
|
|
28
28
|
if (val._hx_index == 2) {
|
|
29
29
|
flags |= 2048;
|
|
@@ -57,21 +57,21 @@ class Writer extends Register.inherits() {
|
|
|
57
57
|
o.writeInt32(f.dataSize);
|
|
58
58
|
o.writeInt32(f.fileSize);
|
|
59
59
|
o.writeUInt16(f.fileName.length);
|
|
60
|
-
|
|
60
|
+
let e = new BytesOutput();
|
|
61
61
|
if (f.extraFields != null) {
|
|
62
|
-
|
|
62
|
+
let _g_head = f.extraFields.h;
|
|
63
63
|
while (_g_head != null) {
|
|
64
|
-
|
|
64
|
+
let val = _g_head.item;
|
|
65
65
|
_g_head = _g_head.next;
|
|
66
66
|
switch (val._hx_index) {
|
|
67
67
|
case 0:
|
|
68
|
-
|
|
68
|
+
let _g = val.bytes;
|
|
69
69
|
e.writeUInt16(val.tag);
|
|
70
70
|
e.writeUInt16(_g.length);
|
|
71
71
|
e.write(_g);
|
|
72
72
|
break
|
|
73
73
|
case 1:
|
|
74
|
-
|
|
74
|
+
let namebytes = Bytes.ofString(val.name);
|
|
75
75
|
e.writeUInt16(28789);
|
|
76
76
|
e.writeUInt16(namebytes.length + 5);
|
|
77
77
|
e.writeByte(1);
|
|
@@ -84,16 +84,16 @@ class Writer extends Register.inherits() {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
let ebytes = e.getBytes();
|
|
88
88
|
o.writeUInt16(ebytes.length);
|
|
89
89
|
o.writeString(f.fileName);
|
|
90
90
|
o.write(ebytes);
|
|
91
91
|
this.files.add({"name": f.fileName, "compressed": f.compressed, "clen": f.data.length, "size": f.fileSize, "crc": f.crc32, "date": f.fileTime, "fields": ebytes});
|
|
92
92
|
}
|
|
93
93
|
write(files) {
|
|
94
|
-
|
|
94
|
+
let _g_head = files.h;
|
|
95
95
|
while (_g_head != null) {
|
|
96
|
-
|
|
96
|
+
let val = _g_head.item;
|
|
97
97
|
_g_head = _g_head.next;
|
|
98
98
|
this.writeEntryHeader(val);
|
|
99
99
|
this.o.writeFullBytes(val.data, 0, val.data.length);
|
|
@@ -101,14 +101,14 @@ class Writer extends Register.inherits() {
|
|
|
101
101
|
this.writeCDR();
|
|
102
102
|
}
|
|
103
103
|
writeCDR() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
let cdr_size = 0;
|
|
105
|
+
let cdr_offset = 0;
|
|
106
|
+
let _g_head = this.files.h;
|
|
107
107
|
while (_g_head != null) {
|
|
108
|
-
|
|
108
|
+
let val = _g_head.item;
|
|
109
109
|
_g_head = _g_head.next;
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
let namelen = val.name.length;
|
|
111
|
+
let extraFieldsLength = val.fields.length;
|
|
112
112
|
this.o.writeInt32(33639248);
|
|
113
113
|
this.o.writeUInt16(20);
|
|
114
114
|
this.o.writeUInt16(20);
|
package/bin/js/Boot.js
CHANGED
|
@@ -10,11 +10,11 @@ class Boot {
|
|
|
10
10
|
} else if (((o) instanceof Array)) {
|
|
11
11
|
return Array;
|
|
12
12
|
} else {
|
|
13
|
-
|
|
13
|
+
let cl = o.__class__;
|
|
14
14
|
if (cl != null) {
|
|
15
15
|
return cl;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
let name = Boot.__nativeClassName(o);
|
|
18
18
|
if (name != null) {
|
|
19
19
|
return Boot.__resolveNativeClass(name);
|
|
20
20
|
};
|
|
@@ -28,7 +28,7 @@ class Boot {
|
|
|
28
28
|
if (s.length >= 5) {
|
|
29
29
|
return "<...>";
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
let t = typeof(o);
|
|
32
32
|
if (t == "function" && (o.__name__ || o.__ename__)) {
|
|
33
33
|
t = "object";
|
|
34
34
|
};
|
|
@@ -38,21 +38,21 @@ class Boot {
|
|
|
38
38
|
break
|
|
39
39
|
case "object":
|
|
40
40
|
if (o.__enum__) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let e = Register.global("$hxEnums")[o.__enum__];
|
|
42
|
+
let con = e.__constructs__[o._hx_index];
|
|
43
|
+
let n = con._hx_name;
|
|
44
44
|
if (con.__params__) {
|
|
45
45
|
s = s + "\t";
|
|
46
46
|
return n + "(" + ((function($this) {var $r0
|
|
47
|
-
|
|
47
|
+
let _g = [];
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
let _g1 = 0;
|
|
50
|
+
let _g2 = con.__params__;
|
|
51
51
|
while (true) {
|
|
52
52
|
if (!(_g1 < _g2.length)) {
|
|
53
53
|
break;
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
let p = _g2[_g1];
|
|
56
56
|
_g1 = _g1 + 1;
|
|
57
57
|
_g.push(Boot.__string_rec(o[p], s));
|
|
58
58
|
};
|
|
@@ -65,33 +65,33 @@ class Boot {
|
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
if (((o) instanceof Array)) {
|
|
68
|
-
|
|
68
|
+
let str = "[";
|
|
69
69
|
s += "\t";
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
let _g = 0;
|
|
71
|
+
let _g1 = o.length;
|
|
72
72
|
while (_g < _g1) {
|
|
73
|
-
|
|
73
|
+
let i = _g++;
|
|
74
74
|
str += ((i > 0) ? "," : "") + Boot.__string_rec(o[i], s);
|
|
75
75
|
};
|
|
76
76
|
str += "]";
|
|
77
77
|
return str;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
let tostr;
|
|
80
80
|
try {
|
|
81
81
|
tostr = o.toString;
|
|
82
82
|
}catch (_g) {
|
|
83
83
|
return "???";
|
|
84
84
|
};
|
|
85
85
|
if (tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
|
|
86
|
-
|
|
86
|
+
let s2 = o.toString();
|
|
87
87
|
if (s2 != "[object Object]") {
|
|
88
88
|
return s2;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
let str = "{\n";
|
|
92
92
|
s += "\t";
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
let hasp = o.hasOwnProperty != null;
|
|
94
|
+
let k = null;
|
|
95
95
|
for( k in o ) {;
|
|
96
96
|
if (hasp && !o.hasOwnProperty(k)) {
|
|
97
97
|
continue;
|
|
@@ -124,12 +124,12 @@ class Boot {
|
|
|
124
124
|
if (cc == cl) {
|
|
125
125
|
return true;
|
|
126
126
|
};
|
|
127
|
-
|
|
128
|
-
if (intf != null) {
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
let intf = cc.__interfaces__;
|
|
128
|
+
if (intf != null && (cc.__super__ == null || cc.__super__.__interfaces__ != intf)) {
|
|
129
|
+
let _g = 0;
|
|
130
|
+
let _g1 = intf.length;
|
|
131
131
|
while (_g < _g1) {
|
|
132
|
-
|
|
132
|
+
let i = intf[_g++];
|
|
133
133
|
if (i == cl || Boot.__interfLoop(i, cl)) {
|
|
134
134
|
return true;
|
|
135
135
|
};
|
|
@@ -201,7 +201,7 @@ class Boot {
|
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
static __nativeClassName(o) {
|
|
204
|
-
|
|
204
|
+
let name = Boot.__toStr.call(o).slice(8, -1);
|
|
205
205
|
if (name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
|
|
206
206
|
return null;
|
|
207
207
|
};
|