ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

Support return statement in constructors #548

Closed chochos closed 9 years ago

chochos commented 9 years ago

return is (will be) allowed in constructors. But it should only return from the constructor's statements, and continue executing the class initializer code.

See ceylon/ceylon-spec#1288

chochos commented 9 years ago

Looks like it's done.

gavinking commented 9 years ago

Yay! That was tricky, I bet!

chochos commented 9 years ago

I worked on it for a while, couldn't really figure out how to solve it, left it while I split the ClassDeclaration thing... then came back to it and kind of had an epiphany hahahah, the solution was surprisingly easy, thanks to the shitty weird things js lets you do.

gavinking commented 9 years ago

Cool :)

tombentley commented 9 years ago

@chochos I guess you meant to close this?

chochos commented 9 years ago

Not until we can add some tests in the language module and they all pass...

chochos commented 9 years ago

I added some (very basic) tests in the language module. Closing.