mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 986304 - Augment JSAPI to give callers the option to not define named functions on the scope object. r=terrence
This commit is contained in:
parent
6e30090928
commit
483948e0a1
@ -4622,7 +4622,7 @@ JS::CompileFunction(JSContext *cx, HandleObject obj, const ReadOnlyCompileOption
|
||||
if (!frontend::CompileFunctionBody(cx, &fun, options, formals, chars, length))
|
||||
return nullptr;
|
||||
|
||||
if (obj && funAtom) {
|
||||
if (obj && funAtom && options.defineOnScope) {
|
||||
Rooted<jsid> id(cx, AtomToId(funAtom));
|
||||
RootedValue value(cx, ObjectValue(*fun));
|
||||
if (!JSObject::defineGeneric(cx, obj, id, value, nullptr, nullptr, JSPROP_ENUMERATE))
|
||||
|
@ -3377,6 +3377,7 @@ class JS_FRIEND_API(ReadOnlyCompileOptions)
|
||||
column(0),
|
||||
compileAndGo(false),
|
||||
forEval(false),
|
||||
defineOnScope(true),
|
||||
noScriptRval(false),
|
||||
selfHostingMode(false),
|
||||
canLazilyParse(true),
|
||||
@ -3416,6 +3417,7 @@ class JS_FRIEND_API(ReadOnlyCompileOptions)
|
||||
unsigned column;
|
||||
bool compileAndGo;
|
||||
bool forEval;
|
||||
bool defineOnScope;
|
||||
bool noScriptRval;
|
||||
bool selfHostingMode;
|
||||
bool canLazilyParse;
|
||||
@ -3517,6 +3519,7 @@ class JS_FRIEND_API(OwningCompileOptions) : public ReadOnlyCompileOptions
|
||||
OwningCompileOptions &setColumn(unsigned c) { column = c; return *this; }
|
||||
OwningCompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }
|
||||
OwningCompileOptions &setForEval(bool eval) { forEval = eval; return *this; }
|
||||
OwningCompileOptions &setDefineOnScope(bool define) { defineOnScope = define; return *this; }
|
||||
OwningCompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
|
||||
OwningCompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
|
||||
OwningCompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }
|
||||
@ -3602,6 +3605,7 @@ class MOZ_STACK_CLASS JS_FRIEND_API(CompileOptions) : public ReadOnlyCompileOpti
|
||||
CompileOptions &setColumn(unsigned c) { column = c; return *this; }
|
||||
CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }
|
||||
CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }
|
||||
CompileOptions &setDefineOnScope(bool define) { defineOnScope = define; return *this; }
|
||||
CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
|
||||
CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
|
||||
CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }
|
||||
|
Loading…
Reference in New Issue
Block a user