-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Support for Node 4 #109
Comments
I've seen you use dangerousForOf in projects before, what's different about the loops in svelte that doesn't allow that? |
Technically, Bublé is focused on generating lean code that runs fast, so it doesn't let you do that. The for ( var i = 0, list = y; i < list.length; i += 1 ) {
var x = list[i];
// ...
} In Svelte we're using for-of with a tokenizer that implements the Iterator protocol, rather than an array-like object. So |
Oh I see, interesting. When using buble I'd always just used it straightaway and it seemed to work, so I wasn't sure exactly its conditions. Maybe I should go back and check now though. |
Hey Rich - just stumbled on this issue - I had a fork of buble sitting around that I was using for node 4 support for some private project that fixed this issue - I just wrote up a PR for it at https://gitlab.com/Rich-Harris/buble/merge_requests/109 |
So what do you want to do for this? Just remove all cases of |
I think so, IIRC — there might be some other stuff that doesn't work in Node 4 (or older browsers), but it might be just that |
Due to laziness on my part, Svelte currently only runs in Node 6 and above. We should transpile it to ES5 using either Babel or Bublé (Bublé would be faster and require less config, but we would have to rewrite code that uses
for ( const x of y ) {...}
)The text was updated successfully, but these errors were encountered: