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

Unified Diff: test/cctest/test-api.cc

Issue 2199343002: Do an access check before compiling code via eval() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-global.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 1cebdf0bf276a1c6f2c78ae4826f1579b37c386a..0076a36b4889ae446a637448888d60c59f4a5262 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -11676,6 +11676,9 @@ THREADED_TEST(EvalInDetachedGlobal) {
v8::Local<Context> context0 = Context::New(isolate);
v8::Local<Context> context1 = Context::New(isolate);
+ Local<String> token = v8_str("<security token>");
+ context0->SetSecurityToken(token);
+ context1->SetSecurityToken(token);
// Set up function in context0 that uses eval from context0.
context0->Enter();
@@ -11689,15 +11692,14 @@ THREADED_TEST(EvalInDetachedGlobal) {
// Put the function into context1 and call it before and after
// detaching the global. Before detaching, the call succeeds and
- // after detaching and exception is thrown.
+ // after detaching undefined is returned.
context1->Enter();
CHECK(context1->Global()->Set(context1, v8_str("fun"), fun).FromJust());
v8::Local<v8::Value> x_value = CompileRun("fun('x')");
CHECK_EQ(42, x_value->Int32Value(context1).FromJust());
context0->DetachGlobal();
- v8::TryCatch catcher(isolate);
x_value = CompileRun("fun('x')");
- CHECK_EQ(42, x_value->Int32Value(context1).FromJust());
+ CHECK(x_value->IsUndefined());
context1->Exit();
}
« no previous file with comments | « src/builtins/builtins-global.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698