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

Unified Diff: vm/resolver_test.cc

Issue 11613009: Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« vm/dart_entry.h ('K') | « vm/parser.cc ('k') | vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/resolver_test.cc
===================================================================
--- vm/resolver_test.cc (revision 16285)
+++ vm/resolver_test.cc (working copy)
@@ -108,14 +108,13 @@
kNoArgumentNames,
kResolveType));
EXPECT(!function.IsNull());
- GrowableArray<const Object*> arguments(2);
+ const Array& args = Array::Handle(Array::New(kNumArguments));
const String& arg0 = String::Handle(String::New("junk"));
- arguments.Add(&arg0);
+ args.SetAt(0, arg0);
const Smi& arg1 = Smi::Handle(Smi::New(kTestValue));
- arguments.Add(&arg1);
+ args.SetAt(1, arg1);
const Smi& retval = Smi::Handle(
- reinterpret_cast<RawSmi*>(
- DartEntry::InvokeStatic(function, arguments, kNoArgumentNames)));
+ reinterpret_cast<RawSmi*>(DartEntry::InvokeStatic(function, args)));
EXPECT_EQ(kTestValue, retval.Value());
}
@@ -185,17 +184,14 @@
kNumPositionalArguments,
kNumNamedArguments));
EXPECT(!function.IsNull());
- GrowableArray<const Object*> arguments;
+ const Array& args = Array::Handle(Array::New(kNumPositionalArguments));
+ args.SetAt(0, receiver);
const String& arg0 = String::Handle(String::New("junk"));
- arguments.Add(&arg0);
+ args.SetAt(1, arg0);
const Smi& arg1 = Smi::Handle(Smi::New(kTestValue));
- arguments.Add(&arg1);
- const Array& kNoArgumentNames = Array::Handle();
+ args.SetAt(2, arg1);
const Smi& retval = Smi::Handle(
- reinterpret_cast<RawSmi*>(DartEntry::InvokeDynamic(receiver,
- function,
- arguments,
- kNoArgumentNames)));
+ reinterpret_cast<RawSmi*>(DartEntry::InvokeDynamic(function, args)));
EXPECT_EQ(kTestValue, retval.Value());
}
« vm/dart_entry.h ('K') | « vm/parser.cc ('k') | vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698