From 63b76e46c10065c4aa2832920f2744b2b6d09d4c Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 19 Dec 2013 09:20:35 -0800 Subject: [PATCH] Bug 920322 - Support encoding/decoding singletons. r=luke --- js/src/jsscript.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index ebdfd541c8f..26fc582de61 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -414,7 +414,8 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc OwnSource, ExplicitUseStrict, SelfHosted, - IsCompileAndGo + IsCompileAndGo, + HasSingleton }; uint32_t length, lineno, nslots; @@ -510,7 +511,8 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc scriptBits |= (1 << IsStarGenerator); if (script->compileAndGo()) scriptBits |= (1 << IsCompileAndGo); - JS_ASSERT(!script->hasSingletons()); + if (script->hasSingletons()) + scriptBits |= (1 << HasSingleton); } if (!xdr->codeUint32(&prologLength)) @@ -619,6 +621,8 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc script->isGeneratorExp_ = true; if (scriptBits & (1 << IsCompileAndGo)) script->compileAndGo_ = true; + if (scriptBits & (1 << HasSingleton)) + script->hasSingletons_ = true; if (scriptBits & (1 << IsLegacyGenerator)) { JS_ASSERT(!(scriptBits & (1 << IsStarGenerator)));