mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-13 15:39:22 +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;
|
||||
begin
|
||||
if not FGlobalNames.hasOwnProperty(aName) then
|
||||
exit(0);
|
||||
Result:=NativeInt(FGlobalNames[aName]);
|
||||
// this one is special, it needs to be re-registered every time
|
||||
if aName='InstanceMemory' then
|
||||
Exit(RegisterLocalObject(TJSUint8Array.New(getModuleMemoryDataView.buffer)));
|
||||
else
|
||||
begin
|
||||
if not FGlobalNames.hasOwnProperty(aName) then
|
||||
exit(0);
|
||||
Result:=NativeInt(FGlobalNames[aName]);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TJSObjectBridge.RegisterLocalObject(Obj: TJSObject): TJOBObjectID;
|
||||
|
Loading…
Reference in New Issue
Block a user