another attempt at fixing 15107
authordcarney@chromium.org <dcarney@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Jun 2013 10:39:44 +0000 (10:39 +0000)
committerdcarney@chromium.org <dcarney@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Jun 2013 10:39:44 +0000 (10:39 +0000)
TBR=svenpanne@chromium.org
BUG=

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

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

src/api.h
test/cctest/test-api.cc

index e64e960ecff9e72db8d19118717e2cd6fbe98d01..3d1c69cb18662069fb385a2fdd7e02ba6fa26b7e 100644 (file)
--- a/src/api.h
+++ b/src/api.h
@@ -292,6 +292,11 @@ OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE)
       v8::Persistent<T>* persistent) {
     return OpenPersistent(*persistent);
   }
+
+  template <class From, class To>
+  static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) {
+    return OpenHandle(*handle);
+  }
 };
 
 
index ca42909808bb0c5183c9fa4a47c24e5f8afc3f88..5d38c211884ccbf82f00d085835caa01dca3e156 100755 (executable)
@@ -5146,10 +5146,10 @@ Handle<v8::Array> NonStrictArgsIndexedPropertyEnumerator(
   Local<Object> result =
       Local<Object>::Cast(indexed_property_names_script->Run());
   // Have to populate the handle manually, as it's not Cast-able.
-  Local<v8::Array> array_result;
-  Object** ptr = reinterpret_cast<Object**>(&array_result);
-  *ptr = *reinterpret_cast<Object**>(&result);
-  return array_result;
+  i::Handle<i::JSObject> o =
+      v8::Utils::OpenHandle<Object, i::JSObject>(result);
+  i::Handle<i::JSArray> array(reinterpret_cast<i::JSArray*>(*o));
+  return v8::Utils::ToLocal(array);
 }