ES6 sample is broken #51

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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@ilanc

ilanc 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('*')

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Jan 17, 2017

Member

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

Member

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