Skip to content

Commit d348eff

Browse files
author
Matheus Marchini
committed
src: fix inspection of read-only properties
Read-onlyness shouldn't influnece from where we read the property data. Fixes: #209 PR-URL: #221 Fixes: #198 Refs: #209 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 295a084 commit d348eff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/llv8-inl.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,7 @@ inline bool DescriptorArray::IsConstFieldDetails(Smi details) {
510510
}
511511

512512
// node.js >= 8
513-
return (details.GetValue() &
514-
v8()->descriptor_array()->kPropertyAttributesMask) ==
515-
(v8()->descriptor_array()->kPropertyAttributesEnum_READ_ONLY
516-
<< v8()->descriptor_array()->kPropertyAttributesShift);
513+
return false;
517514
}
518515

519516
inline bool DescriptorArray::IsDoubleField(Smi details) {

src/llv8.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace llnode {
1111
namespace v8 {
1212

13-
using lldb::addr_t;
1413
using lldb::SBError;
1514
using lldb::SBTarget;
15+
using lldb::addr_t;
1616

1717
static std::string kConstantPrefix = "v8dbg_";
1818

@@ -1516,7 +1516,8 @@ std::string JSObject::InspectDescriptors(Map map, Error& err) {
15161516
res += " ." + key.ToString(err) + "=";
15171517
if (err.Fail()) return std::string();
15181518

1519-
if (descriptors.IsConstFieldDetails(details) || descriptors.IsDescriptorDetails(details)) {
1519+
if (descriptors.IsConstFieldDetails(details) ||
1520+
descriptors.IsDescriptorDetails(details)) {
15201521
Value value;
15211522

15221523
value = descriptors.GetValue(i, err);
@@ -1665,7 +1666,8 @@ std::vector<std::pair<Value, Value>> JSObject::DescriptorEntries(Map map,
16651666
Value key = descriptors.GetKey(i, err);
16661667
if (err.Fail()) continue;
16671668

1668-
if (descriptors.IsConstFieldDetails(details)) {
1669+
if (descriptors.IsConstFieldDetails(details) ||
1670+
descriptors.IsDescriptorDetails(details)) {
16691671
Value value;
16701672

16711673
value = descriptors.GetValue(i, err);
@@ -1871,7 +1873,8 @@ Value JSObject::GetDescriptorProperty(std::string key_name, Map map,
18711873
// Found the right key, get the value.
18721874
if (err.Fail()) return Value();
18731875

1874-
if (descriptors.IsConstFieldDetails(details)) {
1876+
if (descriptors.IsConstFieldDetails(details) ||
1877+
descriptors.IsDescriptorDetails(details)) {
18751878
Value value;
18761879

18771880
value = descriptors.GetValue(i, err);

0 commit comments

Comments
 (0)