aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/inspector/v8-debugger.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-05-18 18:49:41 +0200
committerMyles Borins <mylesborins@google.com>2018-06-01 09:59:15 +0200
commit109ba58b5f6fe42a4a22b990eb5fb21946012727 (patch)
tree67b40ceeac8e4f43d00df4eb668ad8dd408dbb8d /deps/v8/src/inspector/v8-debugger.cc
parent1fb0b2cb92bdfb0b73cd4d333436794775d4630d (diff)
downloadandroid-node-v8-109ba58b5f6fe42a4a22b990eb5fb21946012727.tar.gz
android-node-v8-109ba58b5f6fe42a4a22b990eb5fb21946012727.tar.bz2
android-node-v8-109ba58b5f6fe42a4a22b990eb5fb21946012727.zip
deps: cherry-pick ff0a9793334 from upstream V8
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing nodejs/node#20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: https://github.com/v8/v8/commit/ff0a979333408f544f081489411814b84df6e2d9 PR-URL: https://github.com/nodejs/node/pull/20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/v8/src/inspector/v8-debugger.cc')
-rw-r--r--deps/v8/src/inspector/v8-debugger.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/deps/v8/src/inspector/v8-debugger.cc b/deps/v8/src/inspector/v8-debugger.cc
index 1cdbce27e6..01e9acd9c9 100644
--- a/deps/v8/src/inspector/v8-debugger.cc
+++ b/deps/v8/src/inspector/v8-debugger.cc
@@ -29,8 +29,10 @@ v8::MaybeLocal<v8::Array> collectionsEntries(v8::Local<v8::Context> context,
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::Array> entries;
bool isKeyValue = false;
- if (!v8::debug::EntriesPreview(isolate, value, &isKeyValue).ToLocal(&entries))
+ if (!value->IsObject() ||
+ !value.As<v8::Object>()->PreviewEntries(&isKeyValue).ToLocal(&entries)) {
return v8::MaybeLocal<v8::Array>();
+ }
v8::Local<v8::Array> wrappedEntries = v8::Array::New(isolate);
CHECK(!isKeyValue || wrappedEntries->Length() % 2 == 0);