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

Side by Side Diff: test/cctest/test-api.cc

Issue 10535007: Put inherited readonliness behind a flag, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/override-read-only-property.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 12133 matching lines...) Expand 10 before | Expand all | Expand 10 after
12144 // Should complete without problems. 12144 // Should complete without problems.
12145 RegExpStringModificationTest().RunTest(); 12145 RegExpStringModificationTest().RunTest();
12146 12146
12147 local_env->Exit(); 12147 local_env->Exit();
12148 } 12148 }
12149 12149
12150 12150
12151 // Test that we cannot set a property on the global object if there 12151 // Test that we cannot set a property on the global object if there
12152 // is a read-only property in the prototype chain. 12152 // is a read-only property in the prototype chain.
12153 TEST(ReadOnlyPropertyInGlobalProto) { 12153 TEST(ReadOnlyPropertyInGlobalProto) {
12154 i::FLAG_es5_readonly = true;
12154 v8::HandleScope scope; 12155 v8::HandleScope scope;
12155 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); 12156 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
12156 LocalContext context(0, templ); 12157 LocalContext context(0, templ);
12157 v8::Handle<v8::Object> global = context->Global(); 12158 v8::Handle<v8::Object> global = context->Global();
12158 v8::Handle<v8::Object> global_proto = 12159 v8::Handle<v8::Object> global_proto =
12159 v8::Handle<v8::Object>::Cast(global->Get(v8_str("__proto__"))); 12160 v8::Handle<v8::Object>::Cast(global->Get(v8_str("__proto__")));
12160 global_proto->Set(v8_str("x"), v8::Integer::New(0), v8::ReadOnly); 12161 global_proto->Set(v8_str("x"), v8::Integer::New(0), v8::ReadOnly);
12161 global_proto->Set(v8_str("y"), v8::Integer::New(0), v8::ReadOnly); 12162 global_proto->Set(v8_str("y"), v8::Integer::New(0), v8::ReadOnly);
12162 // Check without 'eval' or 'with'. 12163 // Check without 'eval' or 'with'.
12163 v8::Handle<v8::Value> res = 12164 v8::Handle<v8::Value> res =
(...skipping 4423 matching lines...) Expand 10 before | Expand all | Expand 10 after
16587 v8::V8::SetFatalErrorHandler(CountingErrorCallback); 16588 v8::V8::SetFatalErrorHandler(CountingErrorCallback);
16588 v8::Utils::ReportApiFailure("StringEmpty()", "Kill V8"); 16589 v8::Utils::ReportApiFailure("StringEmpty()", "Kill V8");
16589 i::Isolate::Current()->TearDown(); 16590 i::Isolate::Current()->TearDown();
16590 CHECK(!i::Internals::IsInitialized(isolate)); 16591 CHECK(!i::Internals::IsInitialized(isolate));
16591 CHECK_EQ(1, fatal_error_callback_counter); 16592 CHECK_EQ(1, fatal_error_callback_counter);
16592 CHECK(v8::String::Empty().IsEmpty()); 16593 CHECK(v8::String::Empty().IsEmpty());
16593 CHECK_EQ(2, fatal_error_callback_counter); 16594 CHECK_EQ(2, fatal_error_callback_counter);
16594 CHECK(v8::String::Empty(isolate).IsEmpty()); 16595 CHECK(v8::String::Empty(isolate).IsEmpty());
16595 CHECK_EQ(3, fatal_error_callback_counter); 16596 CHECK_EQ(3, fatal_error_callback_counter);
16596 } 16597 }
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/override-read-only-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698