Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 88802f36c21615825e4f9633767472c81503d68a..c0bbe1197a26a5b31519d0faa7bdfb6fea3a643a 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -6487,6 +6487,21 @@ RawInstance* Function::ImplicitStaticClosure() const { |
} |
+RawInstance* Function::ImplicitInstanceClosure(const Instance& receiver) const { |
+ ASSERT(IsImplicitClosureFunction()); |
+ const Class& cls = Class::Handle(signature_class()); |
+ const Context& context = Context::Handle(Context::New(1)); |
+ context.SetAt(0, receiver); |
+ const Instance& result = Instance::Handle(Closure::New(*this, context)); |
+ if (cls.NumTypeArguments() > 0) { |
+ const TypeArguments& type_arguments = |
+ TypeArguments::Handle(receiver.GetTypeArguments()); |
+ result.SetTypeArguments(type_arguments); |
+ } |
+ return result.raw(); |
+} |
+ |
+ |
RawString* Function::BuildSignature(bool instantiate, |
NameVisibility name_visibility, |
const TypeArguments& instantiator) const { |