Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 5d6727a0a486ac794405deb13e42657c29d97a73..40e21d2c1100612735738a5043655dbce25b0aca 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -4491,7 +4491,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) { |
| if (args[0]->IsJSReceiver()) { |
| JSReceiver* receiver = JSReceiver::cast(args[0]); |
| CONVERT_CHECKED(String, key, args[1]); |
| - if (receiver->HasProperty(key)) return isolate->heap()->true_value(); |
| + bool result = receiver->HasProperty(key); |
| + if (isolate->has_pending_exception()) return Failure::Exception(); |
| + if (result) return isolate->heap()->true_value(); |
|
Kevin Millikin (Chromium)
2011/08/31 10:15:31
You can also write this without the if as:
return
rossberg
2011/08/31 13:28:32
Done.
|
| } |
| return isolate->heap()->false_value(); |
| } |