зеркало из https://github.com/mozilla/gecko-dev.git
Bug 910220 part 1. Add friend API for determinining whether we're in a strict-mode script. r=waldo
This commit is contained in:
Родитель
254256eac3
Коммит
8a00f89c89
|
@ -342,6 +342,14 @@ js::IsAtomsCompartment(JSCompartment *comp)
|
|||
return comp->runtimeFromAnyThread()->isAtomsCompartment(comp);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
js::IsInNonStrictPropertySet(JSContext *cx)
|
||||
{
|
||||
jsbytecode *pc;
|
||||
JSScript *script = cx->currentScript(&pc, JSContext::ALLOW_CROSS_COMPARTMENT);
|
||||
return script && !script->strict && (js_CodeSpec[*pc].format & JOF_SET);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
js::IsFunctionObject(JSObject *obj)
|
||||
{
|
||||
|
|
|
@ -266,6 +266,15 @@ IsAtomsCompartment(JSCompartment *comp);
|
|||
extern JS_FRIEND_API(bool)
|
||||
ReportIfUndeclaredVarAssignment(JSContext *cx, JS::HandleString propname);
|
||||
|
||||
/*
|
||||
* Returns whether we're in a non-strict property set (in that we're in a
|
||||
* non-strict script and the bytecode we're on is a property set). The return
|
||||
* value does NOT indicate any sort of exception was thrown: it's just a
|
||||
* boolean.
|
||||
*/
|
||||
extern JS_FRIEND_API(bool)
|
||||
IsInNonStrictPropertySet(JSContext *cx);
|
||||
|
||||
struct WeakMapTracer;
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче