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

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

Issue 10388047: Implement correct checking for inherited readonliness on assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 years, 7 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/x64/stub-cache-x64.cc ('k') | test/mjsunit/harmony/proxies.js » ('j') | 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 8a1e9147369fbde7d20e996c91e45089c0545e67..e151d3d373c34fb7de7f3c94e83b219df66404f6 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -7662,7 +7662,7 @@ THREADED_TEST(ShadowObject) {
value = Script::Compile(v8_str("f()"))->Run();
CHECK_EQ(42, value->Int32Value());
- Script::Compile(v8_str("y = 42"))->Run();
+ Script::Compile(v8_str("y = 43"))->Run();
CHECK_EQ(1, shadow_y_setter_call_count);
value = Script::Compile(v8_str("y"))->Run();
CHECK_EQ(1, shadow_y_getter_call_count);
@@ -10306,11 +10306,11 @@ THREADED_TEST(Overriding) {
value = v8_compile("o.g")->Run();
CHECK_EQ(42, value->Int32Value());
- // Check 'h' can be shadowed.
+ // Check that 'h' cannot be shadowed.
value = v8_compile("o.h = 3; o.h")->Run();
- CHECK_EQ(3, value->Int32Value());
+ CHECK_EQ(1, value->Int32Value());
- // Check 'i' is cannot be shadowed or changed.
+ // Check that 'i' cannot be shadowed or changed.
value = v8_compile("o.i = 3; o.i")->Run();
CHECK_EQ(42, value->Int32Value());
}
@@ -12148,7 +12148,7 @@ TEST(RegExpStringModification) {
}
-// Test that we can set a property on the global object even if there
+// Test that we cannot set a property on the global object if there
// is a read-only property in the prototype chain.
TEST(ReadOnlyPropertyInGlobalProto) {
v8::HandleScope scope;
@@ -12162,12 +12162,13 @@ TEST(ReadOnlyPropertyInGlobalProto) {
// Check without 'eval' or 'with'.
v8::Handle<v8::Value> res =
CompileRun("function f() { x = 42; return x; }; f()");
+ CHECK_EQ(v8::Integer::New(0), res);
// Check with 'eval'.
- res = CompileRun("function f() { eval('1'); y = 42; return y; }; f()");
- CHECK_EQ(v8::Integer::New(42), res);
+ res = CompileRun("function f() { eval('1'); y = 43; return y; }; f()");
+ CHECK_EQ(v8::Integer::New(0), res);
// Check with 'with'.
- res = CompileRun("function f() { with (this) { y = 42 }; return y; }; f()");
- CHECK_EQ(v8::Integer::New(42), res);
+ res = CompileRun("function f() { with (this) { y = 44 }; return y; }; f()");
+ CHECK_EQ(v8::Integer::New(0), res);
}
static int force_set_set_count = 0;
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698