whet 0.0.1
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/LICENSE +21 -0
- package/README.md +47 -0
- package/bin/HxOverrides.d.ts +8 -0
- package/bin/HxOverrides.js +54 -0
- package/bin/Lambda.d.ts +86 -0
- package/bin/Lambda.js +141 -0
- package/bin/Map.d.ts +5 -0
- package/bin/Reflect.d.ts +19 -0
- package/bin/Reflect.js +41 -0
- package/bin/Std.d.ts +49 -0
- package/bin/Std.js +96 -0
- package/bin/StdTypes.d.ts +57 -0
- package/bin/StringTools.d.ts +23 -0
- package/bin/StringTools.js +36 -0
- package/bin/commander/AddHelpTextContext.d.ts +6 -0
- package/bin/commander/AddHelpTextPosition.d.ts +2 -0
- package/bin/commander/CommandOptions.d.ts +6 -0
- package/bin/commander/ErrorOptions.d.ts +11 -0
- package/bin/commander/ExecutableCommandOptions.d.ts +7 -0
- package/bin/commander/HelpContext.d.ts +4 -0
- package/bin/commander/HookEvent.d.ts +2 -0
- package/bin/commander/OptionValueSource.d.ts +2 -0
- package/bin/commander/OutputConfiguration.d.ts +8 -0
- package/bin/commander/ParseOptions.d.ts +4 -0
- package/bin/commander/ParseOptionsResult.d.ts +5 -0
- package/bin/genes/Register.d.ts +15 -0
- package/bin/genes/Register.js +107 -0
- package/bin/genes/util/EsMap.d.ts +12 -0
- package/bin/genes/util/EsMap.js +51 -0
- package/bin/haxe/Constraints.d.ts +8 -0
- package/bin/haxe/Constraints.js +5 -0
- package/bin/haxe/Exception.d.ts +66 -0
- package/bin/haxe/Exception.js +88 -0
- package/bin/haxe/NativeStackTrace.d.ts +7 -0
- package/bin/haxe/PosInfos.d.ts +19 -0
- package/bin/haxe/Rest.d.ts +2 -0
- package/bin/haxe/ValueException.d.ts +24 -0
- package/bin/haxe/ValueException.js +36 -0
- package/bin/haxe/crypto/Crc32.d.ts +12 -0
- package/bin/haxe/crypto/Crc32.js +40 -0
- package/bin/haxe/ds/List.d.ts +31 -0
- package/bin/haxe/ds/List.js +55 -0
- package/bin/haxe/ds/ObjectMap.d.ts +7 -0
- package/bin/haxe/ds/ObjectMap.js +25 -0
- package/bin/haxe/ds/StringMap.d.ts +6 -0
- package/bin/haxe/ds/StringMap.js +25 -0
- package/bin/haxe/exceptions/NotImplementedException.d.ts +10 -0
- package/bin/haxe/exceptions/NotImplementedException.js +27 -0
- package/bin/haxe/exceptions/PosException.d.ts +19 -0
- package/bin/haxe/exceptions/PosException.js +36 -0
- package/bin/haxe/extern/Rest.d.ts +11 -0
- package/bin/haxe/io/ArrayBufferView.d.ts +2 -0
- package/bin/haxe/io/Bytes.d.ts +19 -0
- package/bin/haxe/io/Bytes.js +78 -0
- package/bin/haxe/io/BytesBuffer.d.ts +19 -0
- package/bin/haxe/io/BytesBuffer.js +67 -0
- package/bin/haxe/io/BytesData.d.ts +2 -0
- package/bin/haxe/io/BytesOutput.d.ts +18 -0
- package/bin/haxe/io/BytesOutput.js +39 -0
- package/bin/haxe/io/Encoding.d.ts +20 -0
- package/bin/haxe/io/Encoding.js +20 -0
- package/bin/haxe/io/Error.d.ts +35 -0
- package/bin/haxe/io/Error.js +31 -0
- package/bin/haxe/io/Output.d.ts +63 -0
- package/bin/haxe/io/Output.js +126 -0
- package/bin/haxe/io/Path.d.ts +109 -0
- package/bin/haxe/io/Path.js +217 -0
- package/bin/haxe/io/UInt8Array.d.ts +2 -0
- package/bin/haxe/iterators/ArrayIterator.d.ts +19 -0
- package/bin/haxe/iterators/ArrayIterator.js +35 -0
- package/bin/haxe/macro/Expr.d.ts +331 -0
- package/bin/haxe/macro/Type.d.ts +609 -0
- package/bin/haxe/zip/Compress.d.ts +5 -0
- package/bin/haxe/zip/Compress.js +21 -0
- package/bin/haxe/zip/Entry.d.ts +27 -0
- package/bin/haxe/zip/Entry.js +15 -0
- package/bin/haxe/zip/Tools.d.ts +5 -0
- package/bin/haxe/zip/Tools.js +24 -0
- package/bin/haxe/zip/Writer.d.ts +22 -0
- package/bin/haxe/zip/Writer.js +149 -0
- package/bin/js/Boot.d.ts +18 -0
- package/bin/js/Boot.js +225 -0
- package/bin/js/Node.d.ts +6 -0
- package/bin/js/lib/ArrayBuffer.d.ts +4 -0
- package/bin/js/lib/ArrayBuffer.js +24 -0
- package/bin/js/lib/Iterator.d.ts +23 -0
- package/bin/js/lib/Map.d.ts +2 -0
- package/bin/js/lib/Object.d.ts +82 -0
- package/bin/js/lib/Promise.d.ts +10 -0
- package/bin/js/lib/intl/NumberFormat.d.ts +114 -0
- package/bin/js/node/Buffer.d.ts +3 -0
- package/bin/js/node/ChildProcess.d.ts +424 -0
- package/bin/js/node/Crypto.d.ts +21 -0
- package/bin/js/node/Dns.d.ts +57 -0
- package/bin/js/node/Fs.d.ts +308 -0
- package/bin/js/node/Http.d.ts +114 -0
- package/bin/js/node/Https.d.ts +330 -0
- package/bin/js/node/Iterator.d.ts +5 -0
- package/bin/js/node/Path.d.ts +44 -0
- package/bin/js/node/Process.d.ts +6 -0
- package/bin/js/node/Tls.d.ts +304 -0
- package/bin/js/node/Url.d.ts +126 -0
- package/bin/js/node/Util.d.ts +115 -0
- package/bin/js/node/Zlib.d.ts +29 -0
- package/bin/js/node/buffer/Buffer.d.ts +23 -0
- package/bin/js/node/buffer/Buffer.js +24 -0
- package/bin/js/node/child_process/ChildProcess.d.ts +11 -0
- package/bin/js/node/console/Console.d.ts +26 -0
- package/bin/js/node/http/Agent.d.ts +40 -0
- package/bin/js/node/http/ClientRequest.d.ts +10 -0
- package/bin/js/node/https/Agent.d.ts +50 -0
- package/bin/js/node/net/Server.d.ts +22 -0
- package/bin/js/node/net/Socket.d.ts +101 -0
- package/bin/js/node/stream/Duplex.d.ts +86 -0
- package/bin/js/node/stream/Readable.d.ts +41 -0
- package/bin/js/node/stream/Transform.d.ts +92 -0
- package/bin/js/node/stream/Writable.d.ts +57 -0
- package/bin/js/node/tls/SecureContext.d.ts +74 -0
- package/bin/js/node/tls/TLSSocket.d.ts +47 -0
- package/bin/ts/Undefined.d.ts +5 -0
- package/bin/whet/Log.d.ts +16 -0
- package/bin/whet/Log.js +106 -0
- package/bin/whet/Project.d.ts +33 -0
- package/bin/whet/Project.js +71 -0
- package/bin/whet/Source.d.ts +51 -0
- package/bin/whet/Source.js +136 -0
- package/bin/whet/SourceHash.d.ts +15 -0
- package/bin/whet/SourceHash.js +68 -0
- package/bin/whet/SourceId.d.ts +10 -0
- package/bin/whet/SourceId.js +74 -0
- package/bin/whet/Stone.d.ts +88 -0
- package/bin/whet/Stone.js +157 -0
- package/bin/whet/Utils.d.ts +16 -0
- package/bin/whet/Utils.js +72 -0
- package/bin/whet/Whet.d.ts +4 -0
- package/bin/whet/Whet.js +117 -0
- package/bin/whet/cache/BaseCache.d.ts +27 -0
- package/bin/whet/cache/BaseCache.js +210 -0
- package/bin/whet/cache/Cache.d.ts +72 -0
- package/bin/whet/cache/Cache.js +57 -0
- package/bin/whet/cache/CacheManager.d.ts +23 -0
- package/bin/whet/cache/CacheManager.js +103 -0
- package/bin/whet/cache/FileCache.d.ts +35 -0
- package/bin/whet/cache/FileCache.js +295 -0
- package/bin/whet/cache/MemoryCache.d.ts +12 -0
- package/bin/whet/cache/MemoryCache.js +58 -0
- package/bin/whet/magic/MaybeArray.d.ts +4 -0
- package/bin/whet/magic/MaybeArray.js +25 -0
- package/bin/whet/magic/RoutePathType.d.ts +9 -0
- package/bin/whet/magic/RoutePathType.js +48 -0
- package/bin/whet/magic/RouteType.d.ts +12 -0
- package/bin/whet/magic/RouteType.js +70 -0
- package/bin/whet/magic/StoneId.d.ts +5 -0
- package/bin/whet/magic/StoneId.js +32 -0
- package/bin/whet/route/Route.d.ts +15 -0
- package/bin/whet/route/Route.js +81 -0
- package/bin/whet/route/RouteResult.d.ts +22 -0
- package/bin/whet/route/RouteResult.js +25 -0
- package/bin/whet/route/Router.d.ts +33 -0
- package/bin/whet/route/Router.js +224 -0
- package/bin/whet/stones/Files.d.ts +28 -0
- package/bin/whet/stones/Files.js +86 -0
- package/bin/whet/stones/JsonStone.d.ts +33 -0
- package/bin/whet/stones/JsonStone.js +117 -0
- package/bin/whet/stones/RemoteFile.d.ts +28 -0
- package/bin/whet/stones/RemoteFile.js +71 -0
- package/bin/whet/stones/Server.d.ts +42 -0
- package/bin/whet/stones/Server.js +113 -0
- package/bin/whet/stones/Zip.d.ts +30 -0
- package/bin/whet/stones/Zip.js +111 -0
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +34 -0
- package/bin/whet/stones/haxe/HaxeBuild.js +89 -0
- package/bin/whet/stones/haxe/Hxml.d.ts +102 -0
- package/bin/whet/stones/haxe/Hxml.js +348 -0
- package/bin/whet.d.ts +20 -0
- package/bin/whet.js +18 -0
- package/package.json +32 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
export type OutputConfiguration = {
|
|
3
|
+
getErrHelpWidth?: null | (() => number),
|
|
4
|
+
getOutHelpWidth?: null | (() => number),
|
|
5
|
+
outputError?: null | ((str: string, write: ((str: string) => void)) => void),
|
|
6
|
+
writeErr?: null | ((str: string) => void),
|
|
7
|
+
writeOut?: null | ((str: string) => void)
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {Iterator} from "../StdTypes"
|
|
2
|
+
|
|
3
|
+
export declare class Register {
|
|
4
|
+
static $global: any
|
|
5
|
+
protected static globals: {
|
|
6
|
+
}
|
|
7
|
+
static global(name: number): any
|
|
8
|
+
static createStatic<T>(obj: {
|
|
9
|
+
}, name: string, get: (() => T)): void
|
|
10
|
+
static iter<T>(a: T[]): Iterator<T>
|
|
11
|
+
static extend(superClass: any): void
|
|
12
|
+
static inherits(resolve: any, defer?: boolean): void
|
|
13
|
+
protected static fid: number
|
|
14
|
+
static bind(o: any, m: any): any
|
|
15
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
|
|
2
|
+
export class Register {
|
|
3
|
+
static global(name) {
|
|
4
|
+
if (Register.globals[name]) {
|
|
5
|
+
return Register.globals[name];
|
|
6
|
+
} else {
|
|
7
|
+
return Register.globals[name] = {};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
static createStatic(obj, name, get) {
|
|
11
|
+
var value = null;
|
|
12
|
+
Object.defineProperty(obj, name, {"enumerable": true, "get": function () {
|
|
13
|
+
if (get != null) {
|
|
14
|
+
value = get();
|
|
15
|
+
get = null;
|
|
16
|
+
};
|
|
17
|
+
return value;
|
|
18
|
+
}, "set": function (v) {
|
|
19
|
+
if (get != null) {
|
|
20
|
+
value = get();
|
|
21
|
+
get = null;
|
|
22
|
+
};
|
|
23
|
+
value = v;
|
|
24
|
+
}});
|
|
25
|
+
}
|
|
26
|
+
static iter(a) {
|
|
27
|
+
if (!Array.isArray(a)) {
|
|
28
|
+
return a.iterator();
|
|
29
|
+
} else {
|
|
30
|
+
return {"cur": 0, "arr": a, "hasNext": function () {
|
|
31
|
+
return this.cur < this.arr.length;
|
|
32
|
+
}, "next": function () {
|
|
33
|
+
return this.arr[this.cur++];
|
|
34
|
+
}};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static extend(superClass) {
|
|
38
|
+
|
|
39
|
+
function res() {
|
|
40
|
+
this.new.apply(this, arguments)
|
|
41
|
+
}
|
|
42
|
+
Object.setPrototypeOf(res.prototype, superClass.prototype)
|
|
43
|
+
return res
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
static inherits(resolve, defer) {
|
|
47
|
+
if (defer == null) {
|
|
48
|
+
defer = false;
|
|
49
|
+
};
|
|
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
|
|
75
|
+
;
|
|
76
|
+
}
|
|
77
|
+
static bind(o, m) {
|
|
78
|
+
if (m == null) {
|
|
79
|
+
return null;
|
|
80
|
+
};
|
|
81
|
+
if (m.__id__ == null) {
|
|
82
|
+
m.__id__ = Register.fid++;
|
|
83
|
+
};
|
|
84
|
+
var f = null;
|
|
85
|
+
if (o.hx__closures__ == null) {
|
|
86
|
+
o.hx__closures__ = {};
|
|
87
|
+
} else {
|
|
88
|
+
f = o.hx__closures__[m.__id__];
|
|
89
|
+
};
|
|
90
|
+
if (f == null) {
|
|
91
|
+
f = m.bind(o);
|
|
92
|
+
o.hx__closures__[m.__id__] = f;
|
|
93
|
+
};
|
|
94
|
+
return f;
|
|
95
|
+
}
|
|
96
|
+
static get __name__() {
|
|
97
|
+
return "genes.Register"
|
|
98
|
+
}
|
|
99
|
+
get __class__() {
|
|
100
|
+
return Register
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
Register.$global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : undefined
|
|
106
|
+
Register.globals = {}
|
|
107
|
+
Register.fid = 0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {Iterator as Iterator__1} from "../../js/lib/Iterator"
|
|
2
|
+
import {Iterator, Iterator as Iterator__2} from "../../StdTypes"
|
|
3
|
+
|
|
4
|
+
export declare class EsMap<K, V> {
|
|
5
|
+
constructor()
|
|
6
|
+
protected inst: Map<K, V>
|
|
7
|
+
set(key: K, value: V): void
|
|
8
|
+
get(key: K): null | V
|
|
9
|
+
exists(key: K): boolean
|
|
10
|
+
keys(): Iterator<K>
|
|
11
|
+
protected static adaptIterator<T>(from: Iterator__1<T>): Iterator<T>
|
|
12
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {Register} from "../Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
export const EsMap = Register.global("$hxClasses")["genes.util.EsMap"] =
|
|
6
|
+
class EsMap extends Register.inherits() {
|
|
7
|
+
new() {
|
|
8
|
+
this.inst = new Map();
|
|
9
|
+
}
|
|
10
|
+
set(key, value) {
|
|
11
|
+
this.inst.set(key, value);
|
|
12
|
+
}
|
|
13
|
+
get(key) {
|
|
14
|
+
return this.inst.get(key);
|
|
15
|
+
}
|
|
16
|
+
exists(key) {
|
|
17
|
+
return this.inst.has(key);
|
|
18
|
+
}
|
|
19
|
+
keys() {
|
|
20
|
+
return EsMap.adaptIterator(this.inst.keys());
|
|
21
|
+
}
|
|
22
|
+
static adaptIterator(from) {
|
|
23
|
+
var value;
|
|
24
|
+
var done;
|
|
25
|
+
var queue = function () {
|
|
26
|
+
var data = from.next();
|
|
27
|
+
value = data.value;
|
|
28
|
+
done = data.done;
|
|
29
|
+
};
|
|
30
|
+
return {"hasNext": function () {
|
|
31
|
+
if (done == null) {
|
|
32
|
+
queue();
|
|
33
|
+
};
|
|
34
|
+
return !done;
|
|
35
|
+
}, "next": function () {
|
|
36
|
+
if (done == null) {
|
|
37
|
+
queue();
|
|
38
|
+
};
|
|
39
|
+
var pending = value;
|
|
40
|
+
queue();
|
|
41
|
+
return pending;
|
|
42
|
+
}};
|
|
43
|
+
}
|
|
44
|
+
static get __name__() {
|
|
45
|
+
return "genes.util.EsMap"
|
|
46
|
+
}
|
|
47
|
+
get __class__() {
|
|
48
|
+
return EsMap
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
Base class for exceptions.
|
|
4
|
+
|
|
5
|
+
If this class (or derivatives) is used to catch an exception, then
|
|
6
|
+
`haxe.CallStack.exceptionStack()` will not return a stack for the exception
|
|
7
|
+
caught. Use `haxe.Exception.stack` property instead:
|
|
8
|
+
```haxe
|
|
9
|
+
try {
|
|
10
|
+
throwSomething();
|
|
11
|
+
} catch(e:Exception) {
|
|
12
|
+
trace(e.stack);
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Custom exceptions should extend this class:
|
|
17
|
+
```haxe
|
|
18
|
+
class MyException extends haxe.Exception {}
|
|
19
|
+
//...
|
|
20
|
+
throw new MyException('terrible exception');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`haxe.Exception` is also a wildcard type to catch any exception:
|
|
24
|
+
```haxe
|
|
25
|
+
try {
|
|
26
|
+
throw 'Catch me!';
|
|
27
|
+
} catch(e:haxe.Exception) {
|
|
28
|
+
trace(e.message); // Output: Catch me!
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To rethrow an exception just throw it again.
|
|
33
|
+
Haxe will try to rethrow an original native exception whenever possible.
|
|
34
|
+
```haxe
|
|
35
|
+
try {
|
|
36
|
+
var a:Array<Int> = null;
|
|
37
|
+
a.push(1); // generates target-specific null-pointer exception
|
|
38
|
+
} catch(e:haxe.Exception) {
|
|
39
|
+
throw e; // rethrows native exception instead of haxe.Exception
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
*/
|
|
43
|
+
export declare class Exception extends Error {
|
|
44
|
+
constructor(message: string, previous?: null | Exception, $native?: null | any)
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
Exception message.
|
|
48
|
+
*/
|
|
49
|
+
message: string
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
Native exception, which caused this exception.
|
|
53
|
+
*/
|
|
54
|
+
native: any
|
|
55
|
+
protected __skipStack: number
|
|
56
|
+
protected __nativeException: any
|
|
57
|
+
protected __previousException: null | Exception
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
Returns exception message.
|
|
61
|
+
*/
|
|
62
|
+
toString(): string
|
|
63
|
+
protected get_message(): string
|
|
64
|
+
protected get_native(): any
|
|
65
|
+
protected static thrown(value: any): any
|
|
66
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {ValueException} from "./ValueException.js"
|
|
2
|
+
import {Register} from "../genes/Register.js"
|
|
3
|
+
|
|
4
|
+
const $global = Register.$global
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
Base class for exceptions.
|
|
8
|
+
|
|
9
|
+
If this class (or derivatives) is used to catch an exception, then
|
|
10
|
+
`haxe.CallStack.exceptionStack()` will not return a stack for the exception
|
|
11
|
+
caught. Use `haxe.Exception.stack` property instead:
|
|
12
|
+
```haxe
|
|
13
|
+
try {
|
|
14
|
+
throwSomething();
|
|
15
|
+
} catch(e:Exception) {
|
|
16
|
+
trace(e.stack);
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Custom exceptions should extend this class:
|
|
21
|
+
```haxe
|
|
22
|
+
class MyException extends haxe.Exception {}
|
|
23
|
+
//...
|
|
24
|
+
throw new MyException('terrible exception');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`haxe.Exception` is also a wildcard type to catch any exception:
|
|
28
|
+
```haxe
|
|
29
|
+
try {
|
|
30
|
+
throw 'Catch me!';
|
|
31
|
+
} catch(e:haxe.Exception) {
|
|
32
|
+
trace(e.message); // Output: Catch me!
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To rethrow an exception just throw it again.
|
|
37
|
+
Haxe will try to rethrow an original native exception whenever possible.
|
|
38
|
+
```haxe
|
|
39
|
+
try {
|
|
40
|
+
var a:Array<Int> = null;
|
|
41
|
+
a.push(1); // generates target-specific null-pointer exception
|
|
42
|
+
} catch(e:haxe.Exception) {
|
|
43
|
+
throw e; // rethrows native exception instead of haxe.Exception
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
*/
|
|
47
|
+
export const Exception = Register.global("$hxClasses")["haxe.Exception"] =
|
|
48
|
+
class Exception extends Register.inherits(() => Error, true) {
|
|
49
|
+
new(message, previous, $native) {
|
|
50
|
+
Error.call(this, message);
|
|
51
|
+
this.message = message;
|
|
52
|
+
this.__previousException = previous;
|
|
53
|
+
this.__nativeException = ($native != null) ? $native : this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
Returns exception message.
|
|
58
|
+
*/
|
|
59
|
+
toString() {
|
|
60
|
+
return this.get_message();
|
|
61
|
+
}
|
|
62
|
+
get_message() {
|
|
63
|
+
return this.message;
|
|
64
|
+
}
|
|
65
|
+
get_native() {
|
|
66
|
+
return this.__nativeException;
|
|
67
|
+
}
|
|
68
|
+
static thrown(value) {
|
|
69
|
+
if (((value) instanceof Exception)) {
|
|
70
|
+
return value.get_native();
|
|
71
|
+
} else if (((value) instanceof Error)) {
|
|
72
|
+
return value;
|
|
73
|
+
} else {
|
|
74
|
+
var e = new ValueException(value);
|
|
75
|
+
return e;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static get __name__() {
|
|
79
|
+
return "haxe.Exception"
|
|
80
|
+
}
|
|
81
|
+
static get __super__() {
|
|
82
|
+
return Error
|
|
83
|
+
}
|
|
84
|
+
get __class__() {
|
|
85
|
+
return Exception
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
`PosInfos` is a magic type which can be used to generate position information
|
|
4
|
+
into the output for debugging use.
|
|
5
|
+
|
|
6
|
+
If a function has a final optional argument of this type, i.e.
|
|
7
|
+
`(..., ?pos:haxe.PosInfos)`, each call to that function which does not assign
|
|
8
|
+
a value to that argument has its position added as call argument.
|
|
9
|
+
|
|
10
|
+
This can be used to track positions of calls in e.g. a unit testing
|
|
11
|
+
framework.
|
|
12
|
+
*/
|
|
13
|
+
export type PosInfos = {
|
|
14
|
+
className: string,
|
|
15
|
+
customParams?: null | any[],
|
|
16
|
+
fileName: string,
|
|
17
|
+
lineNumber: number,
|
|
18
|
+
methodName: string
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {Exception} from "./Exception"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
An exception containing arbitrary value.
|
|
5
|
+
|
|
6
|
+
This class is automatically used for throwing values, which don't extend `haxe.Exception`
|
|
7
|
+
or native exception type.
|
|
8
|
+
For example:
|
|
9
|
+
```haxe
|
|
10
|
+
throw "Terrible error";
|
|
11
|
+
```
|
|
12
|
+
will be compiled to
|
|
13
|
+
```haxe
|
|
14
|
+
throw new ValueException("Terrible error");
|
|
15
|
+
```
|
|
16
|
+
*/
|
|
17
|
+
export declare class ValueException extends Exception {
|
|
18
|
+
constructor(value: any, previous?: null | Exception, $native?: null | any)
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Thrown value.
|
|
22
|
+
*/
|
|
23
|
+
value: any
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {Exception} from "./Exception.js"
|
|
2
|
+
import {Register} from "../genes/Register.js"
|
|
3
|
+
|
|
4
|
+
const $global = Register.$global
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
An exception containing arbitrary value.
|
|
8
|
+
|
|
9
|
+
This class is automatically used for throwing values, which don't extend `haxe.Exception`
|
|
10
|
+
or native exception type.
|
|
11
|
+
For example:
|
|
12
|
+
```haxe
|
|
13
|
+
throw "Terrible error";
|
|
14
|
+
```
|
|
15
|
+
will be compiled to
|
|
16
|
+
```haxe
|
|
17
|
+
throw new ValueException("Terrible error");
|
|
18
|
+
```
|
|
19
|
+
*/
|
|
20
|
+
export const ValueException = Register.global("$hxClasses")["haxe.ValueException"] =
|
|
21
|
+
class ValueException extends Register.inherits(() => Exception, true) {
|
|
22
|
+
new(value, previous, $native) {
|
|
23
|
+
super.new(String(value), previous, $native);
|
|
24
|
+
this.value = value;
|
|
25
|
+
}
|
|
26
|
+
static get __name__() {
|
|
27
|
+
return "haxe.ValueException"
|
|
28
|
+
}
|
|
29
|
+
static get __super__() {
|
|
30
|
+
return Exception
|
|
31
|
+
}
|
|
32
|
+
get __class__() {
|
|
33
|
+
return ValueException
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {Register} from "../../genes/Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Calculates the Crc32 of the given Bytes.
|
|
7
|
+
*/
|
|
8
|
+
export const Crc32 = Register.global("$hxClasses")["haxe.crypto.Crc32"] =
|
|
9
|
+
class Crc32 {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
Calculates the CRC32 of the given data bytes
|
|
13
|
+
*/
|
|
14
|
+
static make(data) {
|
|
15
|
+
var c_crc = -1;
|
|
16
|
+
var len = data.length;
|
|
17
|
+
var b = data.b.bufferValue;
|
|
18
|
+
var _g = 0;
|
|
19
|
+
while (_g < len) {
|
|
20
|
+
var tmp = (c_crc ^ b.bytes[_g++]) & 255;
|
|
21
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
22
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
23
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
24
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
25
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
26
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
27
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
28
|
+
tmp = tmp >>> 1 ^ -(tmp & 1) & -306674912;
|
|
29
|
+
c_crc = c_crc >>> 8 ^ tmp;
|
|
30
|
+
};
|
|
31
|
+
return c_crc ^ -1;
|
|
32
|
+
}
|
|
33
|
+
static get __name__() {
|
|
34
|
+
return "haxe.crypto.Crc32"
|
|
35
|
+
}
|
|
36
|
+
get __class__() {
|
|
37
|
+
return Crc32
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
A linked-list of elements. The list is composed of element container objects
|
|
4
|
+
that are chained together. It is optimized so that adding or removing an
|
|
5
|
+
element does not imply copying the whole list content every time.
|
|
6
|
+
|
|
7
|
+
@see https://haxe.org/manual/std-List.html
|
|
8
|
+
*/
|
|
9
|
+
export declare class List<T> {
|
|
10
|
+
constructor()
|
|
11
|
+
protected h: ListNode<T>
|
|
12
|
+
protected q: ListNode<T>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
The length of `this` List.
|
|
16
|
+
*/
|
|
17
|
+
length: number
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
Adds element `item` at the end of `this` List.
|
|
21
|
+
|
|
22
|
+
`this.length` increases by 1.
|
|
23
|
+
*/
|
|
24
|
+
add(item: T): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare class ListNode<T> {
|
|
28
|
+
constructor(item: T, next: ListNode<T>)
|
|
29
|
+
item: T
|
|
30
|
+
next: ListNode<T>
|
|
31
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {Register} from "../../genes/Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
A linked-list of elements. The list is composed of element container objects
|
|
7
|
+
that are chained together. It is optimized so that adding or removing an
|
|
8
|
+
element does not imply copying the whole list content every time.
|
|
9
|
+
|
|
10
|
+
@see https://haxe.org/manual/std-List.html
|
|
11
|
+
*/
|
|
12
|
+
export const List = Register.global("$hxClasses")["haxe.ds.List"] =
|
|
13
|
+
class List extends Register.inherits() {
|
|
14
|
+
new() {
|
|
15
|
+
this.length = 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
Adds element `item` at the end of `this` List.
|
|
20
|
+
|
|
21
|
+
`this.length` increases by 1.
|
|
22
|
+
*/
|
|
23
|
+
add(item) {
|
|
24
|
+
var x = new ListNode(item, null);
|
|
25
|
+
if (this.h == null) {
|
|
26
|
+
this.h = x;
|
|
27
|
+
} else {
|
|
28
|
+
this.q.next = x;
|
|
29
|
+
};
|
|
30
|
+
this.q = x;
|
|
31
|
+
this.length++;
|
|
32
|
+
}
|
|
33
|
+
static get __name__() {
|
|
34
|
+
return "haxe.ds.List"
|
|
35
|
+
}
|
|
36
|
+
get __class__() {
|
|
37
|
+
return List
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export const ListNode = Register.global("$hxClasses")["haxe.ds._List.ListNode"] =
|
|
43
|
+
class ListNode extends Register.inherits() {
|
|
44
|
+
new(item, next) {
|
|
45
|
+
this.item = item;
|
|
46
|
+
this.next = next;
|
|
47
|
+
}
|
|
48
|
+
static get __name__() {
|
|
49
|
+
return "haxe.ds._List.ListNode"
|
|
50
|
+
}
|
|
51
|
+
get __class__() {
|
|
52
|
+
return ListNode
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|