Index: test/cctest/test-object-observe.cc |
diff --git a/test/cctest/test-object-observe.cc b/test/cctest/test-object-observe.cc |
index 196636d5b17528c0e89404c7b9d98b962901941a..5e11042452e2c1315dfec4f1090e222a470afeba 100644 |
--- a/test/cctest/test-object-observe.cc |
+++ b/test/cctest/test-object-observe.cc |
@@ -58,7 +58,7 @@ class HarmonyIsolate { |
TEST(PerIsolateState) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context1; |
+ LocalContext context1(isolate.GetIsolate()); |
CompileRun( |
"var count = 0;" |
"var calls = 0;" |
@@ -71,20 +71,20 @@ TEST(PerIsolateState) { |
"(function() { obj.foo = 'bar'; })"); |
Handle<Value> notify_fun2; |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), obj); |
notify_fun2 = CompileRun( |
"(function() { obj.foo = 'baz'; })"); |
} |
Handle<Value> notify_fun3; |
{ |
- LocalContext context3; |
+ LocalContext context3(isolate.GetIsolate()); |
context3->Global()->Set(String::New("obj"), obj); |
notify_fun3 = CompileRun( |
"(function() { obj.foo = 'bat'; })"); |
} |
{ |
- LocalContext context4; |
+ LocalContext context4(isolate.GetIsolate()); |
context4->Global()->Set(String::New("observer"), observer); |
context4->Global()->Set(String::New("fun1"), notify_fun1); |
context4->Global()->Set(String::New("fun2"), notify_fun2); |
@@ -99,7 +99,7 @@ TEST(PerIsolateState) { |
TEST(EndOfMicrotaskDelivery) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
CompileRun( |
"var obj = {};" |
"var count = 0;" |
@@ -113,7 +113,7 @@ TEST(EndOfMicrotaskDelivery) { |
TEST(DeliveryOrdering) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
CompileRun( |
"var obj1 = {};" |
"var obj2 = {};" |
@@ -145,7 +145,7 @@ TEST(DeliveryOrdering) { |
TEST(DeliveryOrderingReentrant) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
CompileRun( |
"var obj = {};" |
"var reentered = false;" |
@@ -177,7 +177,7 @@ TEST(DeliveryOrderingReentrant) { |
TEST(DeliveryOrderingDeliverChangeRecords) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
CompileRun( |
"var obj = {};" |
"var ordering = [];" |
@@ -203,14 +203,14 @@ TEST(ObjectHashTableGrowth) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
// Initializing this context sets up initial hash tables. |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
Handle<Value> obj = CompileRun("obj = {};"); |
Handle<Value> observer = CompileRun( |
"var ran = false;" |
"(function() { ran = true })"); |
{ |
// As does initializing this context. |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), obj); |
context2->Global()->Set(String::New("observer"), observer); |
CompileRun( |
@@ -231,7 +231,7 @@ TEST(ObjectHashTableGrowth) { |
TEST(GlobalObjectObservation) { |
HarmonyIsolate isolate; |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
HandleScope scope(isolate.GetIsolate()); |
Handle<Object> global_proxy = context->Global(); |
Handle<Object> inner_global = global_proxy->GetPrototype().As<Object>(); |
@@ -263,7 +263,7 @@ TEST(GlobalObjectObservation) { |
// to the old context. |
context->DetachGlobal(); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->DetachGlobal(); |
context2->ReattachGlobal(global_proxy); |
CompileRun( |
@@ -278,7 +278,8 @@ TEST(GlobalObjectObservation) { |
// Attaching by passing to Context::New |
{ |
// Delegates to Context::New |
- LocalContext context3(NULL, Handle<ObjectTemplate>(), global_proxy); |
+ LocalContext context3( |
+ isolate.GetIsolate(), NULL, Handle<ObjectTemplate>(), global_proxy); |
CompileRun( |
"var records3 = [];" |
"Object.observe(this, function(r) { [].push.apply(records3, r) });" |
@@ -330,7 +331,7 @@ static void ExpectRecords(Handle<Value> records, |
TEST(APITestBasicMutation) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
Handle<Object> obj = Handle<Object>::Cast(CompileRun( |
"var records = [];" |
"var obj = {};" |
@@ -374,7 +375,7 @@ TEST(APITestBasicMutation) { |
TEST(HiddenPrototypeObservation) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
Handle<FunctionTemplate> tmpl = FunctionTemplate::New(); |
tmpl->SetHiddenPrototype(true); |
tmpl->InstanceTemplate()->Set(String::New("foo"), Number::New(75)); |
@@ -423,7 +424,7 @@ static int NumberOfElements(i::Handle<i::JSWeakMap> map) { |
TEST(ObservationWeakMap) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
CompileRun( |
"var obj = {};" |
"Object.observe(obj, function(){});" |
@@ -517,7 +518,7 @@ TEST(NamedAccessCheck) { |
const AccessType types[] = { ACCESS_GET, ACCESS_HAS }; |
for (size_t i = 0; i < ARRAY_SIZE(types); ++i) { |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
g_access_block_type = types[i]; |
Handle<Object> instance = CreateAccessCheckedObject( |
NamedAccessAllowUnlessBlocked, IndexedAccessAlwaysAllowed); |
@@ -529,7 +530,7 @@ TEST(NamedAccessCheck) { |
"Object.observe(objNoCheck, observer);"); |
Handle<Value> obj_no_check = CompileRun("objNoCheck"); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), instance); |
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); |
CompileRun("var records2 = null;" |
@@ -564,7 +565,7 @@ TEST(IndexedAccessCheck) { |
const AccessType types[] = { ACCESS_GET, ACCESS_HAS }; |
for (size_t i = 0; i < ARRAY_SIZE(types); ++i) { |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
g_access_block_type = types[i]; |
Handle<Object> instance = CreateAccessCheckedObject( |
NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked); |
@@ -576,7 +577,7 @@ TEST(IndexedAccessCheck) { |
"Object.observe(objNoCheck, observer);"); |
Handle<Value> obj_no_check = CompileRun("objNoCheck"); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), instance); |
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); |
CompileRun("var records2 = null;" |
@@ -609,7 +610,7 @@ TEST(IndexedAccessCheck) { |
TEST(SpliceAccessCheck) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
g_access_block_type = ACCESS_GET; |
Handle<Object> instance = CreateAccessCheckedObject( |
NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked); |
@@ -623,7 +624,7 @@ TEST(SpliceAccessCheck) { |
"Array.observe(objNoCheck, observer);"); |
Handle<Value> obj_no_check = CompileRun("objNoCheck"); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), instance); |
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); |
CompileRun("var records2 = null;" |
@@ -654,7 +655,7 @@ TEST(SpliceAccessCheck) { |
TEST(DisallowAllForAccessKeys) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
Handle<Object> instance = CreateAccessCheckedObject( |
BlockAccessKeys, IndexedAccessAlwaysAllowed); |
CompileRun("var records = null;" |
@@ -665,7 +666,7 @@ TEST(DisallowAllForAccessKeys) { |
"Object.observe(objNoCheck, observer);"); |
Handle<Value> obj_no_check = CompileRun("objNoCheck"); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), instance); |
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); |
CompileRun("var records2 = null;" |
@@ -692,7 +693,7 @@ TEST(DisallowAllForAccessKeys) { |
TEST(AccessCheckDisallowApiModifications) { |
HarmonyIsolate isolate; |
HandleScope scope(isolate.GetIsolate()); |
- LocalContext context; |
+ LocalContext context(isolate.GetIsolate()); |
Handle<Object> instance = CreateAccessCheckedObject( |
BlockAccessKeys, IndexedAccessAlwaysAllowed); |
CompileRun("var records = null;" |
@@ -700,7 +701,7 @@ TEST(AccessCheckDisallowApiModifications) { |
"var blacklist = {__block_access_keys: true};" |
"Object.observe(obj, observer);"); |
{ |
- LocalContext context2; |
+ LocalContext context2(isolate.GetIsolate()); |
context2->Global()->Set(String::New("obj"), instance); |
CompileRun("var records2 = null;" |
"var observer2 = function(r) { records2 = r };" |