Template:jsapi script lifetime

by 3 contributors:
<%
var lang = env.locale;
var url = "/" + lang + "/docs/SpiderMonkey/JSAPI_User_Guide"
var text = "This API is subject to " + template("Bug", ["438633"]) + ", which can cause crashes in almost any " +
           "program that uses <code>JS_DestroyScript()</code>. The workaround is to use " +
           "<code>JS_NewScriptObject()</code> to root each newly-compiled script, as described in the " +
           "JSAPI User Guide under <a href='" + url + "#Compiled_scripts'>Compiled scripts</a>.";


%><p>The application is responsible for ensuring that the new compiled script is cleaned up later—either by 
calling <code><a title="JS_DestroyScript()" href="/en-US/docs/JS_DestroyScript">JS_DestroyScript()</a></code> 
directly or by calling <code><a title="JS_NewScriptObject()" href="/en-US/docs/JS_NewScriptObject">JS_NewScriptObject()</a></code>, 
in which case the garbage collector cleans up the script.</p>
<%-template("Warning", [text])%>
Search for pages that use Template:jsapi script lifetime to see example use cases and how many pages use this macro.

Document Tags and Contributors

Tags: 
Contributors to this page: ethertank, Sheppy, Jorend
Last updated by: ethertank,