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

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

Issue 23513048: Don't lookup the cache for the result of Function::New (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
« src/apinatives.js ('K') | « src/apinatives.js ('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 f4e40cdd3844b35b03541eaa95abb91441546848..db861a55239de4d5cdd74d383599bb2584f26d9d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -20585,5 +20585,14 @@ THREADED_TEST(FunctionNew) {
i::Object* elm = i_isolate->native_context()->function_cache()
->GetElementNoExceptionThrown(i_isolate, serial_number);
CHECK(elm->IsNull());
yusukesuzuki 2013/09/13 05:52:00 This check expects `cache[serialNumber] = null;` i
+ // Verify that each Function::New creates a new function instance
+ Local<Object> data2 = v8::Object::New();
+ function_new_expected_env = data2;
+ Local<Function> func2 = Function::New(isolate, FunctionNewCallback, data2);
+ CHECK(!func2->IsNull());
+ CHECK_NE(func, func2);
+ env->Global()->Set(v8_str("func2"), func2);
+ Local<Value> result2 = CompileRun("func2();");
+ CHECK_EQ(v8::Integer::New(17, isolate), result2);
}
« src/apinatives.js ('K') | « src/apinatives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698