@ball-lang/engine 1.4.4 → 1.4.5
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/package.json
CHANGED
package/src/compiled_engine.ts
CHANGED
|
@@ -1389,7 +1389,7 @@ export class BallEngine {
|
|
|
1389
1389
|
this.moduleHandlers = moduleHandlers;
|
|
1390
1390
|
this._validateProgramLimits();
|
|
1391
1391
|
if (enableProfiling) {
|
|
1392
|
-
this._callCounts =
|
|
1392
|
+
this._callCounts = {};
|
|
1393
1393
|
}
|
|
1394
1394
|
for (const handler of this.moduleHandlers) {
|
|
1395
1395
|
handler.init(this);
|
|
@@ -1428,7 +1428,7 @@ export class BallEngine {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
1430
|
profilingReport(): any {
|
|
1431
|
-
return Map.unmodifiable((this._callCounts ??
|
|
1431
|
+
return Map.unmodifiable((this._callCounts ?? {}));
|
|
1432
1432
|
}
|
|
1433
1433
|
|
|
1434
1434
|
callFunction(module: any, function_: any, input: any): any {
|
|
@@ -2212,7 +2212,7 @@ export class BallEngine {
|
|
|
2212
2212
|
fields[entry.key] = entry.value;
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
|
-
return new BallObject({ typeName: typeName, superObject: __ball_index(instance, '__super__'), fields: fields, methods: (__ball_index(instance, '__methods__') ??
|
|
2215
|
+
return new BallObject({ typeName: typeName, superObject: __ball_index(instance, '__super__'), fields: fields, methods: (__ball_index(instance, '__methods__') ?? {}) });
|
|
2216
2216
|
}
|
|
2217
2217
|
|
|
2218
2218
|
async _invokeSuperConstructor(childCtor: any, superclass: any, resolvedParams: any): Promise<any> {
|
|
@@ -4553,7 +4553,7 @@ export class BallEngine {
|
|
|
4553
4553
|
_lazyFields(call: any): any {
|
|
4554
4554
|
const input = call;
|
|
4555
4555
|
if ((!hasInput(call) || !__ball_eq(whichExpr(call.input), Expression_Expr.messageCreation))) {
|
|
4556
|
-
return
|
|
4556
|
+
return {};
|
|
4557
4557
|
}
|
|
4558
4558
|
let result = {};
|
|
4559
4559
|
for (const f of call.input.messageCreation.fields) {
|
|
@@ -5822,6 +5822,20 @@ export class BallEngine {
|
|
|
5822
5822
|
throw new _FlowSignal('goto', { label: label });
|
|
5823
5823
|
}
|
|
5824
5824
|
|
|
5825
|
+
_gotoSignalLabel(signal: any): any {
|
|
5826
|
+
const input = signal;
|
|
5827
|
+
if ((signal instanceof _FlowSignal)) {
|
|
5828
|
+
return (__ball_eq(signal.kind, 'goto') ? signal.label : null);
|
|
5829
|
+
}
|
|
5830
|
+
if ((typeof signal === 'string')) {
|
|
5831
|
+
return signal;
|
|
5832
|
+
}
|
|
5833
|
+
if (((typeof signal === 'object' && signal !== null && !Array.isArray(signal) && !(signal instanceof BallDouble) && !(signal instanceof Set)) && __ball_eq(__ball_index(signal, 'kind'), 'goto'))) {
|
|
5834
|
+
let l = __ball_index(signal, 'label');
|
|
5835
|
+
return ((typeof l === 'string') ? l : null);
|
|
5836
|
+
}
|
|
5837
|
+
}
|
|
5838
|
+
|
|
5825
5839
|
async _evalLabel(call: any, scope: any): Promise<any> {
|
|
5826
5840
|
let fields = this._lazyFields(call);
|
|
5827
5841
|
let label = this._stringFieldVal(fields, 'name');
|
|
@@ -5838,13 +5852,13 @@ export class BallEngine {
|
|
|
5838
5852
|
} catch (__ball_active_error) {
|
|
5839
5853
|
const e = __ball_active_error;
|
|
5840
5854
|
let signal = e;
|
|
5841
|
-
if (
|
|
5855
|
+
if (__ball_eq(this._gotoSignalLabel(signal), label)) {
|
|
5842
5856
|
repeat = true;
|
|
5843
5857
|
} else {
|
|
5844
5858
|
throw __ball_active_error;
|
|
5845
5859
|
}
|
|
5846
5860
|
}
|
|
5847
|
-
if ((
|
|
5861
|
+
if ((!repeat && __ball_eq(this._gotoSignalLabel(result), label))) {
|
|
5848
5862
|
repeat = true;
|
|
5849
5863
|
}
|
|
5850
5864
|
}
|
|
@@ -8320,7 +8334,8 @@ export class BallEngine {
|
|
|
8320
8334
|
}
|
|
8321
8335
|
if (__ball_eq(typeName, null)) {
|
|
8322
8336
|
let parts = [];
|
|
8323
|
-
|
|
8337
|
+
let rawMap = (((typeof v === 'object' && v !== null && !Array.isArray(v) && !(v instanceof BallDouble) && !(v instanceof Set)) && !(false /* BallMap is Map in TS */)) ? v : map);
|
|
8338
|
+
for (const e of rawMap.entries) {
|
|
8324
8339
|
let k = await this._ballToStringAsync(e.key);
|
|
8325
8340
|
let val = await this._ballToStringAsync(e.value);
|
|
8326
8341
|
parts = (parts.push(((__ball_to_string(k) + ': ') + __ball_to_string(val))), parts);
|
|
@@ -9044,7 +9059,7 @@ export class BallEngine {
|
|
|
9044
9059
|
}
|
|
9045
9060
|
let list = this._stdAsList(fields);
|
|
9046
9061
|
if (__ball_eq(list, null)) {
|
|
9047
|
-
return
|
|
9062
|
+
return {};
|
|
9048
9063
|
}
|
|
9049
9064
|
let result = {};
|
|
9050
9065
|
let positional = 1;
|
|
@@ -10005,7 +10020,7 @@ function _ballToDouble(value: any): any {
|
|
|
10005
10020
|
|
|
10006
10021
|
function _ballValueIsSet(v: any): any {
|
|
10007
10022
|
const input = v;
|
|
10008
|
-
return ((
|
|
10023
|
+
return ((typeof v === 'object' && v !== null && !Array.isArray(v) && !(v instanceof BallDouble) && !(v instanceof Set)) && (_kBallSetTag in v));
|
|
10009
10024
|
}
|
|
10010
10025
|
|
|
10011
10026
|
function _ballIsInt(v: any): any {
|