Proxino/TypedJS — Issue #15: Objects: Enforce types on properties mentioned
Author: goatslacker
Created: 2012-02-19 11:41:55+00:00
State: open

It's a little late for me so I don't have a good code sample. I'll get one tomorrow.

In the meantime this seems to be failing:

//+ foo: { hello: String } -> String
function foo(o) {
return o.hello;
}

foo({ hello: 'foo', world: 'bar' }); // will fail because world is not typed.

You could make an argument that it should throw a TypeError but I'd like for there to be an option.