Bug 829798 - Add dummy PreserveWrapper to JS shell. r=billm

This commit is contained in:
Andrew McCreight 2013-01-15 10:14:12 -08:00
parent 92dae8e55e
commit eadd687c13
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1 @@
(new WeakMap).set(FakeDOMObject.prototype, this)

View File

@ -5219,6 +5219,13 @@ JSSecurityCallbacks securityCallbacks = {
NULL
};
/* Pretend we can always preserve wrappers for dummy DOM objects. */
static bool
DummyPreserveWrapperCallback(JSContext *cx, JSObject *obj)
{
return true;
}
int
main(int argc, char **argv, char **envp)
{
@ -5382,6 +5389,8 @@ main(int argc, char **argv, char **envp)
JS_SetGCParameter(rt, JSGC_MODE, JSGC_MODE_INCREMENTAL);
JS_SetGCParameterForThread(cx, JSGC_MAX_CODE_CACHE_BYTES, 16 * 1024 * 1024);
js::SetPreserveWrapperCallback(rt, DummyPreserveWrapperCallback);
/* Must be done before creating the global object */
if (op.getBoolOption('D'))
JS_ToggleOptions(cx, JSOPTION_PCCOUNT);