mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1140586 part 1. Add some asserts about us not caring too much about the parents of native functions. r=waldo
This commit is contained in:
parent
b7ae2e9516
commit
d69ae85742
@ -568,6 +568,8 @@ inline bool
|
||||
IsInternalFunctionObject(JSObject *funobj)
|
||||
{
|
||||
JSFunction *fun = &funobj->as<JSFunction>();
|
||||
MOZ_ASSERT_IF(fun->isLambda(),
|
||||
fun->isInterpreted() || fun->isAsmJSNative());
|
||||
return fun->isLambda() && !funobj->getParent();
|
||||
}
|
||||
|
||||
|
@ -1034,11 +1034,14 @@ JSObject::is<js::StaticBlockObject>() const
|
||||
inline JSObject *
|
||||
JSObject::enclosingScope()
|
||||
{
|
||||
return is<js::ScopeObject>()
|
||||
? &as<js::ScopeObject>().enclosingScope()
|
||||
: is<js::DebugScopeObject>()
|
||||
? &as<js::DebugScopeObject>().enclosingScope()
|
||||
: getParent();
|
||||
if (is<js::ScopeObject>())
|
||||
return &as<js::ScopeObject>().enclosingScope();
|
||||
|
||||
if (is<js::DebugScopeObject>())
|
||||
return &as<js::DebugScopeObject>().enclosingScope();
|
||||
|
||||
MOZ_ASSERT_IF(is<JSFunction>(), as<JSFunction>().isInterpreted());
|
||||
return getParent();
|
||||
}
|
||||
|
||||
namespace js {
|
||||
|
Loading…
Reference in New Issue
Block a user