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

Unified Diff: runtime/vm/unit_test.cc

Issue 10831142: Associate the correct type to method receivers (instead of Dynamic type). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/parser.cc ('K') | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
===================================================================
--- runtime/vm/unit_test.cc (revision 10199)
+++ runtime/vm/unit_test.cc (working copy)
@@ -141,9 +141,11 @@
uword AssemblerTest::Assemble() {
const String& function_name = String::ZoneHandle(Symbols::New(name_));
+ const Class& cls = Class::ZoneHandle(
+ Class::New(function_name, Script::Handle(), Scanner::kDummyTokenIndex));
Function& function = Function::ZoneHandle(
Function::New(function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0));
+ true, false, false, false, cls, 0));
const Code& code = Code::Handle(Code::FinalizeCode(function, assembler_));
if (FLAG_disassemble) {
OS::Print("Code for test '%s' {\n", name_);
@@ -165,15 +167,14 @@
default_parameter_values_(Array::ZoneHandle()) {
ASSERT(name != NULL);
const String& function_name = String::ZoneHandle(Symbols::New(name));
+ // Add function to a class and that class to the class dictionary so that
+ // frame walking can be used.
+ const Class& cls = Class::ZoneHandle(
+ Class::New(function_name, Script::Handle(), Scanner::kDummyTokenIndex));
function_ = Function::New(
function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0);
+ true, false, false, false, cls, 0);
function_.set_result_type(Type::Handle(Type::DynamicType()));
- // Add function to a class and that class to the class dictionary so that
- // frame walking can be used.
- Class& cls = Class::ZoneHandle();
- const Script& script = Script::Handle();
- cls = Class::New(function_name, script, Scanner::kDummyTokenIndex);
const Array& functions = Array::Handle(Array::New(1));
functions.SetAt(0, function_);
cls.SetFunctions(functions);
« runtime/vm/parser.cc ('K') | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698