mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-18 16:49:05 +02:00
* Allow to access webassembly memory as Uint8Array
This commit is contained in:
parent
b7553d1abf
commit
13742a5375
@ -268,9 +268,15 @@ end;
|
|||||||
|
|
||||||
function TJSObjectBridge.FindGlobalObject(const aName: string): TJOBObjectID;
|
function TJSObjectBridge.FindGlobalObject(const aName: string): TJOBObjectID;
|
||||||
begin
|
begin
|
||||||
if not FGlobalNames.hasOwnProperty(aName) then
|
// this one is special, it needs to be re-registered every time
|
||||||
exit(0);
|
if aName='InstanceMemory' then
|
||||||
Result:=NativeInt(FGlobalNames[aName]);
|
Exit(RegisterLocalObject(TJSUint8Array.New(getModuleMemoryDataView.buffer)));
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if not FGlobalNames.hasOwnProperty(aName) then
|
||||||
|
exit(0);
|
||||||
|
Result:=NativeInt(FGlobalNames[aName]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TJSObjectBridge.RegisterLocalObject(Obj: TJSObject): TJOBObjectID;
|
function TJSObjectBridge.RegisterLocalObject(Obj: TJSObject): TJOBObjectID;
|
||||||
|
Loading…
Reference in New Issue
Block a user