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

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

Issue 6903059: Expose hasOwnProperty() through API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update copyright years. Created 9 years, 8 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 19492a53278f5fdb714633a941775f7a94945ab5..dfb8edb2f91ae99ac569fb2fce4a8921302879e1 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -202,6 +202,20 @@ THREADED_TEST(ReceiverSignature) {
}
+TEST(HasOwnProperty) {
+ v8::HandleScope scope;
+ LocalContext env;
+ Handle<Value> value = CompileRun(
+ "function Foo() { this.foo = 11; };"
+ "function Bar() { this.bar = 13; };"
+ "Bar.prototype = new Foo();"
+ "new Bar();");
+ CHECK(value->IsObject());
+ Handle<Object> object = value->ToObject();
Vitaly Repeshko 2011/04/27 09:03:59 It'd be interesting to test this with __defineGett
Karl Klose 2011/04/28 08:32:43 Done.
+ CHECK_EQ(true, object->Has(v8_str("foo")));
+ CHECK_EQ(false, object->HasOwnProperty(v8_str("foo")));
+ CHECK_EQ(true, object->HasOwnProperty(v8_str("bar")));
+}
THREADED_TEST(ArgumentSignature) {
« 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