From: dcarney@chromium.org Date: Thu, 6 Jun 2013 12:23:37 +0000 (+0000) Subject: update test to test new style property handlers X-Git-Tag: upstream/4.7.83~13988 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6519a142fba527d50edeff386e0d35235d7d996;p=platform%2Fupstream%2Fv8.git update test to test new style property handlers R=svenpanne@chromium.org BUG= Review URL: https://codereview.chromium.org/15769014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/include/v8.h b/include/v8.h index 28a63f0..5f0df5b 100644 --- a/include/v8.h +++ b/include/v8.h @@ -2811,7 +2811,10 @@ class V8EXPORT Template : public Data { template class ReturnValue { public: - V8_INLINE(explicit ReturnValue(internal::Object** slot)); + template V8_INLINE(ReturnValue(const ReturnValue& that)) + : value_(that.value_) { + TYPE_CHECK(T, S); + }; // Handle setters template V8_INLINE(void Set(const Persistent& handle)); template V8_INLINE(void Set(const Handle handle)); @@ -2825,7 +2828,12 @@ class ReturnValue { V8_INLINE(void SetUndefined()); // Convenience getter for Isolate V8_INLINE(Isolate* GetIsolate()); + private: + template friend class ReturnValue; + template friend class FunctionCallbackInfo; + template friend class PropertyCallbackInfo; + V8_INLINE(explicit ReturnValue(internal::Object** slot)); internal::Object** value_; }; diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index c4687cc..bc72e37 100755 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -2007,88 +2007,90 @@ THREADED_TEST(IndexedPropertyHandlerGetter) { v8::Handle bottom; -static v8::Handle CheckThisIndexedPropertyHandler( +static void CheckThisIndexedPropertyHandler( uint32_t index, - const AccessorInfo& info) { + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -static v8::Handle CheckThisNamedPropertyHandler( +static void CheckThisNamedPropertyHandler( Local name, - const AccessorInfo& info) { + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } - -v8::Handle CheckThisIndexedPropertySetter(uint32_t index, - Local value, - const AccessorInfo& info) { +void CheckThisIndexedPropertySetter( + uint32_t index, + Local value, + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisNamedPropertySetter(Local property, - Local value, - const AccessorInfo& info) { +void CheckThisNamedPropertySetter( + Local property, + Local value, + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisIndexedPropertyQuery( +void CheckThisIndexedPropertyQuery( uint32_t index, - const AccessorInfo& info) { + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisNamedPropertyQuery(Local property, - const AccessorInfo& info) { +void CheckThisNamedPropertyQuery( + Local property, + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisIndexedPropertyDeleter( +void CheckThisIndexedPropertyDeleter( uint32_t index, - const AccessorInfo& info) { + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisNamedPropertyDeleter( +void CheckThisNamedPropertyDeleter( Local property, - const AccessorInfo& info) { + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisIndexedPropertyEnumerator( - const AccessorInfo& info) { +void CheckThisIndexedPropertyEnumerator( + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); } -v8::Handle CheckThisNamedPropertyEnumerator( - const AccessorInfo& info) { +void CheckThisNamedPropertyEnumerator( + const v8::PropertyCallbackInfo& info) { + CheckReturnValue(info); ApiTestFuzzer::Fuzz(); CHECK(info.This()->Equals(bottom)); - return v8::Handle(); }