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

Last line of code doesn't execute in a U2 template #533

Open
adamvy-google opened this issue Jan 15, 2016 · 4 comments

Comments

@adamvy-google
Copy link
Member

commented Jan 15, 2016

Example:

CLASS({
package: 'foam.demos',
name: 'Test',
extends: 'foam.u2.View',
templates: [
function initE() {/*#U2

((console.log("foo");))

((console.log("bar");))
*/}
]
});

If you run this view, you only see "foo" in the console, "bar" is never outputted. Examining the generated code shows that console.log("bar"); isn't even included.

We should either support this case, or warn if it happens.

@kgrgreer

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2016

Will fix.

@adamvy-google

This comment has been minimized.

Copy link
Member Author

commented Jan 15, 2016

Similarly, starting a template with a code statement throws an error as well.

@kgrgreer

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2016

I'm not sure if we can allow code statements before you start an element, but if not, we should at least produce an error.

@kgrgreer

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2016

The code needs to be inside a tag. We need to report template errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.