ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

problems with flatten #559

Closed jvasileff closed 9 years ago

jvasileff commented 9 years ago

What seems like a possible regression with #553:

    [Result*] map<Result, Element>([Element*] items, Result(Element) f)
        =>  items.map(f).sequence();

    [Result*]([Element*]) mapper<Element, Result>(Result(Element) f)
        =>  shuffle(curry(map<Result, Element>))(f);

    mapper(Integer.string)([1,2,3]);

results in:

var $1amo=function($1amp,$1amq,$t$e0az39){return $1amp.$_map($1amq,{Result$map
                                                       ^
TypeError: Object 1 has no method '$_map'

I'm unsure if my attempt to further reduce this exposes a different bug, or the same:

    value mp = uncurry(Sequential<Integer>.map<String>);
    mp([1,2,3], Integer.string);

results in:

if (f.jsc$)f=f.jsc$;
     ^
TypeError: Cannot read property 'jsc$' of undefined
chochos commented 9 years ago

it's probably something similar, but it's not a regression.