Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

JS.Release

Frees the JavaScript engine.

Component Version macOS Windows Linux Server iOS SDK
JavaScript 10.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JS.Release"; JSRef )   More

(old name: JS.Free)

Parameters

Parameter Description Example
JSRef The JavaScript reference number. $js

Result

Returns OK or error.

Description

Frees the JavaScript engine.

Examples

Evaluate some expressions:

Set Variable [ $js ; Value: MBS( "JS.New" ) ]
Set Variable [ $r ; Value: MBS( "JS.Evaluate"; $js; "4+5") ]
Show Custom Dialog [ "Result" ; $r ]
Set Variable [ $r ; Value: MBS( "JS.SetGlobalProperty"; $JS; "test"; "\"Hello World\"" ) ]
Set Variable [ $r ; Value: MBS( "JS.Evaluate"; $js; "test + test;") ]
Show Custom Dialog [ "Result" ; $r ]
Set Variable [ $r ; Value: MBS( "JS.Release"; $JS ) ]

Cleanup script:

If [ Length($$js) > 0 ]
    Set Variable [ $r ; Value: MBS( "JS.Release"; $$js ) ]
    Set Variable [ $$js ; Value: "" ]
End If

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 7th December 2019, last changed 29th October 2020


JS.ObjectCount - JS.ReleaseAll