| 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());
|
| + // 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);
|
| }
|
|
|
|
|