diff --git a/runtime/pointers.ts b/runtime/pointers.ts index 69aceca8..ea0633ec 100644 --- a/runtime/pointers.ts +++ b/runtime/pointers.ts @@ -1497,7 +1497,7 @@ export class Pointer extends Ref { // else if (!allow_failure) displayFatalError('pointer-not-found'); pointer.delete(); - throw new PointerError("Pointer $"+id_string+" has no assigned value", SCOPE); + throw new PointerError("Pointer $"+id_string+" does not exist", SCOPE); } } diff --git a/runtime/runtime.ts b/runtime/runtime.ts index 9fc00b39..fda166ec 100644 --- a/runtime/runtime.ts +++ b/runtime/runtime.ts @@ -1806,6 +1806,10 @@ export class Runtime { * @param header DXB header of incoming message */ private static updateEndpointOnlineState(header: dxb_header) { + if (!header) { + logger.error("updateEndpointOnlineState: no header provided"); + return; + } if (header.sender) { // received signed GOODBYE message -> endpoint is offline if (header.type == ProtocolDataType.GOODBYE) { diff --git a/types/function-utils.ts b/types/function-utils.ts index 6e61a8f7..ab888f49 100644 --- a/types/function-utils.ts +++ b/types/function-utils.ts @@ -204,8 +204,8 @@ export function createFunctionWithDependencyInjections(source: string, dependenc } export class ExtensibleFunction { - constructor(f:globalThis.Function) { - return Object.setPrototypeOf(f, new.target.prototype); + constructor(f?:globalThis.Function) { + if (f) return Object.setPrototypeOf(f, new.target.prototype); } } diff --git a/types/type.ts b/types/type.ts index e478592b..c03b547f 100644 --- a/types/type.ts +++ b/types/type.ts @@ -367,7 +367,7 @@ export class Type extends ExtensibleFunction { // never call the constructor directly!! should be private constructor(namespace?:string, name?:string, variation?:string, parameters?:any[]) { - super((val:any) => this.cast(val)) + super(namespace && namespace != "std" ? (val:any) => this.cast(val) : undefined) if (name) this.name = name; if (namespace) this.namespace = namespace; if (variation) this.variation = variation; @@ -1081,15 +1081,15 @@ Type.std.Assertion.setJSInterface({ }) -Type.std.StorageMap.setJSInterface({ - class: StorageMap, +Type.std.StorageWeakMap.setJSInterface({ + class: StorageWeakMap, is_normal_object: true, proxify_children: true, visible_children: new Set(), }) -Type.std.StorageWeakMap.setJSInterface({ - class: StorageWeakMap, +Type.std.StorageMap.setJSInterface({ + class: StorageMap, is_normal_object: true, proxify_children: true, visible_children: new Set(),