remove uses of static oddball accessors using GetCurrent in advance of removal from api
R=mstarzinger@chromium.org BUG= Review URL: https://codereview.chromium.org/24508006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16957 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
8d549fb1c0
commit
7bad4ba648
@ -5897,7 +5897,7 @@ FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Object** implicit_args,
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
|
Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
|
||||||
if (i < 0 || length_ <= i) return Local<Value>(*Undefined());
|
if (i < 0 || length_ <= i) return Local<Value>(*Undefined(GetIsolate()));
|
||||||
return Local<Value>(reinterpret_cast<Value*>(values_ - i));
|
return Local<Value>(reinterpret_cast<Value*>(values_ - i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5979,7 +5979,8 @@ Handle<Boolean> ScriptOrigin::ResourceIsSharedCrossOrigin() const {
|
|||||||
|
|
||||||
|
|
||||||
Handle<Boolean> Boolean::New(bool value) {
|
Handle<Boolean> Boolean::New(bool value) {
|
||||||
return value ? True() : False();
|
Isolate* isolate = Isolate::GetCurrent();
|
||||||
|
return value ? True(isolate) : False(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
|
|||||||
v8::HandleScope handle_scope(isolate);
|
v8::HandleScope handle_scope(isolate);
|
||||||
|
|
||||||
v8::Handle<v8::String> input_line = ReadLine();
|
v8::Handle<v8::String> input_line = ReadLine();
|
||||||
if (input_line == v8::Undefined()) {
|
if (input_line == v8::Undefined(isolate)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ v8::Handle<v8::String> ReadLine() {
|
|||||||
res = fgets(buffer, kBufferSize, stdin);
|
res = fgets(buffer, kBufferSize, stdin);
|
||||||
}
|
}
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
v8::Handle<v8::Primitive> t = v8::Undefined();
|
v8::Handle<v8::Primitive> t = v8::Undefined(v8::Isolate::GetCurrent());
|
||||||
return v8::Handle<v8::String>::Cast(t);
|
return v8::Handle<v8::String>::Cast(t);
|
||||||
}
|
}
|
||||||
// Remove newline char
|
// Remove newline char
|
||||||
|
45
src/api.cc
45
src/api.cc
@ -1010,7 +1010,9 @@ static Local<FunctionTemplate> FunctionTemplateNew(
|
|||||||
}
|
}
|
||||||
obj->set_serial_number(i::Smi::FromInt(next_serial_number));
|
obj->set_serial_number(i::Smi::FromInt(next_serial_number));
|
||||||
if (callback != 0) {
|
if (callback != 0) {
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
Utils::ToLocal(obj)->SetCallHandler(callback, data);
|
Utils::ToLocal(obj)->SetCallHandler(callback, data);
|
||||||
}
|
}
|
||||||
obj->set_length(length);
|
obj->set_length(length);
|
||||||
@ -1234,7 +1236,9 @@ void FunctionTemplate::SetCallHandler(FunctionCallback callback,
|
|||||||
i::Handle<i::CallHandlerInfo> obj =
|
i::Handle<i::CallHandlerInfo> obj =
|
||||||
i::Handle<i::CallHandlerInfo>::cast(struct_obj);
|
i::Handle<i::CallHandlerInfo>::cast(struct_obj);
|
||||||
SET_FIELD_WRAPPED(obj, set_callback, callback);
|
SET_FIELD_WRAPPED(obj, set_callback, callback);
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
obj->set_data(*Utils::OpenHandle(*data));
|
obj->set_data(*Utils::OpenHandle(*data));
|
||||||
Utils::OpenHandle(this)->set_call_code(*obj);
|
Utils::OpenHandle(this)->set_call_code(*obj);
|
||||||
}
|
}
|
||||||
@ -1272,7 +1276,9 @@ static i::Handle<i::AccessorInfo> MakeAccessorInfo(
|
|||||||
isolate->factory()->NewExecutableAccessorInfo();
|
isolate->factory()->NewExecutableAccessorInfo();
|
||||||
SET_FIELD_WRAPPED(obj, set_getter, getter);
|
SET_FIELD_WRAPPED(obj, set_getter, getter);
|
||||||
SET_FIELD_WRAPPED(obj, set_setter, setter);
|
SET_FIELD_WRAPPED(obj, set_setter, setter);
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
obj->set_data(*Utils::OpenHandle(*data));
|
obj->set_data(*Utils::OpenHandle(*data));
|
||||||
return SetAccessorInfoProperties(obj, name, settings, attributes, signature);
|
return SetAccessorInfoProperties(obj, name, settings, attributes, signature);
|
||||||
}
|
}
|
||||||
@ -1500,7 +1506,9 @@ void ObjectTemplate::SetNamedPropertyHandler(
|
|||||||
if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
|
if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
|
||||||
if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
|
if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
|
||||||
|
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
obj->set_data(*Utils::OpenHandle(*data));
|
obj->set_data(*Utils::OpenHandle(*data));
|
||||||
cons->set_named_property_handler(*obj);
|
cons->set_named_property_handler(*obj);
|
||||||
}
|
}
|
||||||
@ -1536,7 +1544,9 @@ void ObjectTemplate::SetAccessCheckCallbacks(
|
|||||||
SET_FIELD_WRAPPED(info, set_named_callback, named_callback);
|
SET_FIELD_WRAPPED(info, set_named_callback, named_callback);
|
||||||
SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback);
|
SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback);
|
||||||
|
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
info->set_data(*Utils::OpenHandle(*data));
|
info->set_data(*Utils::OpenHandle(*data));
|
||||||
|
|
||||||
i::FunctionTemplateInfo* constructor =
|
i::FunctionTemplateInfo* constructor =
|
||||||
@ -1572,7 +1582,9 @@ void ObjectTemplate::SetIndexedPropertyHandler(
|
|||||||
if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
|
if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
|
||||||
if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
|
if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
|
||||||
|
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
obj->set_data(*Utils::OpenHandle(*data));
|
obj->set_data(*Utils::OpenHandle(*data));
|
||||||
cons->set_indexed_property_handler(*obj);
|
cons->set_indexed_property_handler(*obj);
|
||||||
}
|
}
|
||||||
@ -1592,7 +1604,9 @@ void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback,
|
|||||||
i::Handle<i::CallHandlerInfo> obj =
|
i::Handle<i::CallHandlerInfo> obj =
|
||||||
i::Handle<i::CallHandlerInfo>::cast(struct_obj);
|
i::Handle<i::CallHandlerInfo>::cast(struct_obj);
|
||||||
SET_FIELD_WRAPPED(obj, set_callback, callback);
|
SET_FIELD_WRAPPED(obj, set_callback, callback);
|
||||||
if (data.IsEmpty()) data = v8::Undefined();
|
if (data.IsEmpty()) {
|
||||||
|
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
obj->set_data(*Utils::OpenHandle(*data));
|
obj->set_data(*Utils::OpenHandle(*data));
|
||||||
cons->set_instance_call_handler(*obj);
|
cons->set_instance_call_handler(*obj);
|
||||||
}
|
}
|
||||||
@ -1697,8 +1711,9 @@ Local<Script> Script::New(v8::Handle<String> source,
|
|||||||
static_cast<int>(origin->ResourceColumnOffset()->Value());
|
static_cast<int>(origin->ResourceColumnOffset()->Value());
|
||||||
}
|
}
|
||||||
if (!origin->ResourceIsSharedCrossOrigin().IsEmpty()) {
|
if (!origin->ResourceIsSharedCrossOrigin().IsEmpty()) {
|
||||||
|
v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
|
||||||
is_shared_cross_origin =
|
is_shared_cross_origin =
|
||||||
origin->ResourceIsSharedCrossOrigin() == v8::True();
|
origin->ResourceIsSharedCrossOrigin() == v8::True(v8_isolate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXCEPTION_PREAMBLE(isolate);
|
EXCEPTION_PREAMBLE(isolate);
|
||||||
@ -1943,7 +1958,7 @@ bool v8::TryCatch::HasTerminated() const {
|
|||||||
v8::Handle<v8::Value> v8::TryCatch::ReThrow() {
|
v8::Handle<v8::Value> v8::TryCatch::ReThrow() {
|
||||||
if (!HasCaught()) return v8::Local<v8::Value>();
|
if (!HasCaught()) return v8::Local<v8::Value>();
|
||||||
rethrow_ = true;
|
rethrow_ = true;
|
||||||
return v8::Undefined();
|
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4113,10 +4128,12 @@ int Function::GetScriptColumnNumber() const {
|
|||||||
|
|
||||||
Handle<Value> Function::GetScriptId() const {
|
Handle<Value> Function::GetScriptId() const {
|
||||||
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
|
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
|
||||||
if (!func->shared()->script()->IsScript())
|
i::Isolate* isolate = func->GetIsolate();
|
||||||
return v8::Undefined();
|
if (!func->shared()->script()->IsScript()) {
|
||||||
|
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
|
}
|
||||||
i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
|
i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
|
||||||
return Utils::ToLocal(i::Handle<i::Object>(script->id(), func->GetIsolate()));
|
return Utils::ToLocal(i::Handle<i::Object>(script->id(), isolate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -6362,7 +6379,7 @@ v8::Local<Value> Isolate::ThrowException(v8::Local<v8::Value> value) {
|
|||||||
} else {
|
} else {
|
||||||
isolate->ScheduleThrow(*Utils::OpenHandle(*value));
|
isolate->ScheduleThrow(*Utils::OpenHandle(*value));
|
||||||
}
|
}
|
||||||
return v8::Undefined();
|
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -7113,7 +7130,7 @@ Handle<Value> HeapGraphEdge::GetName() const {
|
|||||||
isolate->factory()->NewNumberFromInt(edge->index()));
|
isolate->factory()->NewNumberFromInt(edge->index()));
|
||||||
default: UNREACHABLE();
|
default: UNREACHABLE();
|
||||||
}
|
}
|
||||||
return v8::Undefined();
|
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3135,8 +3135,7 @@ void Debugger::NotifyMessageHandler(v8::DebugEvent event,
|
|||||||
v8::Local<v8::Function> fun =
|
v8::Local<v8::Function> fun =
|
||||||
v8::Local<v8::Function>::Cast(api_exec_state->Get(fun_name));
|
v8::Local<v8::Function>::Cast(api_exec_state->Get(fun_name));
|
||||||
|
|
||||||
v8::Handle<v8::Boolean> running =
|
v8::Handle<v8::Boolean> running = v8::Boolean::New(auto_continue);
|
||||||
auto_continue ? v8::True() : v8::False();
|
|
||||||
static const int kArgc = 1;
|
static const int kArgc = 1;
|
||||||
v8::Handle<Value> argv[kArgc] = { running };
|
v8::Handle<Value> argv[kArgc] = { running };
|
||||||
cmd_processor = v8::Local<v8::Object>::Cast(
|
cmd_processor = v8::Local<v8::Object>::Cast(
|
||||||
|
@ -354,7 +354,8 @@ static void EmptyGetter(Local<String> name,
|
|||||||
|
|
||||||
THREADED_TEST(EmptyResult) {
|
THREADED_TEST(EmptyResult) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::HandleScope scope(context->GetIsolate());
|
v8::Isolate* isolate = context->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New();
|
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New();
|
||||||
obj->SetAccessor(v8_str("xxx"), EmptyGetter, NULL, v8::String::New("data"));
|
obj->SetAccessor(v8_str("xxx"), EmptyGetter, NULL, v8::String::New("data"));
|
||||||
v8::Handle<v8::Object> inst = obj->NewInstance();
|
v8::Handle<v8::Object> inst = obj->NewInstance();
|
||||||
@ -362,7 +363,7 @@ THREADED_TEST(EmptyResult) {
|
|||||||
Local<Script> scr = v8::Script::Compile(v8::String::New("obj.xxx"));
|
Local<Script> scr = v8::Script::Compile(v8::String::New("obj.xxx"));
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
Local<Value> result = scr->Run();
|
Local<Value> result = scr->Run();
|
||||||
CHECK(result == v8::Undefined());
|
CHECK(result == v8::Undefined(isolate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +371,8 @@ THREADED_TEST(EmptyResult) {
|
|||||||
THREADED_TEST(NoReuseRegress) {
|
THREADED_TEST(NoReuseRegress) {
|
||||||
// Check that the IC generated for the one test doesn't get reused
|
// Check that the IC generated for the one test doesn't get reused
|
||||||
// for the other.
|
// for the other.
|
||||||
v8::HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
{
|
{
|
||||||
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New();
|
v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New();
|
||||||
obj->SetAccessor(v8_str("xxx"), EmptyGetter, NULL, v8::String::New("data"));
|
obj->SetAccessor(v8_str("xxx"), EmptyGetter, NULL, v8::String::New("data"));
|
||||||
@ -380,7 +382,7 @@ THREADED_TEST(NoReuseRegress) {
|
|||||||
Local<Script> scr = v8::Script::Compile(v8::String::New("obj.xxx"));
|
Local<Script> scr = v8::Script::Compile(v8::String::New("obj.xxx"));
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
Local<Value> result = scr->Run();
|
Local<Value> result = scr->Run();
|
||||||
CHECK(result == v8::Undefined());
|
CHECK(result == v8::Undefined(isolate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -204,7 +204,7 @@ THREADED_TEST(Handles) {
|
|||||||
CHECK(!local_env.IsEmpty());
|
CHECK(!local_env.IsEmpty());
|
||||||
local_env->Enter();
|
local_env->Enter();
|
||||||
|
|
||||||
v8::Handle<v8::Primitive> undef = v8::Undefined();
|
v8::Handle<v8::Primitive> undef = v8::Undefined(CcTest::isolate());
|
||||||
CHECK(!undef.IsEmpty());
|
CHECK(!undef.IsEmpty());
|
||||||
CHECK(undef->IsUndefined());
|
CHECK(undef->IsUndefined());
|
||||||
|
|
||||||
@ -391,8 +391,9 @@ THREADED_TEST(ArgumentSignature) {
|
|||||||
|
|
||||||
THREADED_TEST(HulIgennem) {
|
THREADED_TEST(HulIgennem) {
|
||||||
LocalContext env;
|
LocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
v8::Handle<v8::Primitive> undef = v8::Undefined();
|
v8::HandleScope scope(isolate);
|
||||||
|
v8::Handle<v8::Primitive> undef = v8::Undefined(isolate);
|
||||||
Local<String> undef_str = undef->ToString();
|
Local<String> undef_str = undef->ToString();
|
||||||
char* value = i::NewArray<char>(undef_str->Utf8Length() + 1);
|
char* value = i::NewArray<char>(undef_str->Utf8Length() + 1);
|
||||||
undef_str->WriteUtf8(value);
|
undef_str->WriteUtf8(value);
|
||||||
@ -403,7 +404,8 @@ THREADED_TEST(HulIgennem) {
|
|||||||
|
|
||||||
THREADED_TEST(Access) {
|
THREADED_TEST(Access) {
|
||||||
LocalContext env;
|
LocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
Local<v8::Object> obj = v8::Object::New();
|
Local<v8::Object> obj = v8::Object::New();
|
||||||
Local<Value> foo_before = obj->Get(v8_str("foo"));
|
Local<Value> foo_before = obj->Get(v8_str("foo"));
|
||||||
CHECK(foo_before->IsUndefined());
|
CHECK(foo_before->IsUndefined());
|
||||||
@ -1689,12 +1691,13 @@ THREADED_TEST(Number) {
|
|||||||
|
|
||||||
THREADED_TEST(ToNumber) {
|
THREADED_TEST(ToNumber) {
|
||||||
LocalContext env;
|
LocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
Local<String> str = v8_str("3.1415926");
|
Local<String> str = v8_str("3.1415926");
|
||||||
CHECK_EQ(3.1415926, str->NumberValue());
|
CHECK_EQ(3.1415926, str->NumberValue());
|
||||||
v8::Handle<v8::Boolean> t = v8::True();
|
v8::Handle<v8::Boolean> t = v8::True(isolate);
|
||||||
CHECK_EQ(1.0, t->NumberValue());
|
CHECK_EQ(1.0, t->NumberValue());
|
||||||
v8::Handle<v8::Boolean> f = v8::False();
|
v8::Handle<v8::Boolean> f = v8::False(isolate);
|
||||||
CHECK_EQ(0.0, f->NumberValue());
|
CHECK_EQ(0.0, f->NumberValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1713,13 +1716,13 @@ THREADED_TEST(Date) {
|
|||||||
THREADED_TEST(Boolean) {
|
THREADED_TEST(Boolean) {
|
||||||
LocalContext env;
|
LocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::HandleScope scope(env->GetIsolate());
|
||||||
v8::Handle<v8::Boolean> t = v8::True();
|
v8::Handle<v8::Boolean> t = v8::True(CcTest::isolate());
|
||||||
CHECK(t->Value());
|
CHECK(t->Value());
|
||||||
v8::Handle<v8::Boolean> f = v8::False();
|
v8::Handle<v8::Boolean> f = v8::False(CcTest::isolate());
|
||||||
CHECK(!f->Value());
|
CHECK(!f->Value());
|
||||||
v8::Handle<v8::Primitive> u = v8::Undefined();
|
v8::Handle<v8::Primitive> u = v8::Undefined(CcTest::isolate());
|
||||||
CHECK(!u->BooleanValue());
|
CHECK(!u->BooleanValue());
|
||||||
v8::Handle<v8::Primitive> n = v8::Null();
|
v8::Handle<v8::Primitive> n = v8::Null(CcTest::isolate());
|
||||||
CHECK(!n->BooleanValue());
|
CHECK(!n->BooleanValue());
|
||||||
v8::Handle<String> str1 = v8_str("");
|
v8::Handle<String> str1 = v8_str("");
|
||||||
CHECK(!str1->BooleanValue());
|
CHECK(!str1->BooleanValue());
|
||||||
@ -3762,15 +3765,16 @@ static void check_message_3(v8::Handle<v8::Message> message,
|
|||||||
|
|
||||||
TEST(MessageHandler3) {
|
TEST(MessageHandler3) {
|
||||||
message_received = false;
|
message_received = false;
|
||||||
v8::HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
CHECK(!message_received);
|
CHECK(!message_received);
|
||||||
v8::V8::AddMessageListener(check_message_3);
|
v8::V8::AddMessageListener(check_message_3);
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::ScriptOrigin origin =
|
v8::ScriptOrigin origin =
|
||||||
v8::ScriptOrigin(v8_str("6.75"),
|
v8::ScriptOrigin(v8_str("6.75"),
|
||||||
v8::Integer::New(1),
|
v8::Integer::New(1, isolate),
|
||||||
v8::Integer::New(2),
|
v8::Integer::New(2, isolate),
|
||||||
v8::True());
|
v8::True(isolate));
|
||||||
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
||||||
&origin);
|
&origin);
|
||||||
script->Run();
|
script->Run();
|
||||||
@ -3790,15 +3794,16 @@ static void check_message_4(v8::Handle<v8::Message> message,
|
|||||||
|
|
||||||
TEST(MessageHandler4) {
|
TEST(MessageHandler4) {
|
||||||
message_received = false;
|
message_received = false;
|
||||||
v8::HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
CHECK(!message_received);
|
CHECK(!message_received);
|
||||||
v8::V8::AddMessageListener(check_message_4);
|
v8::V8::AddMessageListener(check_message_4);
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::ScriptOrigin origin =
|
v8::ScriptOrigin origin =
|
||||||
v8::ScriptOrigin(v8_str("6.75"),
|
v8::ScriptOrigin(v8_str("6.75"),
|
||||||
v8::Integer::New(1),
|
v8::Integer::New(1, isolate),
|
||||||
v8::Integer::New(2),
|
v8::Integer::New(2, isolate),
|
||||||
v8::False());
|
v8::False(isolate));
|
||||||
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
||||||
&origin);
|
&origin);
|
||||||
script->Run();
|
script->Run();
|
||||||
@ -3826,15 +3831,16 @@ static void check_message_5b(v8::Handle<v8::Message> message,
|
|||||||
|
|
||||||
TEST(MessageHandler5) {
|
TEST(MessageHandler5) {
|
||||||
message_received = false;
|
message_received = false;
|
||||||
v8::HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
CHECK(!message_received);
|
CHECK(!message_received);
|
||||||
v8::V8::AddMessageListener(check_message_5a);
|
v8::V8::AddMessageListener(check_message_5a);
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::ScriptOrigin origin =
|
v8::ScriptOrigin origin =
|
||||||
v8::ScriptOrigin(v8_str("6.75"),
|
v8::ScriptOrigin(v8_str("6.75"),
|
||||||
v8::Integer::New(1),
|
v8::Integer::New(1, isolate),
|
||||||
v8::Integer::New(2),
|
v8::Integer::New(2, isolate),
|
||||||
v8::True());
|
v8::True(isolate));
|
||||||
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
|
||||||
&origin);
|
&origin);
|
||||||
script->Run();
|
script->Run();
|
||||||
@ -3846,9 +3852,9 @@ TEST(MessageHandler5) {
|
|||||||
v8::V8::AddMessageListener(check_message_5b);
|
v8::V8::AddMessageListener(check_message_5b);
|
||||||
origin =
|
origin =
|
||||||
v8::ScriptOrigin(v8_str("6.75"),
|
v8::ScriptOrigin(v8_str("6.75"),
|
||||||
v8::Integer::New(1),
|
v8::Integer::New(1, isolate),
|
||||||
v8::Integer::New(2),
|
v8::Integer::New(2, isolate),
|
||||||
v8::False());
|
v8::False(isolate));
|
||||||
script = Script::Compile(v8_str("throw 'error'"),
|
script = Script::Compile(v8_str("throw 'error'"),
|
||||||
&origin);
|
&origin);
|
||||||
script->Run();
|
script->Run();
|
||||||
@ -4321,7 +4327,8 @@ THREADED_TEST(isNumberType) {
|
|||||||
|
|
||||||
THREADED_TEST(ConversionException) {
|
THREADED_TEST(ConversionException) {
|
||||||
LocalContext env;
|
LocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
CompileRun(
|
CompileRun(
|
||||||
"function TestClass() { };"
|
"function TestClass() { };"
|
||||||
"TestClass.prototype.toString = function () { throw 'uncle?'; };"
|
"TestClass.prototype.toString = function () { throw 'uncle?'; };"
|
||||||
@ -4350,7 +4357,7 @@ THREADED_TEST(ConversionException) {
|
|||||||
CHECK(to_int32_result.IsEmpty());
|
CHECK(to_int32_result.IsEmpty());
|
||||||
CheckUncle(&try_catch);
|
CheckUncle(&try_catch);
|
||||||
|
|
||||||
Local<Value> to_object_result = v8::Undefined()->ToObject();
|
Local<Value> to_object_result = v8::Undefined(isolate)->ToObject();
|
||||||
CHECK(to_object_result.IsEmpty());
|
CHECK(to_object_result.IsEmpty());
|
||||||
CHECK(try_catch.HasCaught());
|
CHECK(try_catch.HasCaught());
|
||||||
try_catch.Reset();
|
try_catch.Reset();
|
||||||
@ -4976,8 +4983,8 @@ THREADED_TEST(Equality) {
|
|||||||
CHECK(v8_num(0.0)->StrictEquals(v8_num(-0.0)));
|
CHECK(v8_num(0.0)->StrictEquals(v8_num(-0.0)));
|
||||||
Local<Value> not_a_number = v8_num(i::OS::nan_value());
|
Local<Value> not_a_number = v8_num(i::OS::nan_value());
|
||||||
CHECK(!not_a_number->StrictEquals(not_a_number));
|
CHECK(!not_a_number->StrictEquals(not_a_number));
|
||||||
CHECK(v8::False()->StrictEquals(v8::False()));
|
CHECK(v8::False(isolate)->StrictEquals(v8::False(isolate)));
|
||||||
CHECK(!v8::False()->StrictEquals(v8::Undefined()));
|
CHECK(!v8::False(isolate)->StrictEquals(v8::Undefined(isolate)));
|
||||||
|
|
||||||
v8::Handle<v8::Object> obj = v8::Object::New();
|
v8::Handle<v8::Object> obj = v8::Object::New();
|
||||||
v8::Persistent<v8::Object> alias(isolate, obj);
|
v8::Persistent<v8::Object> alias(isolate, obj);
|
||||||
@ -4991,8 +4998,8 @@ THREADED_TEST(Equality) {
|
|||||||
CHECK(!v8_num(1)->SameValue(v8_num(2)));
|
CHECK(!v8_num(1)->SameValue(v8_num(2)));
|
||||||
CHECK(!v8_num(0.0)->SameValue(v8_num(-0.0)));
|
CHECK(!v8_num(0.0)->SameValue(v8_num(-0.0)));
|
||||||
CHECK(not_a_number->SameValue(not_a_number));
|
CHECK(not_a_number->SameValue(not_a_number));
|
||||||
CHECK(v8::False()->SameValue(v8::False()));
|
CHECK(v8::False(isolate)->SameValue(v8::False(isolate)));
|
||||||
CHECK(!v8::False()->SameValue(v8::Undefined()));
|
CHECK(!v8::False(isolate)->SameValue(v8::Undefined(isolate)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -6673,7 +6680,7 @@ TEST(RegexpOutOfMemory) {
|
|||||||
static void MissingScriptInfoMessageListener(v8::Handle<v8::Message> message,
|
static void MissingScriptInfoMessageListener(v8::Handle<v8::Message> message,
|
||||||
v8::Handle<Value> data) {
|
v8::Handle<Value> data) {
|
||||||
CHECK(message->GetScriptResourceName()->IsUndefined());
|
CHECK(message->GetScriptResourceName()->IsUndefined());
|
||||||
CHECK_EQ(v8::Undefined(), message->GetScriptResourceName());
|
CHECK_EQ(v8::Undefined(CcTest::isolate()), message->GetScriptResourceName());
|
||||||
message->GetLineNumber();
|
message->GetLineNumber();
|
||||||
message->GetSourceLine();
|
message->GetSourceLine();
|
||||||
}
|
}
|
||||||
@ -6910,12 +6917,13 @@ v8::Handle<Function> args_fun;
|
|||||||
static void ArgumentsTestCallback(
|
static void ArgumentsTestCallback(
|
||||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
ApiTestFuzzer::Fuzz();
|
ApiTestFuzzer::Fuzz();
|
||||||
|
v8::Isolate* isolate = args.GetIsolate();
|
||||||
CHECK_EQ(args_fun, args.Callee());
|
CHECK_EQ(args_fun, args.Callee());
|
||||||
CHECK_EQ(3, args.Length());
|
CHECK_EQ(3, args.Length());
|
||||||
CHECK_EQ(v8::Integer::New(1), args[0]);
|
CHECK_EQ(v8::Integer::New(1, isolate), args[0]);
|
||||||
CHECK_EQ(v8::Integer::New(2), args[1]);
|
CHECK_EQ(v8::Integer::New(2, isolate), args[1]);
|
||||||
CHECK_EQ(v8::Integer::New(3), args[2]);
|
CHECK_EQ(v8::Integer::New(3, isolate), args[2]);
|
||||||
CHECK_EQ(v8::Undefined(), args[3]);
|
CHECK_EQ(v8::Undefined(isolate), args[3]);
|
||||||
v8::HandleScope scope(args.GetIsolate());
|
v8::HandleScope scope(args.GetIsolate());
|
||||||
CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
|
CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
|
||||||
}
|
}
|
||||||
@ -7163,7 +7171,8 @@ THREADED_TEST(PreInterceptorHolders) {
|
|||||||
|
|
||||||
|
|
||||||
THREADED_TEST(ObjectInstantiation) {
|
THREADED_TEST(ObjectInstantiation) {
|
||||||
v8::HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
|
v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
|
||||||
templ->SetAccessor(v8_str("t"), PGetter2);
|
templ->SetAccessor(v8_str("t"), PGetter2);
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
@ -7175,7 +7184,7 @@ THREADED_TEST(ObjectInstantiation) {
|
|||||||
context->Global()->Set(v8_str("o2"), obj);
|
context->Global()->Set(v8_str("o2"), obj);
|
||||||
v8::Handle<Value> value =
|
v8::Handle<Value> value =
|
||||||
Script::Compile(v8_str("o.__proto__ === o2.__proto__"))->Run();
|
Script::Compile(v8_str("o.__proto__ === o2.__proto__"))->Run();
|
||||||
CHECK_EQ(v8::True(), value);
|
CHECK_EQ(v8::True(isolate), value);
|
||||||
context->Global()->Set(v8_str("o"), obj);
|
context->Global()->Set(v8_str("o"), obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9794,7 +9803,8 @@ static void FakeConstructorCallback(
|
|||||||
|
|
||||||
THREADED_TEST(ConstructorForObject) {
|
THREADED_TEST(ConstructorForObject) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::HandleScope handle_scope(context->GetIsolate());
|
v8::Isolate* isolate = context->GetIsolate();
|
||||||
|
v8::HandleScope handle_scope(isolate);
|
||||||
|
|
||||||
{ Local<ObjectTemplate> instance_template = ObjectTemplate::New();
|
{ Local<ObjectTemplate> instance_template = ObjectTemplate::New();
|
||||||
instance_template->SetCallAsFunctionHandler(ConstructorCallback);
|
instance_template->SetCallAsFunctionHandler(ConstructorCallback);
|
||||||
@ -9843,7 +9853,7 @@ THREADED_TEST(ConstructorForObject) {
|
|||||||
CHECK(value->IsBoolean());
|
CHECK(value->IsBoolean());
|
||||||
CHECK_EQ(true, value->BooleanValue());
|
CHECK_EQ(true, value->BooleanValue());
|
||||||
|
|
||||||
Handle<Value> args3[] = { v8::True() };
|
Handle<Value> args3[] = { v8::True(isolate) };
|
||||||
Local<Value> value_obj3 = instance->CallAsConstructor(1, args3);
|
Local<Value> value_obj3 = instance->CallAsConstructor(1, args3);
|
||||||
CHECK(value_obj3->IsObject());
|
CHECK(value_obj3->IsObject());
|
||||||
Local<Object> object3 = Local<Object>::Cast(value_obj3);
|
Local<Object> object3 = Local<Object>::Cast(value_obj3);
|
||||||
@ -9853,7 +9863,7 @@ THREADED_TEST(ConstructorForObject) {
|
|||||||
CHECK_EQ(true, value->BooleanValue());
|
CHECK_EQ(true, value->BooleanValue());
|
||||||
|
|
||||||
// Call the Object's constructor with undefined.
|
// Call the Object's constructor with undefined.
|
||||||
Handle<Value> args4[] = { v8::Undefined() };
|
Handle<Value> args4[] = { v8::Undefined(isolate) };
|
||||||
Local<Value> value_obj4 = instance->CallAsConstructor(1, args4);
|
Local<Value> value_obj4 = instance->CallAsConstructor(1, args4);
|
||||||
CHECK(value_obj4->IsObject());
|
CHECK(value_obj4->IsObject());
|
||||||
Local<Object> object4 = Local<Object>::Cast(value_obj4);
|
Local<Object> object4 = Local<Object>::Cast(value_obj4);
|
||||||
@ -9862,7 +9872,7 @@ THREADED_TEST(ConstructorForObject) {
|
|||||||
CHECK(value->IsUndefined());
|
CHECK(value->IsUndefined());
|
||||||
|
|
||||||
// Call the Object's constructor with null.
|
// Call the Object's constructor with null.
|
||||||
Handle<Value> args5[] = { v8::Null() };
|
Handle<Value> args5[] = { v8::Null(isolate) };
|
||||||
Local<Value> value_obj5 = instance->CallAsConstructor(1, args5);
|
Local<Value> value_obj5 = instance->CallAsConstructor(1, args5);
|
||||||
CHECK(value_obj5->IsObject());
|
CHECK(value_obj5->IsObject());
|
||||||
Local<Object> object5 = Local<Object>::Cast(value_obj5);
|
Local<Object> object5 = Local<Object>::Cast(value_obj5);
|
||||||
@ -13732,11 +13742,12 @@ static bool IndexedSetAccessBlocker(Local<v8::Object> obj,
|
|||||||
|
|
||||||
THREADED_TEST(DisableAccessChecksWhileConfiguring) {
|
THREADED_TEST(DisableAccessChecksWhileConfiguring) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::HandleScope scope(context->GetIsolate());
|
v8::Isolate* isolate = context->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
Local<ObjectTemplate> templ = ObjectTemplate::New();
|
Local<ObjectTemplate> templ = ObjectTemplate::New();
|
||||||
templ->SetAccessCheckCallbacks(NamedSetAccessBlocker,
|
templ->SetAccessCheckCallbacks(NamedSetAccessBlocker,
|
||||||
IndexedSetAccessBlocker);
|
IndexedSetAccessBlocker);
|
||||||
templ->Set(v8_str("x"), v8::True());
|
templ->Set(v8_str("x"), v8::True(isolate));
|
||||||
Local<v8::Object> instance = templ->NewInstance();
|
Local<v8::Object> instance = templ->NewInstance();
|
||||||
context->Global()->Set(v8_str("obj"), instance);
|
context->Global()->Set(v8_str("obj"), instance);
|
||||||
Local<Value> value = CompileRun("obj.x");
|
Local<Value> value = CompileRun("obj.x");
|
||||||
@ -14153,14 +14164,14 @@ THREADED_TEST(DictionaryICLoadedFunction) {
|
|||||||
// Test LoadIC.
|
// Test LoadIC.
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
context->Global()->Set(v8_str("tmp"), v8::True());
|
context->Global()->Set(v8_str("tmp"), v8::True(CcTest::isolate()));
|
||||||
context->Global()->Delete(v8_str("tmp"));
|
context->Global()->Delete(v8_str("tmp"));
|
||||||
CompileRun("for (var j = 0; j < 10; j++) new RegExp('');");
|
CompileRun("for (var j = 0; j < 10; j++) new RegExp('');");
|
||||||
}
|
}
|
||||||
// Test CallIC.
|
// Test CallIC.
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
context->Global()->Set(v8_str("tmp"), v8::True());
|
context->Global()->Set(v8_str("tmp"), v8::True(CcTest::isolate()));
|
||||||
context->Global()->Delete(v8_str("tmp"));
|
context->Global()->Delete(v8_str("tmp"));
|
||||||
CompileRun("for (var j = 0; j < 10; j++) RegExp('')");
|
CompileRun("for (var j = 0; j < 10; j++) RegExp('')");
|
||||||
}
|
}
|
||||||
@ -19394,20 +19405,20 @@ THREADED_TEST(Regress93759) {
|
|||||||
CHECK(result1->Equals(simple_object->GetPrototype()));
|
CHECK(result1->Equals(simple_object->GetPrototype()));
|
||||||
|
|
||||||
Local<Value> result2 = CompileRun("Object.getPrototypeOf(protected)");
|
Local<Value> result2 = CompileRun("Object.getPrototypeOf(protected)");
|
||||||
CHECK(result2->Equals(Undefined()));
|
CHECK(result2->Equals(Undefined(isolate)));
|
||||||
|
|
||||||
Local<Value> result3 = CompileRun("Object.getPrototypeOf(global)");
|
Local<Value> result3 = CompileRun("Object.getPrototypeOf(global)");
|
||||||
CHECK(result3->Equals(global_object->GetPrototype()));
|
CHECK(result3->Equals(global_object->GetPrototype()));
|
||||||
|
|
||||||
Local<Value> result4 = CompileRun("Object.getPrototypeOf(proxy)");
|
Local<Value> result4 = CompileRun("Object.getPrototypeOf(proxy)");
|
||||||
CHECK(result4->Equals(Undefined()));
|
CHECK(result4->Equals(Undefined(isolate)));
|
||||||
|
|
||||||
Local<Value> result5 = CompileRun("Object.getPrototypeOf(hidden)");
|
Local<Value> result5 = CompileRun("Object.getPrototypeOf(hidden)");
|
||||||
CHECK(result5->Equals(
|
CHECK(result5->Equals(
|
||||||
object_with_hidden->GetPrototype()->ToObject()->GetPrototype()));
|
object_with_hidden->GetPrototype()->ToObject()->GetPrototype()));
|
||||||
|
|
||||||
Local<Value> result6 = CompileRun("Object.getPrototypeOf(phidden)");
|
Local<Value> result6 = CompileRun("Object.getPrototypeOf(phidden)");
|
||||||
CHECK(result6->Equals(Undefined()));
|
CHECK(result6->Equals(Undefined(isolate)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -19706,16 +19717,12 @@ TEST(StaticGetters) {
|
|||||||
v8::Isolate* isolate = CcTest::isolate();
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
v8::HandleScope scope(isolate);
|
v8::HandleScope scope(isolate);
|
||||||
i::Handle<i::Object> undefined_value = factory->undefined_value();
|
i::Handle<i::Object> undefined_value = factory->undefined_value();
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::Undefined()) == *undefined_value);
|
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::Undefined(isolate)) == *undefined_value);
|
CHECK(*v8::Utils::OpenHandle(*v8::Undefined(isolate)) == *undefined_value);
|
||||||
i::Handle<i::Object> null_value = factory->null_value();
|
i::Handle<i::Object> null_value = factory->null_value();
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::Null()) == *null_value);
|
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::Null(isolate)) == *null_value);
|
CHECK(*v8::Utils::OpenHandle(*v8::Null(isolate)) == *null_value);
|
||||||
i::Handle<i::Object> true_value = factory->true_value();
|
i::Handle<i::Object> true_value = factory->true_value();
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::True()) == *true_value);
|
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::True(isolate)) == *true_value);
|
CHECK(*v8::Utils::OpenHandle(*v8::True(isolate)) == *true_value);
|
||||||
i::Handle<i::Object> false_value = factory->false_value();
|
i::Handle<i::Object> false_value = factory->false_value();
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::False()) == *false_value);
|
|
||||||
CHECK(*v8::Utils::OpenHandle(*v8::False(isolate)) == *false_value);
|
CHECK(*v8::Utils::OpenHandle(*v8::False(isolate)) == *false_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20158,10 +20165,11 @@ THREADED_TEST(Regress2535) {
|
|||||||
|
|
||||||
THREADED_TEST(Regress2746) {
|
THREADED_TEST(Regress2746) {
|
||||||
LocalContext context;
|
LocalContext context;
|
||||||
v8::HandleScope scope(context->GetIsolate());
|
v8::Isolate* isolate = context->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
Local<Object> obj = Object::New();
|
Local<Object> obj = Object::New();
|
||||||
Local<String> key = String::New("key");
|
Local<String> key = String::New("key");
|
||||||
obj->SetHiddenValue(key, v8::Undefined());
|
obj->SetHiddenValue(key, v8::Undefined(isolate));
|
||||||
Local<Value> value = obj->GetHiddenValue(key);
|
Local<Value> value = obj->GetHiddenValue(key);
|
||||||
CHECK(!value.IsEmpty());
|
CHECK(!value.IsEmpty());
|
||||||
CHECK(value->IsUndefined());
|
CHECK(value->IsUndefined());
|
||||||
|
@ -2400,7 +2400,8 @@ TEST(DebuggerStatementBreakpoint) {
|
|||||||
// the correct results.
|
// the correct results.
|
||||||
TEST(DebugEvaluate) {
|
TEST(DebugEvaluate) {
|
||||||
DebugLocalContext env;
|
DebugLocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
env.ExposeDebug();
|
env.ExposeDebug();
|
||||||
|
|
||||||
// Create a function for checking the evaluation when hitting a break point.
|
// Create a function for checking the evaluation when hitting a break point.
|
||||||
@ -2413,13 +2414,13 @@ TEST(DebugEvaluate) {
|
|||||||
// Different expected vaules of x and a when in a break point (u = undefined,
|
// Different expected vaules of x and a when in a break point (u = undefined,
|
||||||
// d = Hello, world!).
|
// d = Hello, world!).
|
||||||
struct EvaluateCheck checks_uu[] = {
|
struct EvaluateCheck checks_uu[] = {
|
||||||
{"x", v8::Undefined()},
|
{"x", v8::Undefined(isolate)},
|
||||||
{"a", v8::Undefined()},
|
{"a", v8::Undefined(isolate)},
|
||||||
{NULL, v8::Handle<v8::Value>()}
|
{NULL, v8::Handle<v8::Value>()}
|
||||||
};
|
};
|
||||||
struct EvaluateCheck checks_hu[] = {
|
struct EvaluateCheck checks_hu[] = {
|
||||||
{"x", v8::String::New("Hello, world!")},
|
{"x", v8::String::New("Hello, world!")},
|
||||||
{"a", v8::Undefined()},
|
{"a", v8::Undefined(isolate)},
|
||||||
{NULL, v8::Handle<v8::Value>()}
|
{NULL, v8::Handle<v8::Value>()}
|
||||||
};
|
};
|
||||||
struct EvaluateCheck checks_hh[] = {
|
struct EvaluateCheck checks_hh[] = {
|
||||||
@ -2485,7 +2486,7 @@ TEST(DebugEvaluate) {
|
|||||||
// parameter.
|
// parameter.
|
||||||
checks = checks_uu;
|
checks = checks_uu;
|
||||||
v8::Handle<v8::Value> argv_bar_1[2] = {
|
v8::Handle<v8::Value> argv_bar_1[2] = {
|
||||||
v8::Undefined(),
|
v8::Undefined(isolate),
|
||||||
v8::Number::New(barbar_break_position)
|
v8::Number::New(barbar_break_position)
|
||||||
};
|
};
|
||||||
bar->Call(env->Global(), 2, argv_bar_1);
|
bar->Call(env->Global(), 2, argv_bar_1);
|
||||||
@ -3105,7 +3106,8 @@ TEST(DebugStepLocals) {
|
|||||||
|
|
||||||
TEST(DebugStepIf) {
|
TEST(DebugStepIf) {
|
||||||
DebugLocalContext env;
|
DebugLocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
|
|
||||||
// Register a debug event listener which steps and counts.
|
// Register a debug event listener which steps and counts.
|
||||||
v8::Debug::SetDebugEventListener2(DebugEventStep);
|
v8::Debug::SetDebugEventListener2(DebugEventStep);
|
||||||
@ -3129,14 +3131,14 @@ TEST(DebugStepIf) {
|
|||||||
// Stepping through the true part.
|
// Stepping through the true part.
|
||||||
step_action = StepIn;
|
step_action = StepIn;
|
||||||
break_point_hit_count = 0;
|
break_point_hit_count = 0;
|
||||||
v8::Handle<v8::Value> argv_true[argc] = { v8::True() };
|
v8::Handle<v8::Value> argv_true[argc] = { v8::True(isolate) };
|
||||||
foo->Call(env->Global(), argc, argv_true);
|
foo->Call(env->Global(), argc, argv_true);
|
||||||
CHECK_EQ(4, break_point_hit_count);
|
CHECK_EQ(4, break_point_hit_count);
|
||||||
|
|
||||||
// Stepping through the false part.
|
// Stepping through the false part.
|
||||||
step_action = StepIn;
|
step_action = StepIn;
|
||||||
break_point_hit_count = 0;
|
break_point_hit_count = 0;
|
||||||
v8::Handle<v8::Value> argv_false[argc] = { v8::False() };
|
v8::Handle<v8::Value> argv_false[argc] = { v8::False(isolate) };
|
||||||
foo->Call(env->Global(), argc, argv_false);
|
foo->Call(env->Global(), argc, argv_false);
|
||||||
CHECK_EQ(5, break_point_hit_count);
|
CHECK_EQ(5, break_point_hit_count);
|
||||||
|
|
||||||
@ -3507,7 +3509,8 @@ TEST(DebugStepWith) {
|
|||||||
|
|
||||||
TEST(DebugConditional) {
|
TEST(DebugConditional) {
|
||||||
DebugLocalContext env;
|
DebugLocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
|
|
||||||
// Register a debug event listener which steps and counts.
|
// Register a debug event listener which steps and counts.
|
||||||
v8::Debug::SetDebugEventListener2(DebugEventStep);
|
v8::Debug::SetDebugEventListener2(DebugEventStep);
|
||||||
@ -3531,7 +3534,7 @@ TEST(DebugConditional) {
|
|||||||
step_action = StepIn;
|
step_action = StepIn;
|
||||||
break_point_hit_count = 0;
|
break_point_hit_count = 0;
|
||||||
const int argc = 1;
|
const int argc = 1;
|
||||||
v8::Handle<v8::Value> argv_true[argc] = { v8::True() };
|
v8::Handle<v8::Value> argv_true[argc] = { v8::True(isolate) };
|
||||||
foo->Call(env->Global(), argc, argv_true);
|
foo->Call(env->Global(), argc, argv_true);
|
||||||
CHECK_EQ(5, break_point_hit_count);
|
CHECK_EQ(5, break_point_hit_count);
|
||||||
|
|
||||||
@ -3759,7 +3762,8 @@ TEST(DebugStepFunctionApply) {
|
|||||||
// Test that step in works with function.call.
|
// Test that step in works with function.call.
|
||||||
TEST(DebugStepFunctionCall) {
|
TEST(DebugStepFunctionCall) {
|
||||||
DebugLocalContext env;
|
DebugLocalContext env;
|
||||||
v8::HandleScope scope(env->GetIsolate());
|
v8::Isolate* isolate = env->GetIsolate();
|
||||||
|
v8::HandleScope scope(isolate);
|
||||||
|
|
||||||
// Create a function for testing stepping.
|
// Create a function for testing stepping.
|
||||||
v8::Local<v8::Function> foo = CompileFunction(
|
v8::Local<v8::Function> foo = CompileFunction(
|
||||||
@ -3786,7 +3790,7 @@ TEST(DebugStepFunctionCall) {
|
|||||||
// Check stepping where the if condition in bar is true.
|
// Check stepping where the if condition in bar is true.
|
||||||
break_point_hit_count = 0;
|
break_point_hit_count = 0;
|
||||||
const int argc = 1;
|
const int argc = 1;
|
||||||
v8::Handle<v8::Value> argv[argc] = { v8::True() };
|
v8::Handle<v8::Value> argv[argc] = { v8::True(isolate) };
|
||||||
foo->Call(env->Global(), argc, argv);
|
foo->Call(env->Global(), argc, argv);
|
||||||
CHECK_EQ(8, break_point_hit_count);
|
CHECK_EQ(8, break_point_hit_count);
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ TEST(Unknown) {
|
|||||||
1, // access
|
1, // access
|
||||||
1, // declaration
|
1, // declaration
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ DeclarationContext context;
|
{ DeclarationContext context;
|
||||||
@ -258,15 +258,16 @@ TEST(Unknown) {
|
|||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ DeclarationContext context;
|
{ DeclarationContext context;
|
||||||
|
// SB 0 - BUG 1213579
|
||||||
context.Check("const x = 0; x",
|
context.Check("const x = 0; x",
|
||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined()); // SB 0 - BUG 1213579
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,7 +314,7 @@ TEST(Present) {
|
|||||||
1, // access
|
1, // access
|
||||||
1, // initialization
|
1, // initialization
|
||||||
1, // (re-)declaration
|
1, // (re-)declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ PresentPropertyContext context;
|
{ PresentPropertyContext context;
|
||||||
@ -336,14 +337,15 @@ class AbsentPropertyContext: public DeclarationContext {
|
|||||||
|
|
||||||
|
|
||||||
TEST(Absent) {
|
TEST(Absent) {
|
||||||
HandleScope scope(CcTest::isolate());
|
v8::Isolate* isolate = CcTest::isolate();
|
||||||
|
HandleScope scope(isolate);
|
||||||
|
|
||||||
{ AbsentPropertyContext context;
|
{ AbsentPropertyContext context;
|
||||||
context.Check("var x; x",
|
context.Check("var x; x",
|
||||||
1, // access
|
1, // access
|
||||||
1, // declaration
|
1, // declaration
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(isolate));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ AbsentPropertyContext context;
|
{ AbsentPropertyContext context;
|
||||||
@ -367,7 +369,7 @@ TEST(Absent) {
|
|||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(isolate));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ AbsentPropertyContext context;
|
{ AbsentPropertyContext context;
|
||||||
@ -375,7 +377,7 @@ TEST(Absent) {
|
|||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined()); // SB 0 - BUG 1213579
|
EXPECT_RESULT, Undefined(isolate)); // SB 0 - BUG 1213579
|
||||||
}
|
}
|
||||||
|
|
||||||
{ AbsentPropertyContext context;
|
{ AbsentPropertyContext context;
|
||||||
@ -383,7 +385,7 @@ TEST(Absent) {
|
|||||||
1, // access
|
1, // access
|
||||||
1, // declaration
|
1, // declaration
|
||||||
1, // declaration + initialization
|
1, // declaration + initialization
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(isolate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +435,7 @@ TEST(Appearing) {
|
|||||||
1, // access
|
1, // access
|
||||||
1, // declaration
|
1, // declaration
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ AppearingPropertyContext context;
|
{ AppearingPropertyContext context;
|
||||||
@ -457,7 +459,7 @@ TEST(Appearing) {
|
|||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ AppearingPropertyContext context;
|
{ AppearingPropertyContext context;
|
||||||
@ -465,7 +467,7 @@ TEST(Appearing) {
|
|||||||
1, // access
|
1, // access
|
||||||
2, // declaration + initialization
|
2, // declaration + initialization
|
||||||
1, // declaration
|
1, // declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
// Result is undefined because declaration succeeded but
|
// Result is undefined because declaration succeeded but
|
||||||
// initialization to 0 failed (due to context behavior).
|
// initialization to 0 failed (due to context behavior).
|
||||||
}
|
}
|
||||||
@ -525,7 +527,7 @@ TEST(Reappearing) {
|
|||||||
0,
|
0,
|
||||||
3, // const declaration+initialization, var initialization
|
3, // const declaration+initialization, var initialization
|
||||||
3, // 2 x declaration + var initialization
|
3, // 2 x declaration + var initialization
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -564,7 +566,7 @@ TEST(ExistsInPrototype) {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ ExistsInPrototypeContext context;
|
{ ExistsInPrototypeContext context;
|
||||||
@ -580,7 +582,7 @@ TEST(ExistsInPrototype) {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ ExistsInPrototypeContext context;
|
{ ExistsInPrototypeContext context;
|
||||||
@ -617,7 +619,7 @@ TEST(AbsentInPrototype) {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -689,7 +691,7 @@ TEST(ExistsInHiddenPrototype) {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1, // (re-)declaration
|
1, // (re-)declaration
|
||||||
EXPECT_RESULT, Undefined());
|
EXPECT_RESULT, Undefined(CcTest::isolate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mstarzinger): The semantics of global const is vague.
|
// TODO(mstarzinger): The semantics of global const is vague.
|
||||||
|
@ -394,7 +394,7 @@ TEST(HiddenPrototypeObservation) {
|
|||||||
{ obj, "updated", "foo", Number::New(75) }
|
{ obj, "updated", "foo", Number::New(75) }
|
||||||
};
|
};
|
||||||
EXPECT_RECORDS(CompileRun("records"), expected_records);
|
EXPECT_RECORDS(CompileRun("records"), expected_records);
|
||||||
obj->SetPrototype(Null());
|
obj->SetPrototype(Null(isolate.GetIsolate()));
|
||||||
CompileRun("obj.foo = 43");
|
CompileRun("obj.foo = 43");
|
||||||
const RecordExpectation expected_records2[] = {
|
const RecordExpectation expected_records2[] = {
|
||||||
{ obj, "new", "foo", Handle<Value>() }
|
{ obj, "new", "foo", Handle<Value>() }
|
||||||
|
Loading…
Reference in New Issue
Block a user