You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
dart.list takes an element type. We should investigate using a factory constructor instead.
The problem is that
dart.list([1, 2, 3], core.int)
must to look up the type JSArray<core.int> each time.
We could generate a call to a factory constructor, e.g. named _of,
core.List$(core.int)._of([1, 2, 3])
This would still create the parameterized type, but we can then apply other improvements to the core.List$(core.int) part, e.g. precomputing it or caching it.
List<E>._of(array) could be defined in the patch file. It could simply call JSArray<E>.typed(array)
(we would want to fix #561 to make that faster).
Or List<E>._of could have a precomputed type JSArray<E> available to immediately store on the array.
Something similar could be done with dart.map to enable types to be evaluated less often.
Activity
rakudrama commentedon Jun 2, 2016
List case has been implemented in b2ebb32
is now
where
JSArrayOfint()is the cached evaluation of_interceptors.JSArray$(core.int)Map case is still TODO