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

Unified Diff: test/cctest/test-api.cc

Issue 942003003: Add v8::Object::GetRealNamedPropertyAttributes() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index adc7c0921693934bd42eab414a7a18fa655b1835..06fe1fca9a1d7a5a9ad9989819b0f2d4aeec0c0c 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -61,12 +61,15 @@ using ::v8::FunctionTemplate;
using ::v8::Handle;
using ::v8::HandleScope;
using ::v8::Local;
-using ::v8::Name;
+using ::v8::Maybe;
using ::v8::Message;
using ::v8::MessageCallback;
+using ::v8::Name;
+using ::v8::None;
using ::v8::Object;
using ::v8::ObjectTemplate;
using ::v8::Persistent;
+using ::v8::PropertyAttribute;
using ::v8::Script;
using ::v8::StackTrace;
using ::v8::String;
@@ -10869,16 +10872,32 @@ THREADED_TEST(VariousGetPropertiesAndThrowingCallbacks) {
try_catch.Reset();
CHECK(result.IsEmpty());
+ Maybe<PropertyAttribute> attr =
+ instance->GetRealNamedPropertyAttributes(v8_str("f"));
+ CHECK(!try_catch.HasCaught());
+ CHECK(attr.has_value);
+ CHECK_EQ(attr.value, None);
+
result = another->GetRealNamedProperty(v8_str("f"));
CHECK(try_catch.HasCaught());
try_catch.Reset();
CHECK(result.IsEmpty());
+ attr = another->GetRealNamedPropertyAttributes(v8_str("f"));
+ CHECK(!try_catch.HasCaught());
+ CHECK(attr.has_value);
+ CHECK_EQ(attr.value, None);
+
result = another->GetRealNamedPropertyInPrototypeChain(v8_str("f"));
CHECK(try_catch.HasCaught());
try_catch.Reset();
CHECK(result.IsEmpty());
+ attr = another->GetRealNamedPropertyAttributesInPrototypeChain(v8_str("f"));
+ CHECK(!try_catch.HasCaught());
+ CHECK(attr.has_value);
+ CHECK_EQ(attr.value, None);
+
result = another->Get(v8_str("f"));
CHECK(try_catch.HasCaught());
try_catch.Reset();
@@ -10889,6 +10908,11 @@ THREADED_TEST(VariousGetPropertiesAndThrowingCallbacks) {
try_catch.Reset();
CHECK(result.IsEmpty());
+ attr = with_js_getter->GetRealNamedPropertyAttributes(v8_str("f"));
+ CHECK(!try_catch.HasCaught());
+ CHECK(attr.has_value);
+ CHECK_EQ(attr.value, None);
+
result = with_js_getter->Get(v8_str("f"));
CHECK(try_catch.HasCaught());
try_catch.Reset();
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698