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

Unified Diff: runtime/vm/ast.cc

Issue 9169102: Add Dart_PropagateError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Removed some unneeded includes Created 8 years, 11 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/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 3415)
+++ runtime/vm/ast.cc (working copy)
@@ -438,15 +438,21 @@
}
GrowableArray<const Object*> arguments;
const Array& kNoArgumentNames = Array::Handle();
- const Instance& field_value =
- Instance::ZoneHandle(DartEntry::InvokeStatic(getter_func,
+ const Object& result =
+ Object::ZoneHandle(DartEntry::InvokeStatic(getter_func,
arguments,
kNoArgumentNames));
siva 2012/01/31 00:52:34 Does result have to be a ZoneHandle? We are not re
turnidge 2012/01/31 21:56:31 Done.
- if (field_value.IsUnhandledException()) {
+ if (result.IsError()) {
+ // TODO(turnidge): We could get better error messages by returning
+ // the Error object directly to the parser. This will involve
+ // replumbing all of the EvalConstExpr methods.
return NULL;
}
- if (!field_value.IsNull()) {
- return &field_value;
+ ASSERT(result.IsInstance());
siva 2012/01/31 00:52:34 Why is this assert needed here doesn't the ^= assi
turnidge 2012/01/31 21:56:31 Removed.
+ Instance& value = Instance::ZoneHandle();
siva 2012/01/31 00:52:34 why not call it field_value instead of value to re
turnidge 2012/01/31 21:56:31 Done.
+ value ^= result.raw();
+ if (!value.IsNull()) {
siva 2012/01/31 00:52:34 The NULL check can be done before we create an Ins
turnidge 2012/01/31 21:56:31 Done.
+ return &value;
}
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698