Bug 1232022, 1232449 - Address forgotten review nits and fix bogus error message. (rs=Waldo)

This commit is contained in:
Eric Faust 2015-12-16 19:57:42 -08:00
parent 0a71155832
commit a35ab5d15e
2 changed files with 9 additions and 6 deletions

View File

@ -7082,14 +7082,16 @@ BytecodeEmitter::emitSelfHostedCallFunction(ParseNode* pn)
//
// argc is set to the amount of actually emitted args and the
// emitting of args below is disabled by setting emitArgs to false.
ParseNode* pn2 = pn->pn_head;
const char* errorName = pn2->name() == cx->names().callFunction ?
"callFunction" : "callContentFunction";
if (pn->pn_count < 3) {
reportError(pn, JSMSG_MORE_ARGS_NEEDED, "callFunction", "1", "s");
reportError(pn, JSMSG_MORE_ARGS_NEEDED, errorName, "2", "s");
return false;
}
ParseNode* pn2 = pn->pn_head;
if (pn->getOp() != JSOP_CALL) {
reportError(pn, JSMSG_NOT_CONSTRUCTOR, pn2->name());
reportError(pn, JSMSG_NOT_CONSTRUCTOR, errorName);
return false;
}
@ -7200,8 +7202,9 @@ BytecodeEmitter::emitCallOrNew(ParseNode* pn)
// We shouldn't see foo(bar) = x in self-hosted code.
MOZ_ASSERT(!(pn->pn_xflags & PNX_SETCALL));
// Calls to "forceInterpreter", "callFunction" or "resumeGenerator"
// in self-hosted code generate inline bytecode.
// Calls to "forceInterpreter", "callFunction",
// "callContentFunction", or "resumeGenerator" in self-hosted
// code generate inline bytecode.
if (pn2->name() == cx->names().callFunction ||
pn2->name() == cx->names().callContentFunction)
{

View File

@ -179,7 +179,7 @@ bool
js::Debug_CheckSelfHosted(JSContext* cx, HandleValue fun)
{
#ifndef DEBUG
MOZ_CRASH("Self hosted checks should only be done in Debug builds");
MOZ_CRASH("self-hosted checks should only be done in Debug builds");
#endif
MOZ_ASSERT(fun.isObject());