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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/ast.h" 5 #include "vm/ast.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 const Instance* StaticGetterNode::EvalConstExpr() const { 431 const Instance* StaticGetterNode::EvalConstExpr() const {
432 const String& getter_name = 432 const String& getter_name =
433 String::Handle(Field::GetterName(this->field_name())); 433 String::Handle(Field::GetterName(this->field_name()));
434 const Function& getter_func = 434 const Function& getter_func =
435 Function::Handle(this->cls().LookupStaticFunction(getter_name)); 435 Function::Handle(this->cls().LookupStaticFunction(getter_name));
436 if (getter_func.IsNull() || !getter_func.is_const()) { 436 if (getter_func.IsNull() || !getter_func.is_const()) {
437 return NULL; 437 return NULL;
438 } 438 }
439 GrowableArray<const Object*> arguments; 439 GrowableArray<const Object*> arguments;
440 const Array& kNoArgumentNames = Array::Handle(); 440 const Array& kNoArgumentNames = Array::Handle();
441 const Instance& field_value = 441 const Object& result =
442 Instance::ZoneHandle(DartEntry::InvokeStatic(getter_func, 442 Object::ZoneHandle(DartEntry::InvokeStatic(getter_func,
443 arguments, 443 arguments,
444 kNoArgumentNames)); 444 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.
445 if (field_value.IsUnhandledException()) { 445 if (result.IsError()) {
446 // TODO(turnidge): We could get better error messages by returning
447 // the Error object directly to the parser. This will involve
448 // replumbing all of the EvalConstExpr methods.
446 return NULL; 449 return NULL;
447 } 450 }
448 if (!field_value.IsNull()) { 451 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.
449 return &field_value; 452 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.
453 value ^= result.raw();
454 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.
455 return &value;
450 } 456 }
451 return NULL; 457 return NULL;
452 } 458 }
453 459
454 } // namespace dart 460 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698