String contents = "function(){" + source.getContents() + "\n}";
String code = null;
in = new JsonStreamReader(new StringReader(contents), getHandlerProvider());
try {
in.next();
JsFunction function = (JsFunction) in.getValue();
code = function.getBody();
} catch (JsonParseException pe) {
// EVIL: JsonStreamReader doesn't handle js regex during parse, so we can end up here unexpectedly
// TODO: will have to find better impl to sanitize and validate library content
// until then, at least strip out multi-line comments
code = source.getContents();