Skip to content

Jurassic

Taritsyn edited this page Mar 7, 2024 · 11 revisions

JavaScriptEngineSwitcher.Jurassic contains a JurassicJsEngine adapter (wrapper for the Jurassic version of November 1, 2023).

Engine settings

You can specify a settings of JS engine during its registration:

engineSwitcher.EngineFactories
    .AddJurassic(new JurassicSettings
    {
        StrictMode = true
    })
    ;

If you manually create an instance of JS engine, then you can pass settings via the constructor:

IJsEngine engine = new JurassicJsEngine(
    new JurassicSettings
    {
        StrictMode = true
    }
);

Consider in detail properties of the JurassicSettings class:

Property name Data type Default value Description
EnableIlAnalysis Boolean false Flag for whether to disassemble any generated IL and store it in the associated function.
EnableHostCollectionsEmbeddingByValue Boolean false

Flag for whether to enable conversion of host collections, that are passed or returned to script code, to script arrays.

This property does not allow the embedding of host collections by using a EmbedHostObject method, it only affects the internal mechanisms of the Jurassic library.

StrictMode Boolean false Flag for whether to allow run the script in strict mode.

Known issues

Errors when accessing to the constants of embedded types.