PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

Re-assess bug-related TODOs in scripts

Open philippedistributive opened this issue 1 year ago • 3 comments

Issue type

Other

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

These TODO comments were left around. Are we now able to act on them?

  • require.py: A better implementation in Python that doesn't leak global symbols should be possible once some PythonMonkey bugs are fixed.

  • global-init.js: due to current bugs in PythonMonkey, we can't access the cache property of require because it is a JS function wrapped in a Python function wrapper exposed to script as a native function.

  • pmjs.py: The global require is to the JS function using a trick instead of a JS-wrapped-Python-wrapped function

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 avatar Feb 09 '24 17:02 philippedistributive

I fixed the require.py ones in my branch yesterday, wes/DCP-4054/make-dcp-client-grok-pythonmonkey

I also noticed that we are leaking a util symbol as a side effect of console import, I think, as well as some XMLHttpRequest* symbols that I don't think should be global. Always a good idea to have a look at Object.keys(globalThis) after writing new code.

wesgarland avatar Mar 09 '24 13:03 wesgarland

The XMLHttpRequest* symbols are okay - they are present in the browser

wesgarland avatar Mar 10 '24 01:03 wesgarland

only the one in global-init.js remains

philippedistributive avatar Jul 16 '24 20:07 philippedistributive