OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |