Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Toby Inkster

By: a guest on Aug 5th, 2010  |  syntax: JavaScript  |  size: 0.41 KB  |  views: 304  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function MyBigFunctionThatConvertsManyTypes (value, type)
  2. {
  3.   // ...
  4. }
  5.  
  6. context.registerTypeConversion('xsd:integer', function(x){ MyBigFunctionThatConvertsManyTypes(x, 'integer'); });
  7. context.registerTypeConversion('xsd:double', function(x){ MyBigFunctionThatConvertsManyTypes(x, 'double'); });
  8. context.registerTypeConversion('xsd:dateTime', function(x){ MyBigFunctionThatConvertsManyTypes(x, 'dateTime'); });