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

ES6 sample is broken #51

Closed
ilanc opened this issue Jan 17, 2017 · 2 comments
Closed

ES6 sample is broken #51

ilanc opened this issue Jan 17, 2017 · 2 comments

Comments

@ilanc
Copy link

ilanc commented Jan 17, 2017

The ES6 example seems to be broken both on plunker and when I run locally. I'm still quite new so not sure where to look. The compiler seems to be creating invalid javascript i.e. es.tag.js has:

riot.tag2('es-6', '<p>{getMessage()}</p>', '', '', function(opts) {
'use strict';

var name = 'Riot';
undefined.message = 'Hello ' + name;
undefined.getMessage = function () {
    return undefined.message;
};
});

note the undefined's

@ilanc
Copy link
Author

ilanc commented Jan 17, 2017

If I manually correct this and rerun from the console then it works i.e.

riot.tag2('es-6', '<p>{getMessage()}</p>', '', '', function(opts) {
'use strict';

var name = 'Riot';
this.message = 'Hello ' + name;
this.getMessage = function () {
    return this.message;
};
});
riot.mount('*')

@GianlucaGuarini
Copy link
Member

you are right this example was made with an old babel version. We need to update it using the newest babel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants