Distributive-Network / PythonMonkey

A Mozilla SpiderMonkey JavaScript engine embedded into the Python VM, using the Python engine to provide the JS host environment.
https://pythonmonkey.io
Other
854 stars 40 forks source link

Proxy iteration does not look at Symbol.iterator #411

Closed philippedistributive closed 3 months ago

philippedistributive commented 3 months ago

Issue type

Bug

How did you install PythonMonkey?

None

OS platform and distribution

No response

Python version (python --version)

No response

PythonMonkey version (pip show pythonmonkey)

No response

Bug Description

if JS class being iterated over in python context defines Symbol.iterator, use it.

Right now we do: Get the JS keys using the JSITER_OWNONLY flag which has semantics:

iterate over obj's own properties only -> Get enumerable own properties

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

No response

Additional info if applicable

No response

What branch of PythonMonkey were you developing on? (If applicable)

No response

philippedistributive commented 3 months ago

This was a misguided effort, what we are doing is providing a Python mechanism on a JS object. We are following Python semantics