Skip to content
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

Fix aget/aset use with objects #325

Merged
merged 23 commits into from
Dec 31, 2018
Merged

Fix aget/aset use with objects #325

merged 23 commits into from
Dec 31, 2018

Conversation

Deraen
Copy link
Member

@Deraen Deraen commented Nov 18, 2017

This removes the interop macros which used aget/aset and prevented
Closure naming mangling, now normal property and method access is used
where possible, and goog.object used when using variable keys. Further
testing is needed to ensure this works correctly with Closure, as there
are some properties that are used with goog.object in one place, and as
property in another.

Fixes #324

This still throws several assertion errors, caused by aset currently checking that index is inside existing array, though JS arrays automatically grow when assigning values to new indices: Assert failed: (< idx (alength array))

@Deraen Deraen added the WIP label Nov 28, 2017
@mfikes
Copy link

mfikes commented Apr 4, 2018

FWIW, I asked about assigning new indices via aset and David Nolen's view is that something like

(let [a (into-array [0 1])] 
  (aset a 2 2) 
  a)

is not a correct program, but he he admits that it is also sufficiently host-y where it's a bit of an edgecase.

Deraen added 2 commits April 19, 2018 17:25
This removes the interop macros which used aget/aset and prevented
Closure naming mangling, now normal property and method access is used
where possible, and goog.object used when using variable keys. Further
testing is needed to ensure this works correctly with Closure, as there
are some properties that are used with goog.object in one place, and as
property in another.

Fixes #324
Deraen added 9 commits April 19, 2018 19:35
- Use two types to store native and hiccup data
- Rename comp to component so cljs.core/comp is not shadowd
- Use className instead of class property
- Rename name property to tag
- Use static properties for React key

Use of static properties in this and other commits shrinks test-suite
output size by 2-3kB.
@Deraen Deraen merged commit 88e9833 into master Dec 31, 2018
@Deraen Deraen deleted the fix-array-ops branch November 26, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants