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

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

Issue 172043: Context-independent script compilation. (Closed)
Patch Set: Created 11 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/api.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 35ac031a55171b733607ad36cbc058ab47699599..e0c9f3eb65b4d35db49356e965cbb08f5ac3b6e9 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -7738,3 +7738,18 @@ THREADED_TEST(PixelArray) {
free(pixel_data);
}
+
+THREADED_TEST(ScriptContextDependence) {
+ v8::HandleScope scope;
+ LocalContext c1;
+ const char *source = "foo";
+ v8::Handle<v8::Script> dep = v8::Script::Compile(v8::String::New(source));
+ v8::Handle<v8::Script> indep = v8::Script::New(v8::String::New(source));
+ c1->Global()->Set(v8::String::New("foo"), v8::Integer::New(100));
+ CHECK_EQ(dep->Run()->Int32Value(), 100);
+ CHECK_EQ(indep->Run()->Int32Value(), 100);
+ LocalContext c2;
+ c2->Global()->Set(v8::String::New("foo"), v8::Integer::New(101));
+ CHECK_EQ(dep->Run()->Int32Value(), 100);
+ CHECK_EQ(indep->Run()->Int32Value(), 101);
+}
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698