Skip to content

Commit 8a362d4

Browse files
make property length calculation consistent
1 parent 4c3ad1c commit 8a362d4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/JSObjectProxy.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyOb
7070
Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self)
7171
{
7272
JS::RootedIdVector props(GLOBAL_CX);
73-
if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props))
73+
if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props))
7474
{
7575
// @TODO (Caleb Aikens) raise exception here
7676
return -1;
@@ -186,7 +186,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr
186186
}
187187

188188
JS::RootedIdVector props(GLOBAL_CX);
189-
if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props))
189+
if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props))
190190
{
191191
// @TODO (Caleb Aikens) raise exception here
192192
return NULL;

tests/python/test_pythonmonkey_eval.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,7 @@ def concatenate(a, b):
286286
codepoint = random.randint(0x0000, 0xFFFF)
287287
string2 += chr(codepoint)
288288
assert caller(concatenate, string1, string2) == string1 + string2
289+
290+
def test_globalThis():
291+
obj = pm.eval('globalThis')
292+
assert str(obj).__contains__("{'python': {'pythonMonkey':")

0 commit comments

Comments
 (0)