mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 06:07:30 +09:00
1320408 - Part 13: Change DebugEnvironmentProxy::getMaybeSentinelValue to static method.
This commit is contained in:
parent
68b04671cb
commit
b237ae6437
4 changed files with 10 additions and 7 deletions
|
|
@ -2198,7 +2198,8 @@ js::LookupNameUnqualified(JSContext* cx, HandlePropertyName name, HandleObject e
|
||||||
// environments.
|
// environments.
|
||||||
if (env->is<DebugEnvironmentProxy>()) {
|
if (env->is<DebugEnvironmentProxy>()) {
|
||||||
RootedValue v(cx);
|
RootedValue v(cx);
|
||||||
if (!env->as<DebugEnvironmentProxy>().getMaybeSentinelValue(cx, id, &v))
|
Rooted<DebugEnvironmentProxy*> envProxy(cx, &env->as<DebugEnvironmentProxy>());
|
||||||
|
if (!DebugEnvironmentProxy::getMaybeSentinelValue(cx, envProxy, id, &v))
|
||||||
return false;
|
return false;
|
||||||
isTDZ = IsUninitializedLexical(v);
|
isTDZ = IsUninitializedLexical(v);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -10774,7 +10774,8 @@ DebuggerEnvironment::getVariable(JSContext* cx, HandleDebuggerEnvironment enviro
|
||||||
//
|
//
|
||||||
// See wrapDebuggeeValue for how the sentinel values are wrapped.
|
// See wrapDebuggeeValue for how the sentinel values are wrapped.
|
||||||
if (referent->is<DebugEnvironmentProxy>()) {
|
if (referent->is<DebugEnvironmentProxy>()) {
|
||||||
if (!referent->as<DebugEnvironmentProxy>().getMaybeSentinelValue(cx, id, result))
|
Rooted<DebugEnvironmentProxy*> env(cx, &referent->as<DebugEnvironmentProxy>());
|
||||||
|
if (!DebugEnvironmentProxy::getMaybeSentinelValue(cx, env, id, result))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!GetProperty(cx, referent, referent, id, result))
|
if (!GetProperty(cx, referent, referent, id, result))
|
||||||
|
|
|
||||||
|
|
@ -2234,11 +2234,11 @@ DebugEnvironmentProxy::isForDeclarative() const
|
||||||
e.is<LexicalEnvironmentObject>();
|
e.is<LexicalEnvironmentObject>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
DebugEnvironmentProxy::getMaybeSentinelValue(JSContext* cx, HandleId id, MutableHandleValue vp)
|
DebugEnvironmentProxy::getMaybeSentinelValue(JSContext* cx, Handle<DebugEnvironmentProxy*> env,
|
||||||
|
HandleId id, MutableHandleValue vp)
|
||||||
{
|
{
|
||||||
Rooted<DebugEnvironmentProxy*> self(cx, this);
|
return DebugEnvironmentProxyHandler::singleton.getMaybeSentinelValue(cx, env, id, vp);
|
||||||
return DebugEnvironmentProxyHandler::singleton.getMaybeSentinelValue(cx, self, id, vp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,8 @@ class DebugEnvironmentProxy : public ProxyObject
|
||||||
|
|
||||||
// Get a property by 'id', but returns sentinel values instead of throwing
|
// Get a property by 'id', but returns sentinel values instead of throwing
|
||||||
// on exceptional cases.
|
// on exceptional cases.
|
||||||
bool getMaybeSentinelValue(JSContext* cx, HandleId id, MutableHandleValue vp);
|
static bool getMaybeSentinelValue(JSContext* cx, Handle<DebugEnvironmentProxy*> env,
|
||||||
|
HandleId id, MutableHandleValue vp);
|
||||||
|
|
||||||
// Returns true iff this is a function environment with its own this-binding
|
// Returns true iff this is a function environment with its own this-binding
|
||||||
// (all functions except arrow functions and generator expression lambdas).
|
// (all functions except arrow functions and generator expression lambdas).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue