mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1257223 - Fix os.file.redirect(null), r=jonco
--HG-- extra : rebase_source : 47f402c85b7df994db56d69559dfcb528e7b95d4 extra : amend_source : bea76dd9db5c5f48f59819daf2184bafd303b492
This commit is contained in:
parent
e6b62e1073
commit
07ed9e0dde
@ -447,7 +447,8 @@ static bool
|
||||
Redirect(JSContext* cx, const CallArgs& args, RCFile** outFile)
|
||||
{
|
||||
if (args.length() > 1) {
|
||||
JS_ReportErrorNumber(cx, js::shell::my_GetErrorMessage, nullptr, JSSMSG_INVALID_ARGS, "redirect");
|
||||
JS_ReportErrorNumber(cx, js::shell::my_GetErrorMessage, nullptr,
|
||||
JSSMSG_INVALID_ARGS, "redirect");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -478,9 +479,12 @@ Redirect(JSContext* cx, const CallArgs& args, RCFile** outFile)
|
||||
}
|
||||
}
|
||||
|
||||
RootedString filename(cx, JS::ToString(cx, args[0]));
|
||||
if (!filename)
|
||||
return false;
|
||||
RootedString filename(cx);
|
||||
if (!args[0].isNull()) {
|
||||
filename = JS::ToString(cx, args[0]);
|
||||
if (!filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!redirect(cx, filename, outFile))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user