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

Unified Diff: runtime/vm/ast.cc

Issue 11049038: Change compile-time errors into dynamic errors in instance creation expression (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/vm/ast.h ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 13204)
+++ runtime/vm/ast.cc (working copy)
@@ -387,6 +387,22 @@
}
+AstNode* StaticCallNode::MakeAssignmentNode(AstNode* rhs) {
+ // Return this node if it represents a 'throw NoSuchMethodError' indicating
+ // that a getter was not found, otherwise return null.
+ const Class& cls = Class::Handle(function().Owner());
+ const String& cls_name = String::Handle(cls.Name());
+ const String& func_name = String::Handle(function().name());
+ const String& error_cls_name = String::Handle(Symbols::NoSuchMethodError());
+ const String& error_func_name = String::Handle(Symbols::ThrowNew());
+ if (cls_name.Equals(error_cls_name) &&
+ func_name.StartsWith(error_func_name)) {
+ return this;
+ }
+ return NULL;
+}
+
+
const Instance* StaticGetterNode::EvalConstExpr() const {
const String& getter_name =
String::Handle(Field::GetterName(this->field_name()));
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698