Skip to content

Commit aad51c4

Browse files
Merge pull request #226 from Distributive-Network/philippe/globalThis-fix
Philippe/global this fix
2 parents 6f33f92 + 8a362d4 commit aad51c4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
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_dict_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def test_items_len():
434434
# items = dishes.items()
435435
# assert {('eggs', 2)} in items
436436

437-
def test_values_update_object_updates_the_items():
437+
def test_items_update_object_updates_the_items():
438438
employee = pm.eval("({'name': 'Phil', 'age': 22})")
439439
dictionaryItems = employee.items()
440440
employee.update({('salary', 3500.0)})

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)