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

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
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/symbols.h » ('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 29396)
+++ 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).
+ 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);
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698