Commit 7e5905fd authored by Ross Mcilroy's avatar Ross Mcilroy Committed by Commit Bot

[cleanup] Replace deprecated calls to PrimitiveArray.Get/Set.

Replace with isolate versions

BUG=v8:7754

Change-Id: I69cf1e0d4cba6d68a3983c0dba346bfc1bfc9619
Reviewed-on: https://chromium-review.googlesource.com/1146182
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54607}
parent c0766d66
...@@ -19522,7 +19522,7 @@ THREADED_TEST(ScriptOrigin) { ...@@ -19522,7 +19522,7 @@ THREADED_TEST(ScriptOrigin) {
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
Local<v8::PrimitiveArray> array(v8::PrimitiveArray::New(isolate, 1)); Local<v8::PrimitiveArray> array(v8::PrimitiveArray::New(isolate, 1));
Local<v8::Symbol> symbol(v8::Symbol::New(isolate)); Local<v8::Symbol> symbol(v8::Symbol::New(isolate));
array->Set(0, symbol); array->Set(isolate, 0, symbol);
v8::ScriptOrigin origin = v8::ScriptOrigin( v8::ScriptOrigin origin = v8::ScriptOrigin(
v8_str("test"), v8::Integer::New(env->GetIsolate(), 1), v8_str("test"), v8::Integer::New(env->GetIsolate(), 1),
...@@ -19550,7 +19550,7 @@ THREADED_TEST(ScriptOrigin) { ...@@ -19550,7 +19550,7 @@ THREADED_TEST(ScriptOrigin) {
CHECK(script_origin_f.Options().IsSharedCrossOrigin()); CHECK(script_origin_f.Options().IsSharedCrossOrigin());
CHECK(script_origin_f.Options().IsOpaque()); CHECK(script_origin_f.Options().IsOpaque());
printf("is name = %d\n", script_origin_f.SourceMapUrl()->IsUndefined()); printf("is name = %d\n", script_origin_f.SourceMapUrl()->IsUndefined());
CHECK(script_origin_f.HostDefinedOptions()->Get(0)->IsSymbol()); CHECK(script_origin_f.HostDefinedOptions()->Get(isolate, 0)->IsSymbol());
CHECK_EQ(0, strcmp("http://sourceMapUrl", CHECK_EQ(0, strcmp("http://sourceMapUrl",
*v8::String::Utf8Value(env->GetIsolate(), *v8::String::Utf8Value(env->GetIsolate(),
...@@ -19568,7 +19568,7 @@ THREADED_TEST(ScriptOrigin) { ...@@ -19568,7 +19568,7 @@ THREADED_TEST(ScriptOrigin) {
CHECK_EQ(0, strcmp("http://sourceMapUrl", CHECK_EQ(0, strcmp("http://sourceMapUrl",
*v8::String::Utf8Value(env->GetIsolate(), *v8::String::Utf8Value(env->GetIsolate(),
script_origin_g.SourceMapUrl()))); script_origin_g.SourceMapUrl())));
CHECK(script_origin_g.HostDefinedOptions()->Get(0)->IsSymbol()); CHECK(script_origin_g.HostDefinedOptions()->Get(isolate, 0)->IsSymbol());
} }
...@@ -27889,7 +27889,9 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamicallyCallbackResolve( ...@@ -27889,7 +27889,9 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamicallyCallbackResolve(
String::Utf8Value referrer_utf8( String::Utf8Value referrer_utf8(
context->GetIsolate(), Local<String>::Cast(referrer->GetResourceName())); context->GetIsolate(), Local<String>::Cast(referrer->GetResourceName()));
CHECK_EQ(0, strcmp("www.google.com", *referrer_utf8)); CHECK_EQ(0, strcmp("www.google.com", *referrer_utf8));
CHECK(referrer->GetHostDefinedOptions()->Get(0)->IsSymbol()); CHECK(referrer->GetHostDefinedOptions()
->Get(context->GetIsolate(), 0)
->IsSymbol());
CHECK(!specifier.IsEmpty()); CHECK(!specifier.IsEmpty());
String::Utf8Value specifier_utf8(context->GetIsolate(), specifier); String::Utf8Value specifier_utf8(context->GetIsolate(), specifier);
...@@ -28059,41 +28061,41 @@ TEST(PrimitiveArray) { ...@@ -28059,41 +28061,41 @@ TEST(PrimitiveArray) {
CHECK_EQ(length, array->Length()); CHECK_EQ(length, array->Length());
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
Local<v8::Primitive> item = array->Get(i); Local<v8::Primitive> item = array->Get(isolate, i);
CHECK(item->IsUndefined()); CHECK(item->IsUndefined());
} }
Local<v8::Symbol> symbol(v8::Symbol::New(isolate)); Local<v8::Symbol> symbol(v8::Symbol::New(isolate));
array->Set(0, symbol); array->Set(isolate, 0, symbol);
CHECK(array->Get(0)->IsSymbol()); CHECK(array->Get(isolate, 0)->IsSymbol());
Local<v8::String> string = Local<v8::String> string =
v8::String::NewFromUtf8(isolate, "test", v8::NewStringType::kInternalized) v8::String::NewFromUtf8(isolate, "test", v8::NewStringType::kInternalized)
.ToLocalChecked(); .ToLocalChecked();
array->Set(1, string); array->Set(isolate, 1, string);
CHECK(array->Get(0)->IsSymbol()); CHECK(array->Get(isolate, 0)->IsSymbol());
CHECK(array->Get(1)->IsString()); CHECK(array->Get(isolate, 1)->IsString());
Local<v8::Number> num = v8::Number::New(env->GetIsolate(), 3.1415926); Local<v8::Number> num = v8::Number::New(env->GetIsolate(), 3.1415926);
array->Set(2, num); array->Set(isolate, 2, num);
CHECK(array->Get(0)->IsSymbol()); CHECK(array->Get(isolate, 0)->IsSymbol());
CHECK(array->Get(1)->IsString()); CHECK(array->Get(isolate, 1)->IsString());
CHECK(array->Get(2)->IsNumber()); CHECK(array->Get(isolate, 2)->IsNumber());
v8::Local<v8::Boolean> f = v8::False(isolate); v8::Local<v8::Boolean> f = v8::False(isolate);
array->Set(3, f); array->Set(isolate, 3, f);
CHECK(array->Get(0)->IsSymbol()); CHECK(array->Get(isolate, 0)->IsSymbol());
CHECK(array->Get(1)->IsString()); CHECK(array->Get(isolate, 1)->IsString());
CHECK(array->Get(2)->IsNumber()); CHECK(array->Get(isolate, 2)->IsNumber());
CHECK(array->Get(3)->IsBoolean()); CHECK(array->Get(isolate, 3)->IsBoolean());
v8::Local<v8::Primitive> n = v8::Null(isolate); v8::Local<v8::Primitive> n = v8::Null(isolate);
array->Set(4, n); array->Set(isolate, 4, n);
CHECK(array->Get(0)->IsSymbol()); CHECK(array->Get(isolate, 0)->IsSymbol());
CHECK(array->Get(1)->IsString()); CHECK(array->Get(isolate, 1)->IsString());
CHECK(array->Get(2)->IsNumber()); CHECK(array->Get(isolate, 2)->IsNumber());
CHECK(array->Get(3)->IsBoolean()); CHECK(array->Get(isolate, 3)->IsBoolean());
CHECK(array->Get(4)->IsNull()); CHECK(array->Get(isolate, 4)->IsNull());
} }
TEST(PersistentValueMap) { TEST(PersistentValueMap) {
......
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