Skip to content

Instantly share code, notes, and snippets.

@pjlsergeant
Created August 18, 2011 21:32
Show Gist options
  • Select an option

  • Save pjlsergeant/1155286 to your computer and use it in GitHub Desktop.

Select an option

Save pjlsergeant/1155286 to your computer and use it in GitHub Desktop.
// And then...
var square = c.func({
'input': function () {
this.assert( arguments.length == 1, Error("Wrong number of arguments" ) );
this.assert( typeof arguments[0] == 'number', Error('Argument is a number') );
},
'output': function () {
this.assert( typeof arguments[0] == 'number', Error('Output is a number') );
},
'body': function (target) {
return target * target;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment