summaryrefslogtreecommitdiffstats
path: root/js/src/vm
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 21:33:39 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:25 -0400
commit7757e03ccc550b030fb4d342f160ee30a940f23d (patch)
treec5e2ddf55e4dc2cc82ff578cecbac939545558dd /js/src/vm
parentfcfaa4fbee917f821806a70b2000a91a97948c11 (diff)
downloadUXP-7757e03ccc550b030fb4d342f160ee30a940f23d.tar
UXP-7757e03ccc550b030fb4d342f160ee30a940f23d.tar.gz
UXP-7757e03ccc550b030fb4d342f160ee30a940f23d.tar.lz
UXP-7757e03ccc550b030fb4d342f160ee30a940f23d.tar.xz
UXP-7757e03ccc550b030fb4d342f160ee30a940f23d.zip
1320408 - Part 13: Change DebugEnvironmentProxy::getMaybeSentinelValue to static method.
Diffstat (limited to 'js/src/vm')
-rw-r--r--js/src/vm/Debugger.cpp3
-rw-r--r--js/src/vm/EnvironmentObject.cpp8
-rw-r--r--js/src/vm/EnvironmentObject.h3
3 files changed, 8 insertions, 6 deletions
diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
index a4f1f3032..b959740ac 100644
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -10774,7 +10774,8 @@ DebuggerEnvironment::getVariable(JSContext* cx, HandleDebuggerEnvironment enviro
//
// See wrapDebuggeeValue for how the sentinel values are wrapped.
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;
} else {
if (!GetProperty(cx, referent, referent, id, result))
diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp
index 611f0e194..a5aac2ab4 100644
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -2234,11 +2234,11 @@ DebugEnvironmentProxy::isForDeclarative() const
e.is<LexicalEnvironmentObject>();
}
-bool
-DebugEnvironmentProxy::getMaybeSentinelValue(JSContext* cx, HandleId id, MutableHandleValue vp)
+/* static */ bool
+DebugEnvironmentProxy::getMaybeSentinelValue(JSContext* cx, Handle<DebugEnvironmentProxy*> env,
+ HandleId id, MutableHandleValue vp)
{
- Rooted<DebugEnvironmentProxy*> self(cx, this);
- return DebugEnvironmentProxyHandler::singleton.getMaybeSentinelValue(cx, self, id, vp);
+ return DebugEnvironmentProxyHandler::singleton.getMaybeSentinelValue(cx, env, id, vp);
}
bool
diff --git a/js/src/vm/EnvironmentObject.h b/js/src/vm/EnvironmentObject.h
index 032286116..c527cd1b0 100644
--- a/js/src/vm/EnvironmentObject.h
+++ b/js/src/vm/EnvironmentObject.h
@@ -872,7 +872,8 @@ class DebugEnvironmentProxy : public ProxyObject
// Get a property by 'id', but returns sentinel values instead of throwing
// 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
// (all functions except arrow functions and generator expression lambdas).