| Index: runtime/vm/object.h
|
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h
|
| index 90a70005d924b9fce8a3f209072ad3392a980267..12a3f60bd897d16aed00a1ca4014ea31ae0129c9 100644
|
| --- a/runtime/vm/object.h
|
| +++ b/runtime/vm/object.h
|
| @@ -2473,6 +2473,7 @@ class Function : public Object {
|
| case RawFunction::kInvokeFieldDispatcher:
|
| return true;
|
| case RawFunction::kClosureFunction:
|
| + case RawFunction::kImplicitClosureFunction:
|
| case RawFunction::kSignatureFunction:
|
| case RawFunction::kConstructor:
|
| case RawFunction::kImplicitStaticFinalGetter:
|
| @@ -2497,6 +2498,7 @@ class Function : public Object {
|
| case RawFunction::kIrregexpFunction:
|
| return true;
|
| case RawFunction::kClosureFunction:
|
| + case RawFunction::kImplicitClosureFunction:
|
| case RawFunction::kSignatureFunction:
|
| case RawFunction::kConstructor:
|
| case RawFunction::kMethodExtractor:
|
| @@ -2773,7 +2775,9 @@ class Function : public Object {
|
| // Returns true if this function represents a (possibly implicit) closure
|
| // function.
|
| bool IsClosureFunction() const {
|
| - return kind() == RawFunction::kClosureFunction;
|
| + RawFunction::Kind k = kind();
|
| + return (k == RawFunction::kClosureFunction) ||
|
| + (k == RawFunction::kImplicitClosureFunction);
|
| }
|
|
|
| // Returns true if this function represents a generated irregexp function.
|
| @@ -2782,7 +2786,9 @@ class Function : public Object {
|
| }
|
|
|
| // Returns true if this function represents an implicit closure function.
|
| - bool IsImplicitClosureFunction() const;
|
| + bool IsImplicitClosureFunction() const {
|
| + return kind() == RawFunction::kImplicitClosureFunction;
|
| + }
|
|
|
| // Returns true if this function represents a converted closure function.
|
| bool IsConvertedClosureFunction() const {
|
| @@ -2797,14 +2803,14 @@ class Function : public Object {
|
| // Returns true if this function represents an implicit static closure
|
| // function.
|
| bool IsImplicitStaticClosureFunction() const {
|
| - return is_static() && IsImplicitClosureFunction();
|
| + return IsImplicitClosureFunction() && is_static();
|
| }
|
| static bool IsImplicitStaticClosureFunction(RawFunction* func);
|
|
|
| // Returns true if this function represents an implicit instance closure
|
| // function.
|
| bool IsImplicitInstanceClosureFunction() const {
|
| - return !is_static() && IsImplicitClosureFunction();
|
| + return IsImplicitClosureFunction() && !is_static();
|
| }
|
|
|
| bool IsConstructorClosureFunction() const;
|
| @@ -2881,6 +2887,11 @@ class Function : public Object {
|
| const Function& parent,
|
| TokenPosition token_pos);
|
|
|
| + // Allocates a new Function object representing an implicit closure function.
|
| + static RawFunction* NewImplicitClosureFunction(const String& name,
|
| + const Function& parent,
|
| + TokenPosition token_pos);
|
| +
|
| // Allocates a new Function object representing a converted closure function.
|
| static RawFunction* NewConvertedClosureFunction(const String& name,
|
| const Function& parent,
|
|
|