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

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

Issue 6673042: Do not set value on host objects in Object.defineProperty (fixes issue 1250).... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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/runtime.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 7168)
+++ 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,17 @@
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;
Mads Ager (chromium) 2011/03/15 09:12:50 Add comment here saying something like: We follow
+ CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})");
+ value = CompileRun("other.accessible_prop == 42");
+ CHECK(value->IsTrue());
}
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698