Closed PascalBergeron1993 closed 1 year ago
Thank you for taking the time! This is clearly a bug in both HostSample and NodeSample. WasmSample already seems to be fixed. I would simply fix them as in WasmSample, for consistency. I appreciate your help.
Actually I prefer your fix, it's clearer. 👍 Thanks!
If I were to test the code further and create a PR, would you accept it and merge it with the master branch?
Yes.
Say we run the following script in the HostSample project:
Such a script will run fine on Windows (i386-win32). However, it will fail on Windows (x86_64) with the following error:
[EAccessViolation] Access violation at address 00007FFBE7308B30 in module 'chakracore.dll'. Read of address 0000000000000010
This issue was observed on Delphi 10.1 Berlin. It seems like this issue happens in the
PostTimedTask
method because theFuncArgs
variable is declared as anarray[0..0] of JsValueRef
instead of anarray of JsValueRef
. I was able to fix the issue by changing thePostTimedTask
method like so:I see that the
PostTimedTask
method may need to be fixed in the other sample projects.My fix would also need to be tested on the FreePascal compiler and on the Linux and Darwin platforms.
Let me know your thoughts and if you are open to me making further tests and creating a PR.