feat(TemplateConfig): support array of arrays in TemplateConfig directiv...#600
feat(TemplateConfig): support array of arrays in TemplateConfig directiv...#600marclaval wants to merge 1 commit into
Conversation
|
if traceur compiled methods has function declarations, rather than anonymous function expressions, we could do a completely terse recursive version in one line for extra ambiguity _buildList(tree:any):List<Type> {
return ListWrapper.reduce((item, list) => ListWrapper.concat(item, ListWrapper.isList(list) ? _buildList(list) : list , ListWrapper.create())
}
// or shorthand
_buildList(tree) {
return tree.reduce((item, list) => item.concat(isList(list) ? _buildList(list) : list , []);
}
// or more descriptive
_buildList: _buildList(tree) {
return tree.reduce(function(item, memo) {
if (isList(memo)) {
return _buildList(memo)
} else {
return item.concat(memo);
}
}, [])
} |
|
@gdi2290 I think that is reasonable for JS, but due to way Dart works it is not possible. I am fine with supporting more things in JS and only subset in Dart, but this creates a least common denominator. |
There was a problem hiding this comment.
forEach has perf problems, please don't use: https://github.com/angular/angular/wiki/performance
Also could you reimplement without recursion so that we don't have to have so many temporary arrays which get re-copied during concatenation.
|
Perf cleanup, otherwise it looks good to me. |
|
Thanks for the comments, cleanup done |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
...es
Fixes #592