forked from skulpt/skulpt
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ffi: preserve arrays on javascript objects #27
Open
s-cork
wants to merge
227
commits into
master
Choose a base branch
from
ffi/array
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…-on-specific-module feat: select module to run unit tests on
make circular import errors work with current import implementation
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Fix nesting import chaining
…ots__ if compatable
…t from prepare. Being careful with IE.
Implement __import__
…ing in v8 - tests currently broken on latest version of Node
…nimist-1.2.6 build(deps): bump minimist from 1.2.5 to 1.2.6
…requires constant folding to be fully inline with cpython for -ve numbers
fractions module
fix not possible for null to be an attribute
…ied to actual regex.
Fix lookbehind assertion browser test.
Co-authored-by: stu <[email protected]>
New review process
fix some re compile errors
re: fix more javascript escape fails
…e while we're here
dict: fix setattr should not call mp$ass_subscript on the `__dict__`
Fix unreserve words to __set_name__
ffi: wrap Symbols
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when we interop with javascript objects on window
If we get an array, we return a python copy of this array
I've found this to be problematic
We lose mutability
Some javascript libraries do crazy things with arrays
(See below)
When returning an Array from a proxied javascript object
This PR instead returns a ProxyList
Which is very similar to a python list
But, the internal Array is a Proxy of the original Javascript Array
Now we essentially have the same reference and mutating the ProxyList mutates the original list
I've added tests to demonstrate this interopability
Example in an app we had failing:
This was from segment.
They used this array as a placeholder while the real window.analytics object was loaded.
It then preceeded to do things like analytics.track=()=>{...}
But interop converted window.analytics to a pure python list so it wasn't possible to use the placeholder in python.
Considerations
Why not two way? i.e. sending a python list to a proxied javascript object should be the same reference as the original python list.
I'm happy to add support for this
But I felt it was less of a concern
It probably wouldn't be too hard