Bug 936710 - Add an option to propagate flags to the nested shells. r=luke

This commit is contained in:
Benjamin Bouvier 2013-11-11 21:21:32 +01:00
parent c4794bebcf
commit 97f56301da

View File

@ -3598,6 +3598,14 @@ EscapeForShell(AutoCStringVector &argv)
}
#endif
Vector<const char*, 4, js::SystemAllocPolicy> sPropagatedFlags;
static bool
PropagateFlagToNestedShells(const char *flag)
{
return sPropagatedFlags.append(flag);
}
static bool
NestedShell(JSContext *cx, unsigned argc, jsval *vp)
{
@ -3614,6 +3622,13 @@ NestedShell(JSContext *cx, unsigned argc, jsval *vp)
if (!argv.append(strdup(sArgv[0])))
return false;
// Propagate selected flags from the current shell
for (unsigned i = 0; i < sPropagatedFlags.length(); i++) {
char *cstr = strdup(sPropagatedFlags[i]);
if (!cstr || !argv.append(cstr))
return false;
}
// The arguments to nestedShell are stringified and append to argv.
RootedString str(cx);
for (unsigned i = 0; i < args.length(); i++) {