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

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

Issue 1023783009: Revert of add access checks to receivers on function callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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-accessors.cc ('k') | no next file » | 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 8261 matching lines...) Expand 10 before | Expand all | Expand 10 after
8272 env2_global->TurnOnAccessCheck(); 8272 env2_global->TurnOnAccessCheck();
8273 env2->DetachGlobal(); 8273 env2->DetachGlobal();
8274 8274
8275 Local<Value> result; 8275 Local<Value> result;
8276 result = CompileRun("bound_x()"); 8276 result = CompileRun("bound_x()");
8277 CHECK(v8_str("env2_x")->Equals(result)); 8277 CHECK(v8_str("env2_x")->Equals(result));
8278 result = CompileRun("get_x()"); 8278 result = CompileRun("get_x()");
8279 CHECK(result.IsEmpty()); 8279 CHECK(result.IsEmpty());
8280 result = CompileRun("get_x_w()"); 8280 result = CompileRun("get_x_w()");
8281 CHECK(result.IsEmpty()); 8281 CHECK(result.IsEmpty());
8282 { 8282 result = CompileRun("this_x()");
8283 v8::TryCatch try_catch(env1->GetIsolate()); 8283 CHECK(v8_str("env2_x")->Equals(result));
8284 CompileRun("this_x()");
8285 CHECK(try_catch.HasCaught());
8286 }
8287 8284
8288 // Reattach env2's proxy 8285 // Reattach env2's proxy
8289 env2 = Context::New(env1->GetIsolate(), 8286 env2 = Context::New(env1->GetIsolate(),
8290 0, 8287 0,
8291 v8::Handle<v8::ObjectTemplate>(), 8288 v8::Handle<v8::ObjectTemplate>(),
8292 env2_global); 8289 env2_global);
8293 env2->SetSecurityToken(foo); 8290 env2->SetSecurityToken(foo);
8294 { 8291 {
8295 v8::Context::Scope scope(env2); 8292 v8::Context::Scope scope(env2);
8296 env2->Global()->Set(v8_str("x"), v8_str("env3_x")); 8293 env2->Global()->Set(v8_str("x"), v8_str("env3_x"));
(...skipping 13453 matching lines...) Expand 10 before | Expand all | Expand 10 after
21750 } 21747 }
21751 { 21748 {
21752 v8::TryCatch try_catch; 21749 v8::TryCatch try_catch;
21753 uint16_t* data = reinterpret_cast<uint16_t*>(buffer); 21750 uint16_t* data = reinterpret_cast<uint16_t*>(buffer);
21754 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString, 21751 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString,
21755 length).IsEmpty()); 21752 length).IsEmpty());
21756 CHECK(!try_catch.HasCaught()); 21753 CHECK(!try_catch.HasCaught());
21757 } 21754 }
21758 free(buffer); 21755 free(buffer);
21759 } 21756 }
OLDNEW
« no previous file with comments | « test/cctest/test-accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698