Commit c8c6cfe5 authored by dcarney@chromium.org's avatar dcarney@chromium.org

remove GetCurrent from LocalContext

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/24271002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16824 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 15408ba0
...@@ -220,20 +220,19 @@ class RegisterThreadedTest { ...@@ -220,20 +220,19 @@ class RegisterThreadedTest {
// A LocalContext holds a reference to a v8::Context. // A LocalContext holds a reference to a v8::Context.
class LocalContext { class LocalContext {
public: public:
LocalContext(v8::Isolate* isolate,
v8::ExtensionConfiguration* extensions = 0,
v8::Handle<v8::ObjectTemplate> global_template =
v8::Handle<v8::ObjectTemplate>(),
v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>()) {
Initialize(isolate, extensions, global_template, global_object);
}
LocalContext(v8::ExtensionConfiguration* extensions = 0, LocalContext(v8::ExtensionConfiguration* extensions = 0,
v8::Handle<v8::ObjectTemplate> global_template = v8::Handle<v8::ObjectTemplate> global_template =
v8::Handle<v8::ObjectTemplate>(), v8::Handle<v8::ObjectTemplate>(),
v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>()) { v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>()) {
v8::Isolate* isolate = v8::Isolate::GetCurrent(); Initialize(CcTest::isolate(), extensions, global_template, global_object);
v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate,
extensions,
global_template,
global_object);
context_.Reset(isolate, context);
context->Enter();
// We can't do this later perhaps because of a fatal error.
isolate_ = context->GetIsolate();
} }
virtual ~LocalContext() { virtual ~LocalContext() {
...@@ -253,6 +252,21 @@ class LocalContext { ...@@ -253,6 +252,21 @@ class LocalContext {
} }
private: private:
void Initialize(v8::Isolate* isolate,
v8::ExtensionConfiguration* extensions,
v8::Handle<v8::ObjectTemplate> global_template,
v8::Handle<v8::Value> global_object) {
v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate,
extensions,
global_template,
global_object);
context_.Reset(isolate, context);
context->Enter();
// We can't do this later perhaps because of a fatal error.
isolate_ = isolate;
}
v8::Persistent<v8::Context> context_; v8::Persistent<v8::Context> context_;
v8::Isolate* isolate_; v8::Isolate* isolate_;
}; };
......
...@@ -13364,7 +13364,7 @@ static void event_handler(const v8::JitCodeEvent* event) { ...@@ -13364,7 +13364,7 @@ static void event_handler(const v8::JitCodeEvent* event) {
} }
TEST(SetJitCodeEventHandler) { UNINITIALIZED_TEST(SetJitCodeEventHandler) {
i::FLAG_stress_compaction = true; i::FLAG_stress_compaction = true;
i::FLAG_incremental_marking = false; i::FLAG_incremental_marking = false;
const char* script = const char* script =
...@@ -13400,7 +13400,7 @@ TEST(SetJitCodeEventHandler) { ...@@ -13400,7 +13400,7 @@ TEST(SetJitCodeEventHandler) {
// different fragmented code-space pages. // different fragmented code-space pages.
const int kIterations = 10; const int kIterations = 10;
for (int i = 0; i < kIterations; ++i) { for (int i = 0; i < kIterations; ++i) {
LocalContext env; LocalContext env(isolate);
i::AlwaysAllocateScope always_allocate; i::AlwaysAllocateScope always_allocate;
SimulateFullSpace(heap->code_space()); SimulateFullSpace(heap->code_space());
CompileRun(script); CompileRun(script);
...@@ -13438,7 +13438,7 @@ TEST(SetJitCodeEventHandler) { ...@@ -13438,7 +13438,7 @@ TEST(SetJitCodeEventHandler) {
// request enumeration of existing code. // request enumeration of existing code.
{ {
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
LocalContext env; LocalContext env(isolate);
CompileRun(script); CompileRun(script);
// Now get code through initial iteration. // Now get code through initial iteration.
...@@ -18221,7 +18221,7 @@ UNINITIALIZED_TEST(DisposeIsolateWhenInUse) { ...@@ -18221,7 +18221,7 @@ UNINITIALIZED_TEST(DisposeIsolateWhenInUse) {
CHECK(isolate); CHECK(isolate);
isolate->Enter(); isolate->Enter();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
LocalContext context; LocalContext context(isolate);
// Run something in this isolate. // Run something in this isolate.
ExpectTrue("true"); ExpectTrue("true");
v8::V8::SetFatalErrorHandler(StoringErrorCallback); v8::V8::SetFatalErrorHandler(StoringErrorCallback);
...@@ -18361,7 +18361,7 @@ TEST(RunTwoIsolatesOnSingleThread) { ...@@ -18361,7 +18361,7 @@ TEST(RunTwoIsolatesOnSingleThread) {
static int CalcFibonacci(v8::Isolate* isolate, int limit) { static int CalcFibonacci(v8::Isolate* isolate, int limit) {
v8::Isolate::Scope isolate_scope(isolate); v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
LocalContext context; LocalContext context(isolate);
i::ScopedVector<char> code(1024); i::ScopedVector<char> code(1024);
i::OS::SNPrintF(code, "function fib(n) {" i::OS::SNPrintF(code, "function fib(n) {"
" if (n <= 2) return 1;" " if (n <= 2) return 1;"
......
...@@ -183,7 +183,7 @@ class IsolateLockingThreadWithLocalContext : public JoinableThread { ...@@ -183,7 +183,7 @@ class IsolateLockingThreadWithLocalContext : public JoinableThread {
v8::Locker locker(isolate_); v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_); v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_); v8::HandleScope handle_scope(isolate_);
LocalContext local_context; LocalContext local_context(isolate_);
CHECK_EQ(isolate_, v8::internal::Isolate::Current()); CHECK_EQ(isolate_, v8::internal::Isolate::Current());
CalcFibAndCheck(); CalcFibAndCheck();
} }
...@@ -267,7 +267,7 @@ class IsolateNestedLockingThread : public JoinableThread { ...@@ -267,7 +267,7 @@ class IsolateNestedLockingThread : public JoinableThread {
v8::Locker lock(isolate_); v8::Locker lock(isolate_);
v8::Isolate::Scope isolate_scope(isolate_); v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_); v8::HandleScope handle_scope(isolate_);
LocalContext local_context; LocalContext local_context(isolate_);
{ {
v8::Locker another_lock(isolate_); v8::Locker another_lock(isolate_);
CalcFibAndCheck(); CalcFibAndCheck();
...@@ -311,7 +311,7 @@ class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread { ...@@ -311,7 +311,7 @@ class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread {
v8::Locker lock(isolate1_); v8::Locker lock(isolate1_);
v8::Isolate::Scope isolate_scope(isolate1_); v8::Isolate::Scope isolate_scope(isolate1_);
v8::HandleScope handle_scope(isolate1_); v8::HandleScope handle_scope(isolate1_);
LocalContext local_context; LocalContext local_context(isolate1_);
IsolateLockingThreadWithLocalContext threadB(isolate2_); IsolateLockingThreadWithLocalContext threadB(isolate2_);
threadB.Start(); threadB.Start();
......
...@@ -58,7 +58,7 @@ class HarmonyIsolate { ...@@ -58,7 +58,7 @@ class HarmonyIsolate {
TEST(PerIsolateState) { TEST(PerIsolateState) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context1; LocalContext context1(isolate.GetIsolate());
CompileRun( CompileRun(
"var count = 0;" "var count = 0;"
"var calls = 0;" "var calls = 0;"
...@@ -71,20 +71,20 @@ TEST(PerIsolateState) { ...@@ -71,20 +71,20 @@ TEST(PerIsolateState) {
"(function() { obj.foo = 'bar'; })"); "(function() { obj.foo = 'bar'; })");
Handle<Value> notify_fun2; Handle<Value> notify_fun2;
{ {
LocalContext context2; LocalContext context2(isolate.GetIsolate());
context2->Global()->Set(String::New("obj"), obj); context2->Global()->Set(String::New("obj"), obj);
notify_fun2 = CompileRun( notify_fun2 = CompileRun(
"(function() { obj.foo = 'baz'; })"); "(function() { obj.foo = 'baz'; })");
} }
Handle<Value> notify_fun3; Handle<Value> notify_fun3;
{ {
LocalContext context3; LocalContext context3(isolate.GetIsolate());
context3->Global()->Set(String::New("obj"), obj); context3->Global()->Set(String::New("obj"), obj);
notify_fun3 = CompileRun( notify_fun3 = CompileRun(
"(function() { obj.foo = 'bat'; })"); "(function() { obj.foo = 'bat'; })");
} }
{ {
LocalContext context4; LocalContext context4(isolate.GetIsolate());
context4->Global()->Set(String::New("observer"), observer); context4->Global()->Set(String::New("observer"), observer);
context4->Global()->Set(String::New("fun1"), notify_fun1); context4->Global()->Set(String::New("fun1"), notify_fun1);
context4->Global()->Set(String::New("fun2"), notify_fun2); context4->Global()->Set(String::New("fun2"), notify_fun2);
...@@ -99,7 +99,7 @@ TEST(PerIsolateState) { ...@@ -99,7 +99,7 @@ TEST(PerIsolateState) {
TEST(EndOfMicrotaskDelivery) { TEST(EndOfMicrotaskDelivery) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
CompileRun( CompileRun(
"var obj = {};" "var obj = {};"
"var count = 0;" "var count = 0;"
...@@ -113,7 +113,7 @@ TEST(EndOfMicrotaskDelivery) { ...@@ -113,7 +113,7 @@ TEST(EndOfMicrotaskDelivery) {
TEST(DeliveryOrdering) { TEST(DeliveryOrdering) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
CompileRun( CompileRun(
"var obj1 = {};" "var obj1 = {};"
"var obj2 = {};" "var obj2 = {};"
...@@ -145,7 +145,7 @@ TEST(DeliveryOrdering) { ...@@ -145,7 +145,7 @@ TEST(DeliveryOrdering) {
TEST(DeliveryOrderingReentrant) { TEST(DeliveryOrderingReentrant) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
CompileRun( CompileRun(
"var obj = {};" "var obj = {};"
"var reentered = false;" "var reentered = false;"
...@@ -177,7 +177,7 @@ TEST(DeliveryOrderingReentrant) { ...@@ -177,7 +177,7 @@ TEST(DeliveryOrderingReentrant) {
TEST(DeliveryOrderingDeliverChangeRecords) { TEST(DeliveryOrderingDeliverChangeRecords) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
CompileRun( CompileRun(
"var obj = {};" "var obj = {};"
"var ordering = [];" "var ordering = [];"
...@@ -203,14 +203,14 @@ TEST(ObjectHashTableGrowth) { ...@@ -203,14 +203,14 @@ TEST(ObjectHashTableGrowth) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
// Initializing this context sets up initial hash tables. // Initializing this context sets up initial hash tables.
LocalContext context; LocalContext context(isolate.GetIsolate());
Handle<Value> obj = CompileRun("obj = {};"); Handle<Value> obj = CompileRun("obj = {};");
Handle<Value> observer = CompileRun( Handle<Value> observer = CompileRun(
"var ran = false;" "var ran = false;"
"(function() { ran = true })"); "(function() { ran = true })");
{ {
// As does initializing this context. // As does initializing this context.
LocalContext context2; LocalContext context2(isolate.GetIsolate());
context2->Global()->Set(String::New("obj"), obj); context2->Global()->Set(String::New("obj"), obj);
context2->Global()->Set(String::New("observer"), observer); context2->Global()->Set(String::New("observer"), observer);
CompileRun( CompileRun(
...@@ -231,7 +231,7 @@ TEST(ObjectHashTableGrowth) { ...@@ -231,7 +231,7 @@ TEST(ObjectHashTableGrowth) {
TEST(GlobalObjectObservation) { TEST(GlobalObjectObservation) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
LocalContext context; LocalContext context(isolate.GetIsolate());
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
Handle<Object> global_proxy = context->Global(); Handle<Object> global_proxy = context->Global();
Handle<Object> inner_global = global_proxy->GetPrototype().As<Object>(); Handle<Object> inner_global = global_proxy->GetPrototype().As<Object>();
...@@ -263,7 +263,7 @@ TEST(GlobalObjectObservation) { ...@@ -263,7 +263,7 @@ TEST(GlobalObjectObservation) {
// to the old context. // to the old context.
context->DetachGlobal(); context->DetachGlobal();
{ {
LocalContext context2; LocalContext context2(isolate.GetIsolate());
context2->DetachGlobal(); context2->DetachGlobal();
context2->ReattachGlobal(global_proxy); context2->ReattachGlobal(global_proxy);
CompileRun( CompileRun(
...@@ -278,7 +278,8 @@ TEST(GlobalObjectObservation) { ...@@ -278,7 +278,8 @@ TEST(GlobalObjectObservation) {
// Attaching by passing to Context::New // Attaching by passing to Context::New
{ {
// Delegates to Context::New // Delegates to Context::New
LocalContext context3(NULL, Handle<ObjectTemplate>(), global_proxy); LocalContext context3(
isolate.GetIsolate(), NULL, Handle<ObjectTemplate>(), global_proxy);
CompileRun( CompileRun(
"var records3 = [];" "var records3 = [];"
"Object.observe(this, function(r) { [].push.apply(records3, r) });" "Object.observe(this, function(r) { [].push.apply(records3, r) });"
...@@ -330,7 +331,7 @@ static void ExpectRecords(Handle<Value> records, ...@@ -330,7 +331,7 @@ static void ExpectRecords(Handle<Value> records,
TEST(APITestBasicMutation) { TEST(APITestBasicMutation) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
Handle<Object> obj = Handle<Object>::Cast(CompileRun( Handle<Object> obj = Handle<Object>::Cast(CompileRun(
"var records = [];" "var records = [];"
"var obj = {};" "var obj = {};"
...@@ -374,7 +375,7 @@ TEST(APITestBasicMutation) { ...@@ -374,7 +375,7 @@ TEST(APITestBasicMutation) {
TEST(HiddenPrototypeObservation) { TEST(HiddenPrototypeObservation) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
Handle<FunctionTemplate> tmpl = FunctionTemplate::New(); Handle<FunctionTemplate> tmpl = FunctionTemplate::New();
tmpl->SetHiddenPrototype(true); tmpl->SetHiddenPrototype(true);
tmpl->InstanceTemplate()->Set(String::New("foo"), Number::New(75)); tmpl->InstanceTemplate()->Set(String::New("foo"), Number::New(75));
...@@ -423,7 +424,7 @@ static int NumberOfElements(i::Handle<i::JSWeakMap> map) { ...@@ -423,7 +424,7 @@ static int NumberOfElements(i::Handle<i::JSWeakMap> map) {
TEST(ObservationWeakMap) { TEST(ObservationWeakMap) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
CompileRun( CompileRun(
"var obj = {};" "var obj = {};"
"Object.observe(obj, function(){});" "Object.observe(obj, function(){});"
...@@ -517,7 +518,7 @@ TEST(NamedAccessCheck) { ...@@ -517,7 +518,7 @@ TEST(NamedAccessCheck) {
const AccessType types[] = { ACCESS_GET, ACCESS_HAS }; const AccessType types[] = { ACCESS_GET, ACCESS_HAS };
for (size_t i = 0; i < ARRAY_SIZE(types); ++i) { for (size_t i = 0; i < ARRAY_SIZE(types); ++i) {
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
g_access_block_type = types[i]; g_access_block_type = types[i];
Handle<Object> instance = CreateAccessCheckedObject( Handle<Object> instance = CreateAccessCheckedObject(
NamedAccessAllowUnlessBlocked, IndexedAccessAlwaysAllowed); NamedAccessAllowUnlessBlocked, IndexedAccessAlwaysAllowed);
...@@ -529,7 +530,7 @@ TEST(NamedAccessCheck) { ...@@ -529,7 +530,7 @@ TEST(NamedAccessCheck) {
"Object.observe(objNoCheck, observer);"); "Object.observe(objNoCheck, observer);");
Handle<Value> obj_no_check = CompileRun("objNoCheck"); 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("obj"), instance);
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); context2->Global()->Set(String::New("objNoCheck"), obj_no_check);
CompileRun("var records2 = null;" CompileRun("var records2 = null;"
...@@ -564,7 +565,7 @@ TEST(IndexedAccessCheck) { ...@@ -564,7 +565,7 @@ TEST(IndexedAccessCheck) {
const AccessType types[] = { ACCESS_GET, ACCESS_HAS }; const AccessType types[] = { ACCESS_GET, ACCESS_HAS };
for (size_t i = 0; i < ARRAY_SIZE(types); ++i) { for (size_t i = 0; i < ARRAY_SIZE(types); ++i) {
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
g_access_block_type = types[i]; g_access_block_type = types[i];
Handle<Object> instance = CreateAccessCheckedObject( Handle<Object> instance = CreateAccessCheckedObject(
NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked); NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked);
...@@ -576,7 +577,7 @@ TEST(IndexedAccessCheck) { ...@@ -576,7 +577,7 @@ TEST(IndexedAccessCheck) {
"Object.observe(objNoCheck, observer);"); "Object.observe(objNoCheck, observer);");
Handle<Value> obj_no_check = CompileRun("objNoCheck"); 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("obj"), instance);
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); context2->Global()->Set(String::New("objNoCheck"), obj_no_check);
CompileRun("var records2 = null;" CompileRun("var records2 = null;"
...@@ -609,7 +610,7 @@ TEST(IndexedAccessCheck) { ...@@ -609,7 +610,7 @@ TEST(IndexedAccessCheck) {
TEST(SpliceAccessCheck) { TEST(SpliceAccessCheck) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
g_access_block_type = ACCESS_GET; g_access_block_type = ACCESS_GET;
Handle<Object> instance = CreateAccessCheckedObject( Handle<Object> instance = CreateAccessCheckedObject(
NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked); NamedAccessAlwaysAllowed, IndexedAccessAllowUnlessBlocked);
...@@ -623,7 +624,7 @@ TEST(SpliceAccessCheck) { ...@@ -623,7 +624,7 @@ TEST(SpliceAccessCheck) {
"Array.observe(objNoCheck, observer);"); "Array.observe(objNoCheck, observer);");
Handle<Value> obj_no_check = CompileRun("objNoCheck"); 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("obj"), instance);
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); context2->Global()->Set(String::New("objNoCheck"), obj_no_check);
CompileRun("var records2 = null;" CompileRun("var records2 = null;"
...@@ -654,7 +655,7 @@ TEST(SpliceAccessCheck) { ...@@ -654,7 +655,7 @@ TEST(SpliceAccessCheck) {
TEST(DisallowAllForAccessKeys) { TEST(DisallowAllForAccessKeys) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
Handle<Object> instance = CreateAccessCheckedObject( Handle<Object> instance = CreateAccessCheckedObject(
BlockAccessKeys, IndexedAccessAlwaysAllowed); BlockAccessKeys, IndexedAccessAlwaysAllowed);
CompileRun("var records = null;" CompileRun("var records = null;"
...@@ -665,7 +666,7 @@ TEST(DisallowAllForAccessKeys) { ...@@ -665,7 +666,7 @@ TEST(DisallowAllForAccessKeys) {
"Object.observe(objNoCheck, observer);"); "Object.observe(objNoCheck, observer);");
Handle<Value> obj_no_check = CompileRun("objNoCheck"); 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("obj"), instance);
context2->Global()->Set(String::New("objNoCheck"), obj_no_check); context2->Global()->Set(String::New("objNoCheck"), obj_no_check);
CompileRun("var records2 = null;" CompileRun("var records2 = null;"
...@@ -692,7 +693,7 @@ TEST(DisallowAllForAccessKeys) { ...@@ -692,7 +693,7 @@ TEST(DisallowAllForAccessKeys) {
TEST(AccessCheckDisallowApiModifications) { TEST(AccessCheckDisallowApiModifications) {
HarmonyIsolate isolate; HarmonyIsolate isolate;
HandleScope scope(isolate.GetIsolate()); HandleScope scope(isolate.GetIsolate());
LocalContext context; LocalContext context(isolate.GetIsolate());
Handle<Object> instance = CreateAccessCheckedObject( Handle<Object> instance = CreateAccessCheckedObject(
BlockAccessKeys, IndexedAccessAlwaysAllowed); BlockAccessKeys, IndexedAccessAlwaysAllowed);
CompileRun("var records = null;" CompileRun("var records = null;"
...@@ -700,7 +701,7 @@ TEST(AccessCheckDisallowApiModifications) { ...@@ -700,7 +701,7 @@ TEST(AccessCheckDisallowApiModifications) {
"var blacklist = {__block_access_keys: true};" "var blacklist = {__block_access_keys: true};"
"Object.observe(obj, observer);"); "Object.observe(obj, observer);");
{ {
LocalContext context2; LocalContext context2(isolate.GetIsolate());
context2->Global()->Set(String::New("obj"), instance); context2->Global()->Set(String::New("obj"), instance);
CompileRun("var records2 = null;" CompileRun("var records2 = null;"
"var observer2 = function(r) { records2 = r };" "var observer2 = function(r) { records2 = r };"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment