| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "test/cctest/test-api.h" | 7 #include "test/cctest/test-api.h" |
| 8 | 8 |
| 9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
| 10 #include "src/api.h" | 10 #include "src/api.h" |
| (...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 " var v = obj[0];" | 1872 " var v = obj[0];" |
| 1873 " if (v != 0) throw 'Wrong value ' + v + ' at iteration ' + i;" | 1873 " if (v != 0) throw 'Wrong value ' + v + ' at iteration ' + i;" |
| 1874 " }" | 1874 " }" |
| 1875 " 'PASSED'" | 1875 " 'PASSED'" |
| 1876 "} catch(e) {" | 1876 "} catch(e) {" |
| 1877 " e" | 1877 " e" |
| 1878 "}"; | 1878 "}"; |
| 1879 ExpectString(code, "PASSED"); | 1879 ExpectString(code, "PASSED"); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 | |
| 1883 static bool AccessAlwaysBlocked(Local<v8::Context> accessing_context, | 1882 static bool AccessAlwaysBlocked(Local<v8::Context> accessing_context, |
| 1884 Local<v8::Object> accessed_object) { | 1883 Local<v8::Object> accessed_object, |
| 1884 Local<v8::Value> data) { |
| 1885 return false; | 1885 return false; |
| 1886 } | 1886 } |
| 1887 | 1887 |
| 1888 | 1888 |
| 1889 THREADED_TEST(IndexedInterceptorWithAccessorCheck) { | 1889 THREADED_TEST(IndexedInterceptorWithAccessorCheck) { |
| 1890 v8::Isolate* isolate = CcTest::isolate(); | 1890 v8::Isolate* isolate = CcTest::isolate(); |
| 1891 v8::HandleScope scope(isolate); | 1891 v8::HandleScope scope(isolate); |
| 1892 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); | 1892 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); |
| 1893 templ->SetHandler( | 1893 templ->SetHandler( |
| 1894 v8::IndexedPropertyHandlerConfiguration(IdentityIndexedPropertyGetter)); | 1894 v8::IndexedPropertyHandlerConfiguration(IdentityIndexedPropertyGetter)); |
| (...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3468 } | 3468 } |
| 3469 | 3469 |
| 3470 | 3470 |
| 3471 struct AccessCheckData { | 3471 struct AccessCheckData { |
| 3472 int count; | 3472 int count; |
| 3473 bool result; | 3473 bool result; |
| 3474 }; | 3474 }; |
| 3475 | 3475 |
| 3476 AccessCheckData* g_access_check_data = nullptr; | 3476 AccessCheckData* g_access_check_data = nullptr; |
| 3477 | 3477 |
| 3478 | |
| 3479 bool SimpleAccessChecker(Local<v8::Context> accessing_context, | 3478 bool SimpleAccessChecker(Local<v8::Context> accessing_context, |
| 3480 Local<v8::Object> access_object) { | 3479 Local<v8::Object> access_object, |
| 3480 Local<v8::Value> data) { |
| 3481 g_access_check_data->count++; | 3481 g_access_check_data->count++; |
| 3482 return g_access_check_data->result; | 3482 return g_access_check_data->result; |
| 3483 } | 3483 } |
| 3484 | 3484 |
| 3485 | 3485 |
| 3486 struct ShouldInterceptData { | 3486 struct ShouldInterceptData { |
| 3487 int value; | 3487 int value; |
| 3488 bool should_intercept; | 3488 bool should_intercept; |
| 3489 }; | 3489 }; |
| 3490 | 3490 |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3881 "var obj = intercepted_1;" | 3881 "var obj = intercepted_1;" |
| 3882 "obj.x = 4;" | 3882 "obj.x = 4;" |
| 3883 "eval('obj.x');" | 3883 "eval('obj.x');" |
| 3884 "eval('obj.x');" | 3884 "eval('obj.x');" |
| 3885 "eval('obj.x');" | 3885 "eval('obj.x');" |
| 3886 "obj = intercepted_2;" | 3886 "obj = intercepted_2;" |
| 3887 "obj.x = 9;" | 3887 "obj.x = 9;" |
| 3888 "eval('obj.x');", | 3888 "eval('obj.x');", |
| 3889 9); | 3889 9); |
| 3890 } | 3890 } |
| OLD | NEW |