mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 959695 part 2. Make ReportIfNotFunction take a Handle. r=terrence
This commit is contained in:
parent
a885f722f2
commit
cefeb1bc02
@ -228,7 +228,8 @@ JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *for
|
||||
}
|
||||
if (sp == argv + argc) {
|
||||
if (required) {
|
||||
if (JSFunction *fun = ReportIfNotFunction(cx, argv[-2])) {
|
||||
HandleValue callee = HandleValue::fromMarkedLocation(&argv[-2]);
|
||||
if (JSFunction *fun = ReportIfNotFunction(cx, callee)) {
|
||||
char numBuf[12];
|
||||
JS_snprintf(numBuf, sizeof numBuf, "%u", argc);
|
||||
JSAutoByteString funNameBytes;
|
||||
@ -298,7 +299,7 @@ JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *for
|
||||
*va_arg(ap, JSObject **) = obj;
|
||||
break;
|
||||
case 'f':
|
||||
obj = ReportIfNotFunction(cx, *sp);
|
||||
obj = ReportIfNotFunction(cx, HandleValue::fromMarkedLocation(sp));
|
||||
if (!obj)
|
||||
return false;
|
||||
*sp = OBJECT_TO_JSVAL(obj);
|
||||
|
@ -637,7 +637,7 @@ UrshOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *out)
|
||||
#undef RELATIONAL_OP
|
||||
|
||||
inline JSFunction *
|
||||
ReportIfNotFunction(JSContext *cx, const Value &v, MaybeConstruct construct = NO_CONSTRUCT)
|
||||
ReportIfNotFunction(JSContext *cx, HandleValue v, MaybeConstruct construct = NO_CONSTRUCT)
|
||||
{
|
||||
if (v.isObject() && v.toObject().is<JSFunction>())
|
||||
return &v.toObject().as<JSFunction>();
|
||||
|
Loading…
Reference in New Issue
Block a user