mol_plot_all 1.2.1173 → 1.2.1175
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/node.d.ts +138 -91
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +143 -16
- package/node.js.map +1 -1
- package/node.mjs +143 -16
- package/node.test.js +258 -96
- package/node.test.js.map +1 -1
- package/package.json +4 -1
- package/web.d.ts +90 -90
- package/web.deps.json +1 -1
package/node.mjs
CHANGED
|
@@ -2034,6 +2034,36 @@ require = (req => Object.assign(function require(name) {
|
|
|
2034
2034
|
return $node[name];
|
|
2035
2035
|
}, req))(require);
|
|
2036
2036
|
|
|
2037
|
+
;
|
|
2038
|
+
"use strict";
|
|
2039
|
+
var $;
|
|
2040
|
+
(function ($) {
|
|
2041
|
+
class $mol_error_mix extends AggregateError {
|
|
2042
|
+
cause;
|
|
2043
|
+
name = $$.$mol_func_name(this.constructor).replace(/^\$/, '') + '_Error';
|
|
2044
|
+
constructor(message, cause = {}, ...errors) {
|
|
2045
|
+
super(errors, message, { cause });
|
|
2046
|
+
this.cause = cause;
|
|
2047
|
+
const stack_get = Object.getOwnPropertyDescriptor(this, 'stack')?.get ?? (() => super.stack);
|
|
2048
|
+
Object.defineProperty(this, 'stack', {
|
|
2049
|
+
get: () => (stack_get.call(this) ?? this.message) + '\n' + [JSON.stringify(this.cause, null, ' ') ?? 'no cause', ...this.errors.map(e => e.stack)].map(e => e.trim()
|
|
2050
|
+
.replace(/at /gm, ' at ')
|
|
2051
|
+
.replace(/^(?! +at )(.*)/gm, ' at | $1 (#)')).join('\n')
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
static [Symbol.toPrimitive]() {
|
|
2055
|
+
return this.toString();
|
|
2056
|
+
}
|
|
2057
|
+
static toString() {
|
|
2058
|
+
return $$.$mol_func_name(this);
|
|
2059
|
+
}
|
|
2060
|
+
static make(...params) {
|
|
2061
|
+
return new this(...params);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
$.$mol_error_mix = $mol_error_mix;
|
|
2065
|
+
})($ || ($ = {}));
|
|
2066
|
+
|
|
2037
2067
|
;
|
|
2038
2068
|
"use strict";
|
|
2039
2069
|
var $;
|
|
@@ -2057,26 +2087,123 @@ var $;
|
|
|
2057
2087
|
"use strict";
|
|
2058
2088
|
var $;
|
|
2059
2089
|
(function ($) {
|
|
2060
|
-
function $
|
|
2061
|
-
|
|
2062
|
-
|
|
2090
|
+
function $mol_wire_sync(obj) {
|
|
2091
|
+
return new Proxy(obj, {
|
|
2092
|
+
get(obj, field) {
|
|
2093
|
+
const val = obj[field];
|
|
2094
|
+
if (typeof val !== 'function')
|
|
2095
|
+
return val;
|
|
2096
|
+
const temp = $mol_wire_task.getter(val);
|
|
2097
|
+
return function $mol_wire_sync(...args) {
|
|
2098
|
+
const fiber = temp(obj, args);
|
|
2099
|
+
return fiber.sync();
|
|
2100
|
+
};
|
|
2101
|
+
},
|
|
2102
|
+
apply(obj, self, args) {
|
|
2103
|
+
const temp = $mol_wire_task.getter(obj);
|
|
2104
|
+
const fiber = temp(self, args);
|
|
2105
|
+
return fiber.sync();
|
|
2106
|
+
},
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
$.$mol_wire_sync = $mol_wire_sync;
|
|
2110
|
+
})($ || ($ = {}));
|
|
2111
|
+
|
|
2112
|
+
;
|
|
2113
|
+
"use strict";
|
|
2114
|
+
var $;
|
|
2115
|
+
(function ($) {
|
|
2116
|
+
class $mol_run_error extends $mol_error_mix {
|
|
2117
|
+
}
|
|
2118
|
+
$.$mol_run_error = $mol_run_error;
|
|
2119
|
+
const child_process = $node['child_process'];
|
|
2120
|
+
$.$mol_run_spawn = child_process.spawn.bind(child_process);
|
|
2121
|
+
function $mol_run_async({ dir, timeout, command, env }) {
|
|
2122
|
+
const args_raw = typeof command === 'string' ? command.split(' ') : command;
|
|
2123
|
+
const [app, ...args] = args_raw;
|
|
2124
|
+
const sub = this.$mol_run_spawn(app, args, {
|
|
2125
|
+
shell: true,
|
|
2126
|
+
cwd: dir,
|
|
2127
|
+
env
|
|
2128
|
+
});
|
|
2063
2129
|
this.$mol_log3_come({
|
|
2064
|
-
place: '$
|
|
2065
|
-
|
|
2130
|
+
place: '$mol_run_async',
|
|
2131
|
+
pid: sub.pid,
|
|
2066
2132
|
message: 'Run',
|
|
2067
|
-
command:
|
|
2133
|
+
command: args_raw.join(' '),
|
|
2134
|
+
dir: $node.path.relative('', dir),
|
|
2068
2135
|
});
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2136
|
+
let killed = false;
|
|
2137
|
+
let timer;
|
|
2138
|
+
const std_data = [];
|
|
2139
|
+
const error_data = [];
|
|
2140
|
+
const add = (std_chunk, error_chunk) => {
|
|
2141
|
+
if (std_chunk)
|
|
2142
|
+
std_data.push(std_chunk);
|
|
2143
|
+
if (error_chunk)
|
|
2144
|
+
error_data.push(error_chunk);
|
|
2145
|
+
if (!timeout)
|
|
2146
|
+
return;
|
|
2147
|
+
clearTimeout(timer);
|
|
2148
|
+
timer = setTimeout(() => {
|
|
2149
|
+
const signal = killed ? 'SIGKILL' : 'SIGTERM';
|
|
2150
|
+
killed = true;
|
|
2151
|
+
add();
|
|
2152
|
+
sub.kill(signal);
|
|
2153
|
+
}, timeout);
|
|
2154
|
+
};
|
|
2155
|
+
add();
|
|
2156
|
+
sub.stdout?.on('data', data => add(data));
|
|
2157
|
+
sub.stderr?.on('data', data => add(undefined, data));
|
|
2158
|
+
const promise = new Promise((done, fail) => {
|
|
2159
|
+
const close = (error, status = null, signal = null) => {
|
|
2160
|
+
if (!timer && timeout)
|
|
2161
|
+
return;
|
|
2162
|
+
clearTimeout(timer);
|
|
2163
|
+
timer = undefined;
|
|
2164
|
+
const res = {
|
|
2165
|
+
pid: sub.pid,
|
|
2166
|
+
status,
|
|
2167
|
+
signal,
|
|
2168
|
+
get stdout() { return Buffer.concat(std_data); },
|
|
2169
|
+
get stderr() { return Buffer.concat(error_data); }
|
|
2170
|
+
};
|
|
2171
|
+
this.$mol_log3_done({
|
|
2172
|
+
place: '$mol_run_async',
|
|
2173
|
+
pid: sub.pid,
|
|
2174
|
+
message: 'Run',
|
|
2175
|
+
status,
|
|
2176
|
+
command: args_raw.join(' '),
|
|
2177
|
+
dir: $node.path.relative('', dir),
|
|
2178
|
+
});
|
|
2179
|
+
if (error || status || killed)
|
|
2180
|
+
return fail(new $mol_run_error((res.stderr.toString() || res.stdout.toString() || 'Run error') + (killed ? ', timeout' : ''), { signal, timeout: killed }, ...error ? [error] : []));
|
|
2181
|
+
done(res);
|
|
2182
|
+
};
|
|
2183
|
+
sub.on('disconnect', () => close(new Error('Disconnected')));
|
|
2184
|
+
sub.on('error', err => close(err));
|
|
2185
|
+
sub.on('exit', (status, signal) => close(null, status, signal));
|
|
2073
2186
|
});
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2187
|
+
return Object.assign(promise, { destructor: () => {
|
|
2188
|
+
clearTimeout(timer);
|
|
2189
|
+
sub.kill('SIGKILL');
|
|
2190
|
+
} });
|
|
2191
|
+
}
|
|
2192
|
+
$.$mol_run_async = $mol_run_async;
|
|
2193
|
+
function $mol_run(options) {
|
|
2194
|
+
if (!options.env)
|
|
2195
|
+
options = { ...options, env: this.$mol_env() };
|
|
2196
|
+
return $mol_wire_sync(this).$mol_run_async(options);
|
|
2197
|
+
}
|
|
2198
|
+
$.$mol_run = $mol_run;
|
|
2199
|
+
})($ || ($ = {}));
|
|
2200
|
+
|
|
2201
|
+
;
|
|
2202
|
+
"use strict";
|
|
2203
|
+
var $;
|
|
2204
|
+
(function ($) {
|
|
2205
|
+
function $mol_exec(dir, command, ...args) {
|
|
2206
|
+
return this.$mol_run({ command: [command, ...args], dir });
|
|
2080
2207
|
}
|
|
2081
2208
|
$.$mol_exec = $mol_exec;
|
|
2082
2209
|
})($ || ($ = {}));
|
package/node.test.js
CHANGED
|
@@ -2025,6 +2025,36 @@ require = (req => Object.assign(function require(name) {
|
|
|
2025
2025
|
return $node[name];
|
|
2026
2026
|
}, req))(require);
|
|
2027
2027
|
|
|
2028
|
+
;
|
|
2029
|
+
"use strict";
|
|
2030
|
+
var $;
|
|
2031
|
+
(function ($) {
|
|
2032
|
+
class $mol_error_mix extends AggregateError {
|
|
2033
|
+
cause;
|
|
2034
|
+
name = $$.$mol_func_name(this.constructor).replace(/^\$/, '') + '_Error';
|
|
2035
|
+
constructor(message, cause = {}, ...errors) {
|
|
2036
|
+
super(errors, message, { cause });
|
|
2037
|
+
this.cause = cause;
|
|
2038
|
+
const stack_get = Object.getOwnPropertyDescriptor(this, 'stack')?.get ?? (() => super.stack);
|
|
2039
|
+
Object.defineProperty(this, 'stack', {
|
|
2040
|
+
get: () => (stack_get.call(this) ?? this.message) + '\n' + [JSON.stringify(this.cause, null, ' ') ?? 'no cause', ...this.errors.map(e => e.stack)].map(e => e.trim()
|
|
2041
|
+
.replace(/at /gm, ' at ')
|
|
2042
|
+
.replace(/^(?! +at )(.*)/gm, ' at | $1 (#)')).join('\n')
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
static [Symbol.toPrimitive]() {
|
|
2046
|
+
return this.toString();
|
|
2047
|
+
}
|
|
2048
|
+
static toString() {
|
|
2049
|
+
return $$.$mol_func_name(this);
|
|
2050
|
+
}
|
|
2051
|
+
static make(...params) {
|
|
2052
|
+
return new this(...params);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
$.$mol_error_mix = $mol_error_mix;
|
|
2056
|
+
})($ || ($ = {}));
|
|
2057
|
+
|
|
2028
2058
|
;
|
|
2029
2059
|
"use strict";
|
|
2030
2060
|
var $;
|
|
@@ -2048,26 +2078,123 @@ var $;
|
|
|
2048
2078
|
"use strict";
|
|
2049
2079
|
var $;
|
|
2050
2080
|
(function ($) {
|
|
2051
|
-
function $
|
|
2052
|
-
|
|
2053
|
-
|
|
2081
|
+
function $mol_wire_sync(obj) {
|
|
2082
|
+
return new Proxy(obj, {
|
|
2083
|
+
get(obj, field) {
|
|
2084
|
+
const val = obj[field];
|
|
2085
|
+
if (typeof val !== 'function')
|
|
2086
|
+
return val;
|
|
2087
|
+
const temp = $mol_wire_task.getter(val);
|
|
2088
|
+
return function $mol_wire_sync(...args) {
|
|
2089
|
+
const fiber = temp(obj, args);
|
|
2090
|
+
return fiber.sync();
|
|
2091
|
+
};
|
|
2092
|
+
},
|
|
2093
|
+
apply(obj, self, args) {
|
|
2094
|
+
const temp = $mol_wire_task.getter(obj);
|
|
2095
|
+
const fiber = temp(self, args);
|
|
2096
|
+
return fiber.sync();
|
|
2097
|
+
},
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
$.$mol_wire_sync = $mol_wire_sync;
|
|
2101
|
+
})($ || ($ = {}));
|
|
2102
|
+
|
|
2103
|
+
;
|
|
2104
|
+
"use strict";
|
|
2105
|
+
var $;
|
|
2106
|
+
(function ($) {
|
|
2107
|
+
class $mol_run_error extends $mol_error_mix {
|
|
2108
|
+
}
|
|
2109
|
+
$.$mol_run_error = $mol_run_error;
|
|
2110
|
+
const child_process = $node['child_process'];
|
|
2111
|
+
$.$mol_run_spawn = child_process.spawn.bind(child_process);
|
|
2112
|
+
function $mol_run_async({ dir, timeout, command, env }) {
|
|
2113
|
+
const args_raw = typeof command === 'string' ? command.split(' ') : command;
|
|
2114
|
+
const [app, ...args] = args_raw;
|
|
2115
|
+
const sub = this.$mol_run_spawn(app, args, {
|
|
2116
|
+
shell: true,
|
|
2117
|
+
cwd: dir,
|
|
2118
|
+
env
|
|
2119
|
+
});
|
|
2054
2120
|
this.$mol_log3_come({
|
|
2055
|
-
place: '$
|
|
2056
|
-
|
|
2121
|
+
place: '$mol_run_async',
|
|
2122
|
+
pid: sub.pid,
|
|
2057
2123
|
message: 'Run',
|
|
2058
|
-
command:
|
|
2124
|
+
command: args_raw.join(' '),
|
|
2125
|
+
dir: $node.path.relative('', dir),
|
|
2059
2126
|
});
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2127
|
+
let killed = false;
|
|
2128
|
+
let timer;
|
|
2129
|
+
const std_data = [];
|
|
2130
|
+
const error_data = [];
|
|
2131
|
+
const add = (std_chunk, error_chunk) => {
|
|
2132
|
+
if (std_chunk)
|
|
2133
|
+
std_data.push(std_chunk);
|
|
2134
|
+
if (error_chunk)
|
|
2135
|
+
error_data.push(error_chunk);
|
|
2136
|
+
if (!timeout)
|
|
2137
|
+
return;
|
|
2138
|
+
clearTimeout(timer);
|
|
2139
|
+
timer = setTimeout(() => {
|
|
2140
|
+
const signal = killed ? 'SIGKILL' : 'SIGTERM';
|
|
2141
|
+
killed = true;
|
|
2142
|
+
add();
|
|
2143
|
+
sub.kill(signal);
|
|
2144
|
+
}, timeout);
|
|
2145
|
+
};
|
|
2146
|
+
add();
|
|
2147
|
+
sub.stdout?.on('data', data => add(data));
|
|
2148
|
+
sub.stderr?.on('data', data => add(undefined, data));
|
|
2149
|
+
const promise = new Promise((done, fail) => {
|
|
2150
|
+
const close = (error, status = null, signal = null) => {
|
|
2151
|
+
if (!timer && timeout)
|
|
2152
|
+
return;
|
|
2153
|
+
clearTimeout(timer);
|
|
2154
|
+
timer = undefined;
|
|
2155
|
+
const res = {
|
|
2156
|
+
pid: sub.pid,
|
|
2157
|
+
status,
|
|
2158
|
+
signal,
|
|
2159
|
+
get stdout() { return Buffer.concat(std_data); },
|
|
2160
|
+
get stderr() { return Buffer.concat(error_data); }
|
|
2161
|
+
};
|
|
2162
|
+
this.$mol_log3_done({
|
|
2163
|
+
place: '$mol_run_async',
|
|
2164
|
+
pid: sub.pid,
|
|
2165
|
+
message: 'Run',
|
|
2166
|
+
status,
|
|
2167
|
+
command: args_raw.join(' '),
|
|
2168
|
+
dir: $node.path.relative('', dir),
|
|
2169
|
+
});
|
|
2170
|
+
if (error || status || killed)
|
|
2171
|
+
return fail(new $mol_run_error((res.stderr.toString() || res.stdout.toString() || 'Run error') + (killed ? ', timeout' : ''), { signal, timeout: killed }, ...error ? [error] : []));
|
|
2172
|
+
done(res);
|
|
2173
|
+
};
|
|
2174
|
+
sub.on('disconnect', () => close(new Error('Disconnected')));
|
|
2175
|
+
sub.on('error', err => close(err));
|
|
2176
|
+
sub.on('exit', (status, signal) => close(null, status, signal));
|
|
2064
2177
|
});
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2178
|
+
return Object.assign(promise, { destructor: () => {
|
|
2179
|
+
clearTimeout(timer);
|
|
2180
|
+
sub.kill('SIGKILL');
|
|
2181
|
+
} });
|
|
2182
|
+
}
|
|
2183
|
+
$.$mol_run_async = $mol_run_async;
|
|
2184
|
+
function $mol_run(options) {
|
|
2185
|
+
if (!options.env)
|
|
2186
|
+
options = { ...options, env: this.$mol_env() };
|
|
2187
|
+
return $mol_wire_sync(this).$mol_run_async(options);
|
|
2188
|
+
}
|
|
2189
|
+
$.$mol_run = $mol_run;
|
|
2190
|
+
})($ || ($ = {}));
|
|
2191
|
+
|
|
2192
|
+
;
|
|
2193
|
+
"use strict";
|
|
2194
|
+
var $;
|
|
2195
|
+
(function ($) {
|
|
2196
|
+
function $mol_exec(dir, command, ...args) {
|
|
2197
|
+
return this.$mol_run({ command: [command, ...args], dir });
|
|
2071
2198
|
}
|
|
2072
2199
|
$.$mol_exec = $mol_exec;
|
|
2073
2200
|
})($ || ($ = {}));
|
|
@@ -6151,20 +6278,6 @@ var $;
|
|
|
6151
6278
|
$mol_test_mocks.push($ => $.$mol_fail_log = () => false);
|
|
6152
6279
|
})($ || ($ = {}));
|
|
6153
6280
|
|
|
6154
|
-
;
|
|
6155
|
-
"use strict";
|
|
6156
|
-
var $;
|
|
6157
|
-
(function ($_1) {
|
|
6158
|
-
$mol_test_mocks.push($ => {
|
|
6159
|
-
$.$mol_log3_come = () => { };
|
|
6160
|
-
$.$mol_log3_done = () => { };
|
|
6161
|
-
$.$mol_log3_fail = () => { };
|
|
6162
|
-
$.$mol_log3_warn = () => { };
|
|
6163
|
-
$.$mol_log3_rise = () => { };
|
|
6164
|
-
$.$mol_log3_area = () => () => { };
|
|
6165
|
-
});
|
|
6166
|
-
})($ || ($ = {}));
|
|
6167
|
-
|
|
6168
6281
|
;
|
|
6169
6282
|
"use strict";
|
|
6170
6283
|
|
|
@@ -6933,6 +7046,20 @@ var $;
|
|
|
6933
7046
|
});
|
|
6934
7047
|
})($ || ($ = {}));
|
|
6935
7048
|
|
|
7049
|
+
;
|
|
7050
|
+
"use strict";
|
|
7051
|
+
var $;
|
|
7052
|
+
(function ($_1) {
|
|
7053
|
+
$mol_test_mocks.push($ => {
|
|
7054
|
+
$.$mol_log3_come = () => { };
|
|
7055
|
+
$.$mol_log3_done = () => { };
|
|
7056
|
+
$.$mol_log3_fail = () => { };
|
|
7057
|
+
$.$mol_log3_warn = () => { };
|
|
7058
|
+
$.$mol_log3_rise = () => { };
|
|
7059
|
+
$.$mol_log3_area = () => () => { };
|
|
7060
|
+
});
|
|
7061
|
+
})($ || ($ = {}));
|
|
7062
|
+
|
|
6936
7063
|
;
|
|
6937
7064
|
"use strict";
|
|
6938
7065
|
var $;
|
|
@@ -6947,6 +7074,85 @@ var $;
|
|
|
6947
7074
|
});
|
|
6948
7075
|
})($ || ($ = {}));
|
|
6949
7076
|
|
|
7077
|
+
;
|
|
7078
|
+
"use strict";
|
|
7079
|
+
var $;
|
|
7080
|
+
(function ($) {
|
|
7081
|
+
$mol_test({
|
|
7082
|
+
'auto name'() {
|
|
7083
|
+
class Invalid extends $mol_error_mix {
|
|
7084
|
+
}
|
|
7085
|
+
const mix = new Invalid('foo');
|
|
7086
|
+
$mol_assert_equal(mix.name, 'Invalid_Error');
|
|
7087
|
+
},
|
|
7088
|
+
'simpe mix'() {
|
|
7089
|
+
const mix = new $mol_error_mix('foo', {}, new Error('bar'), new Error('lol'));
|
|
7090
|
+
$mol_assert_equal(mix.message, 'foo');
|
|
7091
|
+
$mol_assert_equal(mix.errors.map(e => e.message), ['bar', 'lol']);
|
|
7092
|
+
},
|
|
7093
|
+
'provide additional info'() {
|
|
7094
|
+
class Invalid extends $mol_error_mix {
|
|
7095
|
+
}
|
|
7096
|
+
const mix = new $mol_error_mix('Wrong password', {}, new Invalid('Too short', { value: 'p@ssw0rd', hint: '> 8 letters' }), new Invalid('Too simple', { value: 'p@ssw0rd', hint: 'need capital letter' }));
|
|
7097
|
+
const hints = [];
|
|
7098
|
+
if (mix instanceof $mol_error_mix) {
|
|
7099
|
+
for (const er of mix.errors) {
|
|
7100
|
+
if (er instanceof Invalid) {
|
|
7101
|
+
hints.push(er.cause?.hint ?? '');
|
|
7102
|
+
}
|
|
7103
|
+
}
|
|
7104
|
+
}
|
|
7105
|
+
$mol_assert_equal(hints, ['> 8 letters', 'need capital letter']);
|
|
7106
|
+
},
|
|
7107
|
+
});
|
|
7108
|
+
})($ || ($ = {}));
|
|
7109
|
+
|
|
7110
|
+
;
|
|
7111
|
+
"use strict";
|
|
7112
|
+
var $;
|
|
7113
|
+
(function ($_1) {
|
|
7114
|
+
$mol_test({
|
|
7115
|
+
'test types'($) {
|
|
7116
|
+
class A {
|
|
7117
|
+
static a() {
|
|
7118
|
+
return Promise.resolve('');
|
|
7119
|
+
}
|
|
7120
|
+
static b() {
|
|
7121
|
+
return $mol_wire_sync(this).a();
|
|
7122
|
+
}
|
|
7123
|
+
}
|
|
7124
|
+
},
|
|
7125
|
+
});
|
|
7126
|
+
})($ || ($ = {}));
|
|
7127
|
+
|
|
7128
|
+
;
|
|
7129
|
+
"use strict";
|
|
7130
|
+
var $;
|
|
7131
|
+
(function ($_1) {
|
|
7132
|
+
$mol_test({
|
|
7133
|
+
async 'exec timeout auto kill child process'($) {
|
|
7134
|
+
let close_mock = () => { };
|
|
7135
|
+
const context_mock = $.$mol_ambient({
|
|
7136
|
+
$mol_run_spawn: () => ({
|
|
7137
|
+
on(name, cb) {
|
|
7138
|
+
if (name === 'exit')
|
|
7139
|
+
close_mock = cb;
|
|
7140
|
+
},
|
|
7141
|
+
kill() { close_mock(); }
|
|
7142
|
+
})
|
|
7143
|
+
});
|
|
7144
|
+
let message = '';
|
|
7145
|
+
try {
|
|
7146
|
+
const res = await $mol_wire_async(context_mock).$mol_run({ command: 'sleep 10', dir: '.', timeout: 10 });
|
|
7147
|
+
}
|
|
7148
|
+
catch (e) {
|
|
7149
|
+
message = e.message;
|
|
7150
|
+
}
|
|
7151
|
+
$mol_assert_equal(message, 'Run error, timeout');
|
|
7152
|
+
}
|
|
7153
|
+
});
|
|
7154
|
+
})($ || ($ = {}));
|
|
7155
|
+
|
|
6950
7156
|
;
|
|
6951
7157
|
"use strict";
|
|
6952
7158
|
var $;
|
|
@@ -7194,25 +7400,6 @@ var $;
|
|
|
7194
7400
|
});
|
|
7195
7401
|
})($ || ($ = {}));
|
|
7196
7402
|
|
|
7197
|
-
;
|
|
7198
|
-
"use strict";
|
|
7199
|
-
var $;
|
|
7200
|
-
(function ($) {
|
|
7201
|
-
$mol_test({
|
|
7202
|
-
'init with overload'() {
|
|
7203
|
-
class X extends $mol_object {
|
|
7204
|
-
foo() {
|
|
7205
|
-
return 1;
|
|
7206
|
-
}
|
|
7207
|
-
}
|
|
7208
|
-
var x = X.make({
|
|
7209
|
-
foo: () => 2,
|
|
7210
|
-
});
|
|
7211
|
-
$mol_assert_equal(x.foo(), 2);
|
|
7212
|
-
},
|
|
7213
|
-
});
|
|
7214
|
-
})($ || ($ = {}));
|
|
7215
|
-
|
|
7216
7403
|
;
|
|
7217
7404
|
"use strict";
|
|
7218
7405
|
var $;
|
|
@@ -7400,9 +7587,6 @@ var $;
|
|
|
7400
7587
|
});
|
|
7401
7588
|
})($ || ($ = {}));
|
|
7402
7589
|
|
|
7403
|
-
;
|
|
7404
|
-
"use strict";
|
|
7405
|
-
|
|
7406
7590
|
;
|
|
7407
7591
|
"use strict";
|
|
7408
7592
|
var $;
|
|
@@ -7431,50 +7615,6 @@ var $;
|
|
|
7431
7615
|
});
|
|
7432
7616
|
})($ || ($ = {}));
|
|
7433
7617
|
|
|
7434
|
-
;
|
|
7435
|
-
"use strict";
|
|
7436
|
-
var $;
|
|
7437
|
-
(function ($) {
|
|
7438
|
-
function $mol_wire_sync(obj) {
|
|
7439
|
-
return new Proxy(obj, {
|
|
7440
|
-
get(obj, field) {
|
|
7441
|
-
const val = obj[field];
|
|
7442
|
-
if (typeof val !== 'function')
|
|
7443
|
-
return val;
|
|
7444
|
-
const temp = $mol_wire_task.getter(val);
|
|
7445
|
-
return function $mol_wire_sync(...args) {
|
|
7446
|
-
const fiber = temp(obj, args);
|
|
7447
|
-
return fiber.sync();
|
|
7448
|
-
};
|
|
7449
|
-
},
|
|
7450
|
-
apply(obj, self, args) {
|
|
7451
|
-
const temp = $mol_wire_task.getter(obj);
|
|
7452
|
-
const fiber = temp(self, args);
|
|
7453
|
-
return fiber.sync();
|
|
7454
|
-
},
|
|
7455
|
-
});
|
|
7456
|
-
}
|
|
7457
|
-
$.$mol_wire_sync = $mol_wire_sync;
|
|
7458
|
-
})($ || ($ = {}));
|
|
7459
|
-
|
|
7460
|
-
;
|
|
7461
|
-
"use strict";
|
|
7462
|
-
var $;
|
|
7463
|
-
(function ($_1) {
|
|
7464
|
-
$mol_test({
|
|
7465
|
-
'test types'($) {
|
|
7466
|
-
class A {
|
|
7467
|
-
static a() {
|
|
7468
|
-
return Promise.resolve('');
|
|
7469
|
-
}
|
|
7470
|
-
static b() {
|
|
7471
|
-
return $mol_wire_sync(this).a();
|
|
7472
|
-
}
|
|
7473
|
-
}
|
|
7474
|
-
},
|
|
7475
|
-
});
|
|
7476
|
-
})($ || ($ = {}));
|
|
7477
|
-
|
|
7478
7618
|
;
|
|
7479
7619
|
"use strict";
|
|
7480
7620
|
var $;
|
|
@@ -7546,6 +7686,28 @@ var $;
|
|
|
7546
7686
|
});
|
|
7547
7687
|
})($ || ($ = {}));
|
|
7548
7688
|
|
|
7689
|
+
;
|
|
7690
|
+
"use strict";
|
|
7691
|
+
var $;
|
|
7692
|
+
(function ($) {
|
|
7693
|
+
$mol_test({
|
|
7694
|
+
'init with overload'() {
|
|
7695
|
+
class X extends $mol_object {
|
|
7696
|
+
foo() {
|
|
7697
|
+
return 1;
|
|
7698
|
+
}
|
|
7699
|
+
}
|
|
7700
|
+
var x = X.make({
|
|
7701
|
+
foo: () => 2,
|
|
7702
|
+
});
|
|
7703
|
+
$mol_assert_equal(x.foo(), 2);
|
|
7704
|
+
},
|
|
7705
|
+
});
|
|
7706
|
+
})($ || ($ = {}));
|
|
7707
|
+
|
|
7708
|
+
;
|
|
7709
|
+
"use strict";
|
|
7710
|
+
|
|
7549
7711
|
;
|
|
7550
7712
|
"use strict";
|
|
7551
7713
|
var $;
|