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

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

Issue 30533004: Report correct error message in case of super invocation (fix issue 8208). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/dart_entry.h" 5 #include "vm/dart_entry.h"
6 6
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 core_lib.LookupClass( 120 core_lib.LookupClass(
121 String::Handle(core_lib.PrivateName(Symbols::InvocationMirror())))); 121 String::Handle(core_lib.PrivateName(Symbols::InvocationMirror()))));
122 ASSERT(!invocation_mirror_class.IsNull()); 122 ASSERT(!invocation_mirror_class.IsNull());
123 const String& function_name = 123 const String& function_name =
124 String::Handle(core_lib.PrivateName(Symbols::AllocateInvocationMirror())); 124 String::Handle(core_lib.PrivateName(Symbols::AllocateInvocationMirror()));
125 const Function& allocation_function = Function::Handle( 125 const Function& allocation_function = Function::Handle(
126 Resolver::ResolveStaticByName(invocation_mirror_class, 126 Resolver::ResolveStaticByName(invocation_mirror_class,
127 function_name, 127 function_name,
128 Resolver::kIsQualified)); 128 Resolver::kIsQualified));
129 ASSERT(!allocation_function.IsNull()); 129 ASSERT(!allocation_function.IsNull());
130 const int kNumAllocationArgs = 3; 130 const int kNumAllocationArgs = 4;
131 const Array& allocation_args = Array::Handle(Array::New(kNumAllocationArgs)); 131 const Array& allocation_args = Array::Handle(Array::New(kNumAllocationArgs));
132 allocation_args.SetAt(0, target_name); 132 allocation_args.SetAt(0, target_name);
133 allocation_args.SetAt(1, arguments_descriptor); 133 allocation_args.SetAt(1, arguments_descriptor);
134 allocation_args.SetAt(2, arguments); 134 allocation_args.SetAt(2, arguments);
135 allocation_args.SetAt(3, Bool::False()); // Not a super invocation.
135 const Object& invocation_mirror = Object::Handle( 136 const Object& invocation_mirror = Object::Handle(
136 InvokeFunction(allocation_function, allocation_args)); 137 InvokeFunction(allocation_function, allocation_args));
137 138
138 // Now use the invocation mirror object and invoke NoSuchMethod. 139 // Now use the invocation mirror object and invoke NoSuchMethod.
139 const int kNumArguments = 2; 140 const int kNumArguments = 2;
140 ArgumentsDescriptor args_desc( 141 ArgumentsDescriptor args_desc(
141 Array::Handle(ArgumentsDescriptor::New(kNumArguments))); 142 Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
142 const Function& function = Function::Handle( 143 const Function& function = Function::Handle(
143 Resolver::ResolveDynamic(receiver, 144 Resolver::ResolveDynamic(receiver,
144 Symbols::NoSuchMethod(), 145 Symbols::NoSuchMethod(),
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 String::Handle(Field::GetterName(Symbols::_id())))); 495 String::Handle(Field::GetterName(Symbols::_id()))));
495 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); 496 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
496 ASSERT(!func.IsNull()); 497 ASSERT(!func.IsNull());
497 const Array& args = Array::Handle(Array::New(1)); 498 const Array& args = Array::Handle(Array::New(1));
498 args.SetAt(0, port); 499 args.SetAt(0, port);
499 return DartEntry::InvokeFunction(func, args); 500 return DartEntry::InvokeFunction(func, args);
500 } 501 }
501 502
502 503
503 } // namespace dart 504 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698