ceylon/ceylon-js — Issue #51: nonempty breaks
Author: chochos
Created: 2012-02-28 16:45:09+00:00
State: open

ceylon.language.js has a `nonempty` function, however it not being used anymore *but it should*; this code:

````
void x(String? p) {
if (nonempty p) {
print("p es " p "");
}
}
````

generates `if (p.getEmpty()===$$$cl15.getFalse())` when it should generate `if ($$$cl15.nonempty(f)===$$$cl15.getTrue)`, because `nonempty` checks that the value is not null and *then* that it is not empty. Doing just `p.getEmpty()` breaks when passed a null (which is valid because it's optional type).