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

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

Issue 1653423002: Add the data parameter back to the access check callback (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-object-observe.cc » ('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 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
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
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
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 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698