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

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

Issue 6694021: Merge revision 6179 to trunk (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 9 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/version.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
===================================================================
--- test/cctest/test-api.cc (revision 7169)
+++ test/cctest/test-api.cc (working copy)
@@ -5659,6 +5659,14 @@
global_template->SetAccessCheckCallbacks(NamedAccessBlocker,
IndexedAccessBlocker);
+ // Add accessible accessor.
+ global_template->SetAccessor(
+ v8_str("accessible_prop"),
+ EchoGetter, EchoSetter,
+ v8::Handle<Value>(),
+ v8::AccessControl(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE));
+
+
// Add an accessor that is not accessible by cross-domain JS code.
global_template->SetAccessor(v8_str("blocked_prop"),
UnreachableGetter, UnreachableSetter,
@@ -5699,6 +5707,18 @@
CompileRun("Object.seal(other)");
ExpectTrue("Object.isExtensible(other)");
+
+ // Regression test for issue 1250.
+ // Make sure that we can set the accessible accessors value using normal
+ // assignment.
+ CompileRun("other.accessible_prop = 42");
+ CHECK_EQ(42, g_echo_value);
+
+ v8::Handle<Value> value;
+ // We follow Safari in ignoring assignments to host object accessors.
+ CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})");
+ value = CompileRun("other.accessible_prop == 42");
+ CHECK(value->IsTrue());
}
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698