| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 8af41b6601c1f39bf82d43c38c23e523cbeaae9e..08d804c06f0b0e27926e8561b9e40d3436bf9702 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -17919,18 +17919,22 @@ THREADED_TEST(CreationContext) {
|
| instance2 = func2->NewInstance();
|
| }
|
|
|
| - CHECK(object1->CreationContext() == context1);
|
| - CheckContextId(object1, 1);
|
| - CHECK(func1->CreationContext() == context1);
|
| - CheckContextId(func1, 1);
|
| - CHECK(instance1->CreationContext() == context1);
|
| - CheckContextId(instance1, 1);
|
| - CHECK(object2->CreationContext() == context2);
|
| - CheckContextId(object2, 2);
|
| - CHECK(func2->CreationContext() == context2);
|
| - CheckContextId(func2, 2);
|
| - CHECK(instance2->CreationContext() == context2);
|
| - CheckContextId(instance2, 2);
|
| + {
|
| + Handle<Context> other_context = Context::New(isolate);
|
| + Context::Scope scope(other_context);
|
| + CHECK(object1->CreationContext() == context1);
|
| + CheckContextId(object1, 1);
|
| + CHECK(func1->CreationContext() == context1);
|
| + CheckContextId(func1, 1);
|
| + CHECK(instance1->CreationContext() == context1);
|
| + CheckContextId(instance1, 1);
|
| + CHECK(object2->CreationContext() == context2);
|
| + CheckContextId(object2, 2);
|
| + CHECK(func2->CreationContext() == context2);
|
| + CheckContextId(func2, 2);
|
| + CHECK(instance2->CreationContext() == context2);
|
| + CheckContextId(instance2, 2);
|
| + }
|
|
|
| {
|
| Context::Scope scope(context1);
|
| @@ -17977,6 +17981,8 @@ THREADED_TEST(CreationContextOfJsFunction) {
|
| function = CompileRun("function foo() {}; foo").As<Object>();
|
| }
|
|
|
| + Handle<Context> other_context = Context::New(CcTest::isolate());
|
| + Context::Scope scope(other_context);
|
| CHECK(function->CreationContext() == context);
|
| CheckContextId(function, 1);
|
| }
|
|
|