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:
Boris Zbarsky 2015-03-11 22:33:58 -04:00
parent b7ae2e9516
commit d69ae85742
2 changed files with 10 additions and 5 deletions

View File

@ -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();
}

View File

@ -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 {