-1

I currently use an old version of the delphi-javascript library in my applications which interfaces js32.dll. But I bumped into an annoying bug. So I wonder if it is hard to update the source of the delphi-javascript spidermonkey library to the latest version of the mozilla's spidermonkey javascript engine. Has the interface changed much since the code on https://code.google.com/archive/p/delphi-javascript/source/default/source. I found some documentation on https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey but I don't know how to start.

Roy Damman
  • 11
  • 1
  • Which bug? You can also consider using a different implementation, see https://forum.lazarus.freepascal.org/index.php?topic=42272.0 – AmigoJack Sep 24 '20 at 09:12
  • The problem is that the used Spidermonkey implementation seems problematic to handle an escaped '/' character (as '\/') when using the function JSON.parse. I use the library in several projects, so I want to prevent switching to another library. I would like it anyway if I could use a more recent version of the library. I also don't understand why i got a downvote for my question: Is my question without research effort, unclear and not useful? – Roy Damman Sep 24 '20 at 09:43

1 Answers1

0

You may try https://github.com/synopse/mORMot/tree/master/SyNode which interfaces SpiderMonkey52 and includes the compiled dll libraries.

An updated version to access latest SpiderMonkey is available in the https://github.com/synopse/mORMot/tree/feature/synodeCleanup branch of mORMot. But it is for FPC only currently.

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
  • Yes, there is a description in that project with steps to create a recent DLL. You have to convert the Mozilla JSAPI.H from C++ to C exports before you compile the Spidermonkey DLL, so you can use it in Delphi. After that, you have to alter the current Pascal file that's importing the DLL to match the new version. – Roy Damman Sep 25 '20 at 08:47