-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TypeError: Cannot read property 'length' of undefined (Caused by arrow functions in module) #1078
Comments
Where does this error come from? The Web IDE? I guess it's not from Espruino itself as there is no use of Unfortunately Espruino doesn't support all of ES6 so |
Yes it comes from the Web IDE and as far as i can tell the uploaded code works fine so far. |
Looks like it's a bug inside the esprima minification library that's being used. If you turn off module minification in settings, or turn it to the online minification, it should work |
Both suggestions work. I will use the online closure minifier for now. |
Closing this - as moved to EspruinoTools now: espruino/EspruinoTools#58 |
If i use arrow functions in a module i get an error while uploading the code via send button from WebIDE to espruino (wifi).
The error is:
TypeError: Cannot read property 'length' of undefined
Minimal test module (test.js):
Simply require the module and upload code to espruino will trigger the error.
Right hand side of WebIDE:
If i replace the arrow function
this.mtFn
with a 'normal' functionthis.mtFn = function () {};
i get no error.The text was updated successfully, but these errors were encountered: