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

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

Issue 1428793002: Reland v8::Private and related APIs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 2 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:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index a0cc2cdb76cd27a17ff8787e9389b9e43b18d605..b6e6e1b4d22c48bc9d23c771c9d1fba9ac91ed81 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -4652,9 +4652,11 @@ TEST(NoHiddenProperties) {
v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(
env->Global()->Get(v8::String::NewFromUtf8(isolate, "obj")));
// Set a hidden property on the object.
- obj->SetHiddenValue(
- v8::String::NewFromUtf8(isolate, "v8::test-debug::a"),
- v8::Int32::New(isolate, 11));
+ obj->SetPrivate(env.context(),
+ v8::Private::New(isolate, v8::String::NewFromUtf8(
+ isolate, "v8::test-debug::a")),
+ v8::Int32::New(isolate, 11))
+ .FromJust();
// Get mirror for the object with property getter.
CompileRun("var obj_mirror = debug.MakeMirror(obj);");
@@ -4681,18 +4683,23 @@ TEST(NoHiddenProperties) {
// Create proto objects, add hidden properties to them and set them on
// the global object.
v8::Handle<v8::Object> protoObj = t0->GetFunction()->NewInstance();
- protoObj->SetHiddenValue(
- v8::String::NewFromUtf8(isolate, "v8::test-debug::b"),
- v8::Int32::New(isolate, 12));
+ protoObj->SetPrivate(
+ env.context(),
+ v8::Private::New(isolate, v8::String::NewFromUtf8(
+ isolate, "v8::test-debug::b")),
+ v8::Int32::New(isolate, 12))
+ .FromJust();
env->Global()->Set(v8::String::NewFromUtf8(isolate, "protoObj"),
protoObj);
v8::Handle<v8::Object> grandProtoObj = t1->GetFunction()->NewInstance();
- grandProtoObj->SetHiddenValue(
- v8::String::NewFromUtf8(isolate, "v8::test-debug::c"),
- v8::Int32::New(isolate, 13));
- env->Global()->Set(
- v8::String::NewFromUtf8(isolate, "grandProtoObj"),
- grandProtoObj);
+ grandProtoObj->SetPrivate(
+ env.context(),
+ v8::Private::New(isolate, v8::String::NewFromUtf8(
+ isolate, "v8::test-debug::c")),
+ v8::Int32::New(isolate, 13))
+ .FromJust();
+ env->Global()->Set(v8::String::NewFromUtf8(isolate, "grandProtoObj"),
+ grandProtoObj);
// Setting prototypes: obj->protoObj->grandProtoObj
protoObj->Set(v8::String::NewFromUtf8(isolate, "__proto__"),

Powered by Google App Engine
This is Rietveld 408576698