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
Labels

Comments

@ilanc
Copy link

@ilanc 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 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

@GianlucaGuarini GianlucaGuarini commented Jan 17, 2017

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.