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

Unified Diff: runtime/vm/code_generator.cc

Issue 21832003: Fix VM implementation of CastError not to extend TypeError (issue 5280). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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.h ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 25781)
+++ runtime/vm/code_generator.cc (working copy)
@@ -653,36 +653,6 @@
}
-// Test whether a formal parameter was defined by a passed-in argument.
-// Arg0: formal parameter index as Smi.
-// Arg1: formal parameter name as Symbol.
-// Arg2: arguments descriptor array.
-// Return value: true or false.
-DEFINE_RUNTIME_ENTRY(ArgumentDefinitionTest, 3) {
- ASSERT(arguments.ArgCount() ==
- kArgumentDefinitionTestRuntimeEntry.argument_count());
- const Smi& param_index = Smi::CheckedHandle(arguments.ArgAt(0));
- const String& param_name = String::CheckedHandle(arguments.ArgAt(1));
- ASSERT(param_name.IsSymbol());
- const Array& arg_desc_array = Array::CheckedHandle(arguments.ArgAt(2));
- ArgumentsDescriptor arg_desc(arg_desc_array);
- const intptr_t num_pos_args = arg_desc.PositionalCount();
- // Check if the formal parameter is defined by a positional argument.
- bool is_defined = num_pos_args > param_index.Value();
- if (!is_defined) {
- // Check if the formal parameter is defined by a named argument.
- const intptr_t num_named_args = arg_desc.NamedCount();
- for (intptr_t i = 0; i < num_named_args; i++) {
- if (arg_desc.MatchesNameAt(i, param_name)) {
- is_defined = true;
- break;
- }
- }
- }
- arguments.SetReturn(is_defined ? Bool::True() : Bool::False());
-}
-
-
// Report that the type of the given object is not bool in conditional context.
// Arg0: bad object.
// Return value: none, throws a TypeError.
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698