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

Unified Diff: runtime/vm/parser.cc

Issue 34903006: Fix language tests for redirecting factories (issue 14297). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « no previous file | tests/language/factory_redirection_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 29044)
+++ runtime/vm/parser.cc (working copy)
@@ -9661,8 +9661,8 @@
}
-static const String& BuildConstructorName(const String& type_class_name,
- const String* named_constructor) {
+static String& BuildConstructorName(const String& type_class_name,
+ const String* named_constructor) {
// By convention, the static function implementing a named constructor 'C'
// for class 'A' is labeled 'A.C', and the static function implementing the
// unnamed constructor for class 'A' is labeled 'A.'.
@@ -9743,7 +9743,7 @@
// Resolve the type and optional identifier to a constructor or factory.
Class& type_class = Class::Handle(type.type_class());
- const String& type_class_name = String::Handle(type_class.Name());
+ String& type_class_name = String::Handle(type_class.Name());
AbstractTypeArguments& type_arguments =
AbstractTypeArguments::ZoneHandle(type.arguments());
@@ -9757,7 +9757,7 @@
AbstractType& type_bound = AbstractType::ZoneHandle();
// Make sure that an appropriate constructor exists.
- const String& constructor_name =
+ String& constructor_name =
BuildConstructorName(type_class_name, named_constructor);
Function& constructor = Function::ZoneHandle(
type_class.LookupConstructor(constructor_name));
@@ -9811,8 +9811,10 @@
}
type = redirect_type.raw();
type_class = type.type_class();
+ type_class_name = type_class.Name();
type_arguments = type.arguments();
constructor = constructor.RedirectionTarget();
+ constructor_name = constructor.name();
ASSERT(!constructor.IsNull());
}
if (constructor.IsFactory()) {
« no previous file with comments | « no previous file | tests/language/factory_redirection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698