Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index c694ae38ad7f1f0a24e980a129360b186da3ecb6..d7ba7d7c7d57723959a0dde244778ff116e141ec 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -14595,6 +14595,24 @@ THREADED_TEST(CreationContext) { |
} |
+THREADED_TEST(CreationContextOfJsFunction) { |
+ HandleScope handle_scope; |
+ Persistent<Context> context = Context::New(); |
+ InstallContextId(context, 1); |
+ |
+ Local<Object> function; |
+ { |
+ Context::Scope scope(context); |
+ function = CompileRun("function foo() {}; foo").As<Object>(); |
+ } |
+ |
+ CHECK(function->CreationContext() == context); |
+ CheckContextId(function, 1); |
+ |
+ context.Dispose(); |
+} |
+ |
+ |
Handle<Value> HasOwnPropertyIndexedPropertyGetter(uint32_t index, |
const AccessorInfo& info) { |
if (index == 42) return v8_str("yes"); |