aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-06 20:20:08 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-06 20:20:08 -0800
commite547efbf4ad6b4356e2a97f2238cc55426aaed38 (patch)
tree586d674a27c7c5da841d7ed2941fc3edb404dba6 /src
parent3d243e5e957d8914d0731c3cd188490aefda8fa6 (diff)
downloadbun-e547efbf4ad6b4356e2a97f2238cc55426aaed38.tar.gz
bun-e547efbf4ad6b4356e2a97f2238cc55426aaed38.tar.zst
bun-e547efbf4ad6b4356e2a97f2238cc55426aaed38.zip
Don't call getters in console.log
Diffstat (limited to '')
-rw-r--r--src/bun.js/bindings/bindings.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index b973052a7..b5a78af0a 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -3420,7 +3420,7 @@ restart:
bool anyHits = false;
JSC::JSObject* objectToUse = prototypeObject.getObject();
structure->forEachProperty(vm, [&](const PropertyTableEntry& entry) -> bool {
- if ((entry.attributes() & PropertyAttribute::Accessor) != 0 && (entry.attributes() & PropertyAttribute::DontEnum) != 0) {
+ if ((entry.attributes() & PropertyAttribute::Accessor) != 0) {
return true;
}
@@ -3499,10 +3499,11 @@ restart:
if (!object->getPropertySlot(globalObject, property, slot))
continue;
+ if ((slot.attributes() & PropertyAttribute::Accessor) != 0) {
+ continue;
+ }
+
if ((slot.attributes() & PropertyAttribute::DontEnum) != 0) {
- if ((slot.attributes() & PropertyAttribute::Accessor) != 0) {
- continue;
- }
if (property == vm.propertyNames->length || property == vm.propertyNames->name || property == vm.propertyNames->underscoreProto || property == vm.propertyNames->toStringTagSymbol)
continue;