Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: runtime/vm/object.cc

Issue 19021002: Fix closure creation from function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 4499 matching lines...) Expand 10 before | Expand all | Expand 10 after
4510 const Function& result = Function::Handle( 4510 const Function& result = Function::Handle(
4511 Function::New(name, 4511 Function::New(name,
4512 RawFunction::kClosureFunction, 4512 RawFunction::kClosureFunction,
4513 /* is_static = */ parent.is_static(), 4513 /* is_static = */ parent.is_static(),
4514 /* is_const = */ false, 4514 /* is_const = */ false,
4515 /* is_abstract = */ false, 4515 /* is_abstract = */ false,
4516 /* is_external = */ false, 4516 /* is_external = */ false,
4517 parent_owner, 4517 parent_owner,
4518 token_pos)); 4518 token_pos));
4519 result.set_parent_function(parent); 4519 result.set_parent_function(parent);
4520 result.set_end_token_pos(parent.end_token_pos());
hausner 2013/07/10 21:55:49 As discussed offline, you need to make your change
Michael Lippautz (Google) 2013/07/10 22:33:10 Done.
4521 AbstractType& parent_result = AbstractType::Handle(parent.result_type());
4522 if (!parent_result.IsNull()) {
4523 result.set_result_type(parent_result);
4524 }
4520 return result.raw(); 4525 return result.raw();
4521 } 4526 }
4522 4527
4523 4528
4524 RawFunction* Function::ImplicitClosureFunction() const { 4529 RawFunction* Function::ImplicitClosureFunction() const {
4525 // Return the existing implicit closure function if any. 4530 // Return the existing implicit closure function if any.
4526 if (implicit_closure_function() != Function::null()) { 4531 if (implicit_closure_function() != Function::null()) {
4527 return implicit_closure_function(); 4532 return implicit_closure_function();
4528 } 4533 }
4529 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); 4534 ASSERT(!IsSignatureFunction() && !IsClosureFunction());
(...skipping 9615 matching lines...) Expand 10 before | Expand all | Expand 10 after
14145 } 14150 }
14146 14151
14147 14152
14148 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 14153 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
14149 stream->OpenObject(); 14154 stream->OpenObject();
14150 stream->CloseObject(); 14155 stream->CloseObject();
14151 } 14156 }
14152 14157
14153 14158
14154 } // namespace dart 14159 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698