From 6110e0823df1bdf4a8d088769209f8e23d02f4de Mon Sep 17 00:00:00 2001 From: David Mandelin Date: Mon, 29 Nov 2010 13:33:17 -0800 Subject: [PATCH] Bug 610480 last part: fix MSVC warnings, r=jorendorff --- js/src/jsscript.cpp | 9 ++++++--- js/src/jsscript.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 230ab56ef2a..ceb680f97a6 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -910,7 +910,7 @@ JSScript * JSScript::NewScript(JSContext *cx, uint32 length, uint32 nsrcnotes, uint32 natoms, uint32 nobjects, uint32 nupvars, uint32 nregexps, uint32 ntrynotes, uint32 nconsts, uint32 nglobals, - uint32 nClosedArgs, uint32 nClosedVars) + uint16 nClosedArgs, uint16 nClosedVars) { size_t size, vectorSize; JSScript *script; @@ -1160,12 +1160,15 @@ JSScript::NewScriptFromCG(JSContext *cx, JSCodeGenerator *cg) skip_empty: CG_COUNT_FINAL_SRCNOTES(cg, nsrcnotes); + uint16 nClosedArgs = uint16(cg->closedArgs.length()); + JS_ASSERT(nClosedArgs == cg->closedArgs.length()); + uint16 nClosedVars = uint16(cg->closedVars.length()); + JS_ASSERT(nClosedVars == cg->closedVars.length()); script = NewScript(cx, prologLength + mainLength, nsrcnotes, cg->atomList.count, cg->objectList.length, cg->upvarList.count, cg->regexpList.length, cg->ntrynotes, cg->constList.length(), - cg->globalUses.length(), cg->closedArgs.length(), - cg->closedVars.length()); + cg->globalUses.length(), nClosedArgs, nClosedVars); if (!script) return NULL; diff --git a/js/src/jsscript.h b/js/src/jsscript.h index e080a3cf715..d4d6d11e17f 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -208,7 +208,7 @@ struct JSScript { static JSScript *NewScript(JSContext *cx, uint32 length, uint32 nsrcnotes, uint32 natoms, uint32 nobjects, uint32 nupvars, uint32 nregexps, uint32 ntrynotes, uint32 nconsts, uint32 nglobals, - uint32 nClosedArgs, uint32 nClosedVars); + uint16 nClosedArgs, uint16 nClosedVars); static JSScript *NewScriptFromCG(JSContext *cx, JSCodeGenerator *cg);