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

Unified Diff: src/api.cc

Issue 225283005: Return MaybeHandle from SetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 9 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 | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 060914a8d84973d0cfae15f091741ba0da9795d1..d180c31a1c0498afca4043824935f0031d8739d0 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3049,14 +3049,13 @@ bool v8::Object::Set(v8::Handle<Value> key, v8::Handle<Value> value,
i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
EXCEPTION_PREAMBLE(isolate);
- i::Handle<i::Object> obj = i::Runtime::SetObjectProperty(
+ has_pending_exception = i::Runtime::SetObjectProperty(
isolate,
self,
key_obj,
value_obj,
static_cast<PropertyAttributes>(attribs),
- i::SLOPPY);
- has_pending_exception = obj.is_null();
+ i::SLOPPY).is_null();
EXCEPTION_BAILOUT_CHECK(isolate, false);
return true;
}
@@ -3093,12 +3092,11 @@ bool v8::Object::ForceSet(v8::Handle<Value> key,
i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
EXCEPTION_PREAMBLE(isolate);
- i::Handle<i::Object> obj = i::ForceSetProperty(
+ has_pending_exception = i::Runtime::ForceSetObjectProperty(
self,
key_obj,
value_obj,
- static_cast<PropertyAttributes>(attribs));
- has_pending_exception = obj.is_null();
+ static_cast<PropertyAttributes>(attribs)).is_null();
EXCEPTION_BAILOUT_CHECK(isolate, false);
return true;
}
@@ -6157,7 +6155,8 @@ Local<Symbol> v8::Symbol::For(Isolate* isolate, Local<String> name) {
ASSERT(symbol->IsUndefined());
symbol = i_isolate->factory()->NewSymbol();
i::Handle<i::Symbol>::cast(symbol)->set_name(*i_name);
- i::JSObject::SetProperty(symbols, i_name, symbol, NONE, i::STRICT);
+ i::JSObject::SetProperty(
+ symbols, i_name, symbol, NONE, i::STRICT).Assert();
}
return Utils::ToLocal(i::Handle<i::Symbol>::cast(symbol));
}
@@ -6177,7 +6176,8 @@ Local<Symbol> v8::Symbol::ForApi(Isolate* isolate, Local<String> name) {
ASSERT(symbol->IsUndefined());
symbol = i_isolate->factory()->NewSymbol();
i::Handle<i::Symbol>::cast(symbol)->set_name(*i_name);
- i::JSObject::SetProperty(symbols, i_name, symbol, NONE, i::STRICT);
+ i::JSObject::SetProperty(
+ symbols, i_name, symbol, NONE, i::STRICT).Assert();
}
return Utils::ToLocal(i::Handle<i::Symbol>::cast(symbol));
}
@@ -6209,7 +6209,8 @@ Local<Private> v8::Private::ForApi(Isolate* isolate, Local<String> name) {
ASSERT(symbol->IsUndefined());
symbol = i_isolate->factory()->NewPrivateSymbol();
i::Handle<i::Symbol>::cast(symbol)->set_name(*i_name);
- i::JSObject::SetProperty(privates, i_name, symbol, NONE, i::STRICT);
+ i::JSObject::SetProperty(
+ privates, i_name, symbol, NONE, i::STRICT).Assert();
}
Local<Symbol> result = Utils::ToLocal(i::Handle<i::Symbol>::cast(symbol));
return v8::Handle<Private>(reinterpret_cast<Private*>(*result));
@@ -6964,19 +6965,23 @@ Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) {
ENTER_V8(isolate);
v8::EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
i::Debug* isolate_debug = isolate->debug();
- isolate_debug->Load();
- i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object());
- i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString(
- STATIC_ASCII_VECTOR("MakeMirror"));
- i::Handle<i::Object> fun_obj = i::Object::GetProperty(debug, name);
- ASSERT(!fun_obj.is_null());
- i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj);
- v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun);
- const int kArgc = 1;
- v8::Handle<v8::Value> argv[kArgc] = { obj };
EXCEPTION_PREAMBLE(isolate);
- v8::Local<v8::Value> result =
- v8_fun->Call(Utils::ToLocal(debug), kArgc, argv);
+ has_pending_exception = !isolate_debug->Load();
+ v8::Local<v8::Value> result;
+ if (!has_pending_exception) {
+ i::Handle<i::JSObject> debug(
+ isolate_debug->debug_context()->global_object());
+ i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("MakeMirror"));
+ i::Handle<i::Object> fun_obj = i::Object::GetProperty(debug, name);
+ ASSERT(!fun_obj.is_null());
+ i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj);
+ v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun);
+ const int kArgc = 1;
+ v8::Handle<v8::Value> argv[kArgc] = { obj };
+ result = v8_fun->Call(Utils::ToLocal(debug), kArgc, argv);
+ has_pending_exception = result.IsEmpty();
+ }
EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
return scope.Escape(result);
}
« no previous file with comments | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698