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
Open

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

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

Comments

@adamvy-google
Copy link
Member

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
Copy link
Contributor

Will fix.

@adamvy-google
Copy link
Member Author

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

@kgrgreer
Copy link
Contributor

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
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants