Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 348) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -2717,6 +2717,15 @@ |
| } |
| +bool Function::IsImplicitClosureFunction() const { |
| + if (kind() != RawFunction::kClosureFunction) { |
| + return false; |
| + } |
|
siva
2011/10/11 21:00:46
if (!IsClosureFunction()) {
return false;
}
ins
regis
2011/10/11 23:40:19
Done.
|
| + const Function& parent = Function::Handle(parent_function()); |
| + return parent.raw_ptr()->implicit_closure_function_ == raw(); |
| +} |
| + |
| + |
| RawFunction* Function::New() { |
| const Class& function_class = Class::Handle(Object::function_class()); |
| RawObject* raw = Object::Allocate(function_class, |
| @@ -2757,7 +2766,7 @@ |
| const Function& result = Function::Handle( |
| Function::New(name, |
| RawFunction::kClosureFunction, |
| - /* is_static = */ true, |
| + /* is_static = */ parent.is_static(), |
| /* is_const = */ false, |
| token_index)); |
| result.set_parent_function(parent); |
| @@ -2830,6 +2839,7 @@ |
| ASSERT(Class::Handle(closure_function.signature_class()).IsNull()); |
| closure_function.set_signature_class(signature_class); |
| set_implicit_closure_function(closure_function); |
| + ASSERT(closure_function.IsImplicitClosureFunction()); |
| return closure_function.raw(); |
| } |