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

Unified Diff: runtime/vm/code_generator_test.cc

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_test.cc
===================================================================
--- runtime/vm/code_generator_test.cc (revision 12003)
+++ runtime/vm/code_generator_test.cc (working copy)
@@ -62,7 +62,7 @@
ASSERT(local_scope->num_variables() == num_params);
const Function& function = test->function();
function.set_num_fixed_parameters(num_params);
- ASSERT(function.num_optional_parameters() == 0);
+ ASSERT(!function.HasOptionalParameters());
node_seq->Add(new ReturnNode(kPos, new LoadLocalNode(kPos, parameter)));
}
@@ -94,7 +94,7 @@
ASSERT(local_scope->num_variables() == num_params + num_locals);
const Function& function = test->function();
function.set_num_fixed_parameters(num_params);
- ASSERT(function.num_optional_parameters() == 0);
+ ASSERT(!function.HasOptionalParameters());
BinaryOpNode* add = new BinaryOpNode(kPos,
Token::kADD,
new LoadLocalNode(kPos, param1),
@@ -196,7 +196,7 @@
// Tested Dart code:
-// int dec(int a, int b = 1) native: "TestSmiSub";
+// int dec(int a, [int b = 1]) native: "TestSmiSub";
// The native entry TestSmiSub implements dec natively.
CODEGEN_TEST_GENERATE(NativeDecCodegen, test) {
// A NativeBodyNode, preceded by an EnterNode and followed by a ReturnNode,
@@ -216,8 +216,7 @@
default_values.SetAt(0, Smi::ZoneHandle(Smi::New(1))); // b = 1.
test->set_default_parameter_values(default_values);
const Function& function = test->function();
- function.set_num_fixed_parameters(num_fixed_params);
- function.set_num_optional_parameters(num_opt_params);
+ function.SetNumberOfParameters(num_fixed_params, num_opt_params, true);
const bool has_opt_params = true;
const String& native_name =
String::ZoneHandle(Symbols::New("TestSmiSub"));
@@ -387,8 +386,7 @@
default_values.SetAt(2, Smi::ZoneHandle(Smi::New(-32)));
test->set_default_parameter_values(default_values);
const Function& function = test->function();
- function.set_num_fixed_parameters(num_fixed_params);
- function.set_num_optional_parameters(num_opt_params);
+ function.SetNumberOfParameters(num_fixed_params, num_opt_params, true);
function.set_parameter_types(Array::Handle(Array::New(num_params)));
function.set_parameter_names(Array::Handle(Array::New(num_params)));
const Type& param_type = Type::Handle(Type::DynamicType());
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698