mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 936710 - Add an option to propagate flags to the nested shells. r=luke
This commit is contained in:
parent
c4794bebcf
commit
97f56301da
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user