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

Unified Diff: runtime/vm/parser.cc

Issue 26436004: Implement constructor kinds in the VM mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: both_ 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 7ffeeb86d1d65f727ad6b46a7c83cf438ae72a26..438dc5f3453596c0b42f6807c1c976aac2c9062b 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -3121,9 +3121,11 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
// Parse redirecting factory constructor.
Type& redirection_type = Type::Handle();
String& redirection_identifier = String::Handle();
+ bool is_redirecting = false;
if (method->IsFactory() && (CurrentToken() == Token::kASSIGN)) {
ConsumeToken();
const intptr_t type_pos = TokenPos();
+ is_redirecting = true;
const AbstractType& type = AbstractType::Handle(
ParseType(ClassFinalizer::kResolveTypeParameters));
if (!type.IsMalformed() && type.IsTypeParameter()) {
@@ -3153,6 +3155,7 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
((LookaheadToken(2) == Token::kLPAREN) ||
LookaheadToken(4) == Token::kLPAREN)) {
// Redirected constructor: either this(...) or this.xxx(...).
+ is_redirecting = true;
if (method->params.has_field_initializer) {
// Constructors that redirect to another constructor must not
// initialize any fields using field initializer parameters.
@@ -3287,6 +3290,7 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
method->decl_begin_pos));
func.set_result_type(*method->type);
func.set_end_token_pos(method_end_pos);
+ func.set_is_redirecting(is_redirecting);
if (method->metadata_pos > 0) {
library_.AddFunctionMetadata(func, method->metadata_pos);
}

Powered by Google App Engine
This is Rietveld 408576698