ScriptingCore中缓存的JSScript会在GC后被释放

ScriptingCore中使用filename_script缓存的JSScript会在GC后被释放,forceGC后再次执行同一js脚本会crash。

根据SpiderMonkey官方文档,编译后的JSScript需要使用绑定到一个JS_NewScriptObject()对象,但新版本jsapi.h中没有JS_NewScriptObject了?

The lifetime of the compiled script is tied to the lifetime of a JavaScript object, the garbage collector destroys the script when it is no longer reachable. The JSAPI provides this feature via the https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_NewScriptObject function.