Handlify i18n.cc.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Apr 2014 11:36:33 +0000 (11:36 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Apr 2014 11:36:33 +0000 (11:36 +0000)
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/226543003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/i18n.cc

index b84da9eb2740e23d952f65def22cb7eacf3f143c..910414fa5bc1a6606c6c67696493bc49b3852c55 100644 (file)
@@ -58,11 +58,10 @@ bool ExtractStringSetting(Isolate* isolate,
                           const char* key,
                           icu::UnicodeString* setting) {
   Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
-  MaybeObject* maybe_object = options->GetProperty(*str);
-  Object* object;
-  if (maybe_object->ToObject(&object) && object->IsString()) {
+  Handle<Object> object = Object::GetProperty(options, str);
+  if (object->IsString()) {
     v8::String::Utf8Value utf8_string(
-        v8::Utils::ToLocal(Handle<String>(String::cast(object))));
+        v8::Utils::ToLocal(Handle<String>::cast(object)));
     *setting = icu::UnicodeString::fromUTF8(*utf8_string);
     return true;
   }
@@ -75,9 +74,8 @@ bool ExtractIntegerSetting(Isolate* isolate,
                            const char* key,
                            int32_t* value) {
   Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
-  MaybeObject* maybe_object = options->GetProperty(*str);
-  Object* object;
-  if (maybe_object->ToObject(&object) && object->IsNumber()) {
+  Handle<Object> object = Object::GetProperty(options, str);
+  if (object->IsNumber()) {
     object->ToInt32(value);
     return true;
   }
@@ -90,9 +88,8 @@ bool ExtractBooleanSetting(Isolate* isolate,
                            const char* key,
                            bool* value) {
   Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
-  MaybeObject* maybe_object = options->GetProperty(*str);
-  Object* object;
-  if (maybe_object->ToObject(&object) && object->IsBoolean()) {
+  Handle<Object> object = Object::GetProperty(options, str);
+  if (object->IsBoolean()) {
     *value = object->BooleanValue();
     return true;
   }