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

Unified Diff: runtime/vm/runtime_entry_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
Index: runtime/vm/runtime_entry_test.cc
===================================================================
--- runtime/vm/runtime_entry_test.cc (revision 10199)
+++ runtime/vm/runtime_entry_test.cc (working copy)
@@ -13,18 +13,19 @@
// Add function to a class and that class to the class dictionary so that
// frame walking can be used.
const Function& RegisterFakeFunction(const char* name, const Code& code) {
+ const String& class_name = String::Handle(Symbols::New("ownerClass"));
+ const Script& script = Script::Handle();
+ const Class& owner_class =
+ Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex));
const String& function_name = String::ZoneHandle(Symbols::New(name));
const Function& function = Function::ZoneHandle(
Function::New(function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0));
- Class& cls = Class::ZoneHandle();
- const Script& script = Script::Handle();
- cls = Class::New(function_name, script, Scanner::kDummyTokenIndex);
+ true, false, false, false, owner_class, 0));
const Array& functions = Array::Handle(Array::New(1));
functions.SetAt(0, function);
- cls.SetFunctions(functions);
+ owner_class.SetFunctions(functions);
Library& lib = Library::Handle(Library::CoreLibrary());
- lib.AddClass(cls);
+ lib.AddClass(owner_class);
function.SetCode(code);
return function;
}

Powered by Google App Engine
This is Rietveld 408576698