Guards

Sam Tobin-Hochstadt samth at ccs.neu.edu
Fri May 27 13:24:45 PDT 2011


On Fri, May 27, 2011 at 4:03 PM, Peter Michaux <petermichaux at gmail.com> wrote:
> On Fri, May 27, 2011 at 12:55 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>> On Fri, May 27, 2011 at 1:59 PM, Peter Michaux <petermichaux at gmail.com> wrote:
>>>
>>> A minifier could, couldn't it?
>>>
>>> function foo(a::MyType) {}
>>>
>>> would be minified to
>>>
>>> function foo(a) {}
>>
>> These are not the same function at all.
>
> Why?

Because foo(7) produces a TypeError in one, and |undefined| in the
other (assuming that MyType isn't Number).
-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list