Chromium Code Reviews| Index: src/factory.cc |
| diff --git a/src/factory.cc b/src/factory.cc |
| index 053f8704e61f73457f6b45b0dc26aee792c3dbc2..7ff25e286065515cbc66be5ba64b8971f2040cde 100644 |
| --- a/src/factory.cc |
| +++ b/src/factory.cc |
| @@ -1158,12 +1158,16 @@ Handle<Object> Factory::NewError(const char* maker, |
| // Invoke the JavaScript factory method. If an exception is thrown while |
| // running the factory method, use the exception as the result. |
| - bool caught_exception; |
| - Handle<Object> result = Execution::TryCall(fun, |
| - isolate()->js_builtins_object(), |
| - ARRAY_SIZE(argv), |
| - argv, |
| - &caught_exception); |
| + Handle<Object> result; |
| + Handle<Object> exception; |
| + ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| + isolate, result, |
| + Execution::TryCall(fun, |
| + isolate()->js_builtins_object(), |
| + ARRAY_SIZE(argv), |
| + argv, |
| + &exception), |
| + exception); |
| return result; |
| } |
| @@ -1183,12 +1187,16 @@ Handle<Object> Factory::NewError(const char* constructor, |
| // Invoke the JavaScript factory method. If an exception is thrown while |
| // running the factory method, use the exception as the result. |
| - bool caught_exception; |
| - Handle<Object> result = Execution::TryCall(fun, |
| - isolate()->js_builtins_object(), |
| - ARRAY_SIZE(argv), |
| - argv, |
| - &caught_exception); |
| + Handle<Object> result; |
| + Handle<Object> exception; |
| + ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| + isolate, result, |
| + Execution::TryCall(fun, |
| + isolate()->js_builtins_object(), |
| + ARRAY_SIZE(argv), |
| + argv, |
| + &exception), |
| + exception); |
| return result; |
| } |
| @@ -1991,20 +1999,17 @@ void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp, |
| -void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, |
| - Handle<JSObject> instance, |
| - bool* pending_exception) { |
| +MaybeHandle<FunctionTemplateInfo> Factory::ConfigureInstance( |
| + Handle<FunctionTemplateInfo> desc, Handle<JSObject> instance) { |
| // Configure the instance by adding the properties specified by the |
| // instance template. |
| Handle<Object> instance_template(desc->instance_template(), isolate()); |
| - if (!instance_template->IsUndefined()) { |
| - Execution::ConfigureInstance(isolate(), |
| - instance, |
| - instance_template, |
| - pending_exception); |
| - } else { |
| - *pending_exception = false; |
| + if (instance_template->IsUndefined() || |
|
Igor Sheludko
2014/04/11 09:30:03
I think it would be more clear if we keep it like
Yang
2014/04/11 09:41:52
Good idea. Done.
|
| + !Execution::ConfigureInstance( |
| + isolate(), instance, instance_template).is_null()) { |
| + return desc; |
| } |
| + return MaybeHandle<FunctionTemplateInfo>(); |
| } |