Skip to content

Commit

Permalink
[cleanup] Fix uses deprecated v8 Object::Get in gin
Browse files Browse the repository at this point in the history
Bug: v8:7283, v8:8562
Change-Id: I037bfb3818fdb9f92d5d9e0a8a71152ccdddade3
Reviewed-on: https://chromium-review.googlesource.com/c/1450255
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628380}
  • Loading branch information
danelphick authored and Commit Bot committed Feb 1, 2019
1 parent 0808c72 commit d7eeb4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions gin/converter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,12 @@ TEST_F(ConverterTest, Vector) {
Converter<std::vector<int>>::ToV8(instance_->isolate(), expected)
.As<Array>();
EXPECT_EQ(3u, js_array->Length());
v8::Local<v8::Context> context = instance_->isolate()->GetCurrentContext();
for (size_t i = 0; i < expected.size(); ++i) {
EXPECT_TRUE(Integer::New(instance_->isolate(), expected[i])
->StrictEquals(js_array->Get(static_cast<int>(i))));
EXPECT_TRUE(
Integer::New(instance_->isolate(), expected[i])
->StrictEquals(
js_array->Get(context, static_cast<int>(i)).ToLocalChecked()));
}
}

Expand Down
7 changes: 5 additions & 2 deletions gin/shell_runner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ TEST(RunnerTest, Run) {
runner.Run(source, "test_data.js");

std::string result;
EXPECT_TRUE(Converter<std::string>::FromV8(isolate,
runner.global()->Get(StringToV8(isolate, "result")),
EXPECT_TRUE(Converter<std::string>::FromV8(
isolate,
runner.global()
->Get(isolate->GetCurrentContext(), StringToV8(isolate, "result"))
.ToLocalChecked(),
&result));
EXPECT_EQ("PASS", result);
}
Expand Down

0 comments on commit d7eeb4a

Please sign in to comment.