formatOutput = function (content) {
                                var testResults,
                                    format = (args.format || '').toLowerCase(),
                                    harness = {
                                        'tap': {
                                            func: ysutil.formatAsTAP,
                                            contentType: 'text/plain'
                                        },
                                        'junit': {
                                            func: ysutil.formatAsJUnit,
                                            contentType: 'text/xml'
                                        }
                                    };

                                switch (format) {
                                case 'xml':
                                    return {
                                        content: ysutil.objToXML(content),
                                        contentType: 'text/xml'
                                    };
                                case 'plain':
                                    return {
                                        content: ysutil.prettyPrintResults(
                                            content
                                        ),
                                        contentType: 'text/plain'
                                    };
                                // test formats
                                case 'tap':
                                case 'junit':
                                    try {
                                        threshold = JSON.parse(args.threshold);
                                    } catch (err) {
                                        threshold = args.threshold;
                                    }
                                    testResults = harness[format].func(
                                        ysutil.testResults(
                                            content,
                                            threshold
                                        )
                                    );
                                    return {
                                        content: testResults.content,
                                        contentType: harness[format].contentType,
                                        failures: testResults.failures
                                    };
                                default:
                                    return {
                                        content: JSON.stringify(content),
                                        contentType: 'application/json'
                                    };
                                }
                            }
JSLint is tolerating evil because there's a Function constructor needed to
inject the content coming from phantom arguments and page resources which is
later evaluated into the page in order to run YSlow.