Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1588)

Unified Diff: test/cctest/test-api.cc

Issue 2655533004: [tests] Fix use-after-scope errors related to weak refs (Closed)
Patch Set: typo Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 1aa8ec99d1932dbeff9c1396f8f16e47d6967bbc..b2e07800a5dd352158570df6bf893f72dda09343 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -7570,13 +7570,14 @@ void InternalFieldCallback(bool global_gc) {
Trivial* t1;
Trivial2* t2;
instance_templ->SetInternalFieldCount(2);
+ v8::Persistent<v8::Object> handle;
{
v8::HandleScope scope(isolate);
Local<v8::Object> obj = templ->GetFunction(env.local())
.ToLocalChecked()
->NewInstance(env.local())
.ToLocalChecked();
- v8::Persistent<v8::Object> handle(isolate, obj);
+ handle.Reset(isolate, obj);
CHECK_EQ(2, obj->InternalFieldCount());
CHECK(obj->GetInternalField(0)->IsUndefined());
t1 = new Trivial(42);
« no previous file with comments | « no previous file | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698