Bug 1467022 - Add comment about the script field to JSFunction::hasScript, and refer JSFunction::hasUncompletedScript. r=jandem DONTBUILD, comment-only

This commit is contained in:
Tooru Fujisawa 2018-07-27 12:46:13 +09:00
parent 0d90f33cca
commit 13ebe80af7

View file

@ -262,6 +262,14 @@ class JSFunction : public js::NativeObject
}
bool isLambda() const { return flags() & LAMBDA; }
bool isInterpretedLazy() const { return flags() & INTERPRETED_LAZY; }
// This method doesn't check the non-nullness of u.scripted.s.script_,
// because it's guaranteed to be non-null when this has INTERPRETED flag,
// for live JSFunctions.
//
// When this JSFunction instance is reached via GC iteration, the above
// doesn't hold, and hasUncompletedScript should also be checked.
// (see the comment above hasUncompletedScript for more details).
bool hasScript() const { return flags() & INTERPRETED; }
bool infallibleIsDefaultClassConstructor(JSContext* cx) const;