| 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 19235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19246 access_check_fail_thrown = false; | 19246 access_check_fail_thrown = false; |
| 19247 catch_callback_called = false; | 19247 catch_callback_called = false; |
| 19248 CompileRun("try { [1, 2, 3].sort(); } catch (e) { catcher(e) };"); | 19248 CompileRun("try { [1, 2, 3].sort(); } catch (e) { catcher(e) };"); |
| 19249 CHECK(!access_check_fail_thrown); | 19249 CHECK(!access_check_fail_thrown); |
| 19250 CHECK(!catch_callback_called); | 19250 CHECK(!catch_callback_called); |
| 19251 } | 19251 } |
| 19252 | 19252 |
| 19253 | 19253 |
| 19254 TEST(AccessCheckThrows) { | 19254 TEST(AccessCheckThrows) { |
| 19255 i::FLAG_allow_natives_syntax = true; | 19255 i::FLAG_allow_natives_syntax = true; |
| 19256 i::FLAG_turbo_try_catch = true; | |
| 19257 v8::V8::Initialize(); | 19256 v8::V8::Initialize(); |
| 19258 v8::V8::SetFailedAccessCheckCallbackFunction(&FailedAccessCheckThrows); | 19257 v8::V8::SetFailedAccessCheckCallbackFunction(&FailedAccessCheckThrows); |
| 19259 v8::Isolate* isolate = CcTest::isolate(); | 19258 v8::Isolate* isolate = CcTest::isolate(); |
| 19260 v8::HandleScope scope(isolate); | 19259 v8::HandleScope scope(isolate); |
| 19261 | 19260 |
| 19262 // Create an ObjectTemplate for global objects and install access | 19261 // Create an ObjectTemplate for global objects and install access |
| 19263 // check callbacks that will block access. | 19262 // check callbacks that will block access. |
| 19264 v8::Handle<v8::ObjectTemplate> global_template = | 19263 v8::Handle<v8::ObjectTemplate> global_template = |
| 19265 v8::ObjectTemplate::New(isolate); | 19264 v8::ObjectTemplate::New(isolate); |
| 19266 global_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); | 19265 global_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); |
| (...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21851 timeout_thread.Join(); | 21850 timeout_thread.Join(); |
| 21852 } | 21851 } |
| 21853 | 21852 |
| 21854 | 21853 |
| 21855 TEST(EstimatedContextSize) { | 21854 TEST(EstimatedContextSize) { |
| 21856 v8::Isolate* isolate = CcTest::isolate(); | 21855 v8::Isolate* isolate = CcTest::isolate(); |
| 21857 v8::HandleScope scope(isolate); | 21856 v8::HandleScope scope(isolate); |
| 21858 LocalContext env; | 21857 LocalContext env; |
| 21859 CHECK(50000 < env->EstimatedSize()); | 21858 CHECK(50000 < env->EstimatedSize()); |
| 21860 } | 21859 } |
| OLD | NEW |