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

Unified Diff: runtime/vm/parser.cc

Issue 38563005: Throw CyclicInitializationError instead of string (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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 29364)
+++ runtime/vm/parser.cc (working copy)
@@ -968,13 +968,13 @@
ident_pos,
field,
new LiteralNode(ident_pos, Instance::ZoneHandle())));
- // TODO(regis, 5802): Exception to throw is not specified by spec.
- const String& circular_error = String::ZoneHandle(
- Symbols::New("circular dependency in field initialization"));
+ // call CyclicInitializationError._throwNew(field_name).
srdjan 2013/10/28 21:32:02 s/call/Call/
hausner 2013/10/28 21:35:39 Done.
+ ArgumentListNode* error_arguments = new ArgumentListNode(ident_pos);
+ error_arguments->Add(new LiteralNode(ident_pos, field_name));
report_circular->Add(
- new ThrowNode(ident_pos,
- new LiteralNode(ident_pos, circular_error),
- NULL));
+ MakeStaticCall(Symbols::CyclicInitializationError(),
+ Library::PrivateCoreLibName(Symbols::ThrowNew()),
+ error_arguments));
AstNode* circular_check =
new IfNode(ident_pos, compare_circular, report_circular, NULL);
current_block_->statements->Add(circular_check);

Powered by Google App Engine
This is Rietveld 408576698