1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- ;(function() {
- var console = {}
- , files = __TESTS__;
- console.log = function(text) {
- var args = Array.prototype.slice.call(arguments, 1)
- , i = 0;
- text = text.replace(/%\w/g, function() {
- return args[i++] || '';
- });
- if (window.console) window.console.log(text);
- document.body.innerHTML += '<pre>' + escape(text) + '</pre>';
- };
- if (!Object.keys) {
- Object.keys = function(obj) {
- var out = []
- , key;
- for (key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- out.push(key);
- }
- }
- return out;
- };
- }
- if (!Array.prototype.forEach) {
- Array.prototype.forEach = function(callback, context) {
- for (var i = 0; i < this.length; i++) {
- callback.call(context || null, this[i], i, obj);
- }
- };
- }
- if (!String.prototype.trim) {
- String.prototype.trim = function() {
- return this.replace(/^\s+|\s+$/g, '');
- };
- }
- function load() {
- return files;
- }
- function escape(html, encode) {
- return html
- .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
- }
- (__MAIN__)();
- }).call(this);
|