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

Side by Side Diff: test/cctest/test-accessors.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 | « src/isolate.cc ('k') | test/cctest/test-api.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 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 obj->NewInstance(env.local()).ToLocalChecked()) 679 obj->NewInstance(env.local()).ToLocalChecked())
680 .FromJust()); 680 .FromJust());
681 CompileRun( 681 CompileRun(
682 "Object.defineProperty(obj, 'prop', { writable: false });" 682 "Object.defineProperty(obj, 'prop', { writable: false });"
683 "Object.defineProperty(obj, 'prop', { writable: true });"); 683 "Object.defineProperty(obj, 'prop', { writable: true });");
684 } 684 }
685 685
686 686
687 static bool security_check_value = false; 687 static bool security_check_value = false;
688 688
689
690 static bool SecurityTestCallback(Local<v8::Context> accessing_context, 689 static bool SecurityTestCallback(Local<v8::Context> accessing_context,
691 Local<v8::Object> accessed_object) { 690 Local<v8::Object> accessed_object,
691 Local<v8::Value> data) {
692 return security_check_value; 692 return security_check_value;
693 } 693 }
694 694
695 695
696 TEST(PrototypeGetterAccessCheck) { 696 TEST(PrototypeGetterAccessCheck) {
697 i::FLAG_allow_natives_syntax = true; 697 i::FLAG_allow_natives_syntax = true;
698 LocalContext env; 698 LocalContext env;
699 v8::Isolate* isolate = env->GetIsolate(); 699 v8::Isolate* isolate = env->GetIsolate();
700 v8::HandleScope scope(isolate); 700 v8::HandleScope scope(isolate);
701 auto fun_templ = v8::FunctionTemplate::New(isolate); 701 auto fun_templ = v8::FunctionTemplate::New(isolate);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 767
768 security_check_value = true; 768 security_check_value = true;
769 ExpectInt32("f()", 907); 769 ExpectInt32("f()", 907);
770 security_check_value = false; 770 security_check_value = false;
771 { 771 {
772 v8::TryCatch try_catch(isolate); 772 v8::TryCatch try_catch(isolate);
773 CompileRun("f();"); 773 CompileRun("f();");
774 CHECK(try_catch.HasCaught()); 774 CHECK(try_catch.HasCaught());
775 } 775 }
776 } 776 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698