@ball-lang/engine 1.68.1 → 1.68.3
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
|
@@ -3400,6 +3400,17 @@ export class BallEngine {
|
|
|
3400
3400
|
})();
|
|
3401
3401
|
return this._unwrapFuture(await this._callFunction(modPart2, staticFunc, staticInput));
|
|
3402
3402
|
}
|
|
3403
|
+
if (__ball_eq(call.function, 'new')) {
|
|
3404
|
+
let ctorFields = _ballUserMap();
|
|
3405
|
+
for (const e of inputMap.entries) {
|
|
3406
|
+
if (__ball_eq(e.key, 'self')) {
|
|
3407
|
+
continue;
|
|
3408
|
+
}
|
|
3409
|
+
ctorFields[e.key] = e.value;
|
|
3410
|
+
}
|
|
3411
|
+
ctorFields['__type__'] = qualifiedName;
|
|
3412
|
+
return ctorFields.cast();
|
|
3413
|
+
}
|
|
3403
3414
|
}
|
|
3404
3415
|
let typeName = __ball_index(selfMap, '__type__');
|
|
3405
3416
|
if (((!__ball_eq(typeName, null) && !__ball_eq(typeName, '__builtin_class__')) && !__ball_eq(typeName, '__class__'))) {
|
|
@@ -3769,6 +3780,9 @@ export class BallEngine {
|
|
|
3769
3780
|
if ((typeExists && (hasCtor || hasStaticMethods))) {
|
|
3770
3781
|
return { ['__class_ref__']: name, ['__type__']: '__class__' };
|
|
3771
3782
|
}
|
|
3783
|
+
if (_builtinExceptionNames.includes(name)) {
|
|
3784
|
+
return { ['__class_ref__']: name, ['__type__']: '__class__' };
|
|
3785
|
+
}
|
|
3772
3786
|
}
|
|
3773
3787
|
let getterKey = ((__ball_to_string(this._currentModule) + '.') + __ball_to_string(name));
|
|
3774
3788
|
let getterFunc = __ball_index(this._functions, getterKey);
|
|
@@ -10406,6 +10420,7 @@ export class StdModuleHandler extends BallModuleHandler {
|
|
|
10406
10420
|
let _kBallSetTag = (() => { return '__ball_set__'; })();
|
|
10407
10421
|
let _sentinel = (() => { return { '__type': 'main:Object' }; })();
|
|
10408
10422
|
let _builtinTypeNames = (() => { return new Set(['int', 'double', 'num', 'String', 'bool', 'List', 'Map', 'Set', 'Null', 'void', 'Object', 'dynamic', 'Function', 'Future', 'Stream', 'Iterable', 'Iterator', 'Type', 'Symbol', 'Never']); })();
|
|
10423
|
+
let _builtinExceptionNames = (() => { return new Set(['Exception', 'Error', 'FormatException', 'RangeError', 'ArgumentError', 'StateError', 'UnsupportedError', 'UnimplementedError', 'TypeError', 'NoSuchMethodError', 'OutOfMemoryError', 'StackOverflowError', 'IntegerDivisionByZeroException', 'ConcurrentModificationError', 'IndexError', 'IOException', 'FileSystemException', 'HttpException', 'SocketException']); })();
|
|
10409
10424
|
let _ballPointerBytes = (() => { return 8; })();
|
|
10410
10425
|
let _ballStringCodeUnitBytes = (() => { return 2; })();
|
|
10411
10426
|
let _ballMapEntryBytes = (() => { return __ball_mul(_ballPointerBytes, 2); })();
|