зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1448880
- Part 3: AbstractFramePtr::isGeneratorFrame(). r=jimb
This proves handy in several places, later in the stack. Depends on D6983 Differential Revision: https://phabricator.services.mozilla.com/D6984 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9e12aa44ad
Коммит
f75cabc2b6
|
@ -809,9 +809,7 @@ Debugger::getFrame(JSContext* cx, const FrameIter& iter, MutableHandleDebuggerFr
|
|||
// was suspended, popping the stack frame, and later resumed.
|
||||
Rooted<GeneratorObject*> genObj(cx);
|
||||
GeneratorWeakMap::AddPtr gp;
|
||||
if (referent.isFunctionFrame() && (referent.callee()->isGenerator() ||
|
||||
referent.callee()->isAsync()))
|
||||
{
|
||||
if (referent.isGeneratorFrame()) {
|
||||
{
|
||||
AutoRealm ar(cx, referent.callee());
|
||||
genObj = GetGeneratorObjectForFrame(cx, referent);
|
||||
|
|
|
@ -20,7 +20,7 @@ using namespace js;
|
|||
JSObject*
|
||||
GeneratorObject::create(JSContext* cx, AbstractFramePtr frame)
|
||||
{
|
||||
MOZ_ASSERT(frame.script()->isGenerator() || frame.script()->isAsync());
|
||||
MOZ_ASSERT(frame.isGeneratorFrame());
|
||||
MOZ_ASSERT(frame.script()->nfixed() == 0);
|
||||
MOZ_ASSERT(!frame.isConstructing());
|
||||
|
||||
|
@ -115,8 +115,7 @@ GeneratorObject*
|
|||
js::GetGeneratorObjectForFrame(JSContext* cx, AbstractFramePtr frame)
|
||||
{
|
||||
cx->check(frame);
|
||||
MOZ_ASSERT(frame.isFunctionFrame() &&
|
||||
(frame.callee()->isGenerator() || frame.callee()->isAsync()));
|
||||
MOZ_ASSERT(frame.isGeneratorFrame());
|
||||
|
||||
// The ".generator" binding is always present and always "aliased".
|
||||
CallObject& callObj = frame.callObj();
|
||||
|
|
|
@ -786,6 +786,16 @@ AbstractFramePtr::isFunctionFrame() const
|
|||
return asRematerializedFrame()->isFunctionFrame();
|
||||
}
|
||||
|
||||
inline bool
|
||||
AbstractFramePtr::isGeneratorFrame() const
|
||||
{
|
||||
if (!isFunctionFrame()) {
|
||||
return false;
|
||||
}
|
||||
JSScript* s = script();
|
||||
return s->isGenerator() || s->isAsync();
|
||||
}
|
||||
|
||||
inline bool
|
||||
AbstractFramePtr::isNonStrictDirectEvalFrame() const
|
||||
{
|
||||
|
|
|
@ -247,6 +247,7 @@ class AbstractFramePtr
|
|||
inline bool debuggerNeedsCheckPrimitiveReturn() const;
|
||||
|
||||
inline bool isFunctionFrame() const;
|
||||
inline bool isGeneratorFrame() const;
|
||||
inline bool isNonStrictDirectEvalFrame() const;
|
||||
inline bool isStrictEvalFrame() const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче