2012-03-10 17:27:44 -06:00
|
|
|
;(function() {
|
|
|
|
|
|
|
|
var files = __TESTS__;
|
|
|
|
|
|
|
|
var BREAK_ON_ERROR = false;
|
|
|
|
|
2013-01-03 08:29:40 -06:00
|
|
|
function print(text) {
|
2012-03-10 17:27:44 -06:00
|
|
|
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>';
|
2013-01-03 08:29:40 -06:00
|
|
|
}
|
2012-03-10 17:27:44 -06:00
|
|
|
|
|
|
|
var console = { log: print };
|
|
|
|
|
2013-01-03 08:29:40 -06:00
|
|
|
function load() {}
|
2012-03-10 17:27:44 -06:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
String.prototype.trim = String.prototype.trim || function() {
|
|
|
|
return this.replace(/^\s+|\s+$/g, '');
|
|
|
|
};
|
|
|
|
|
2013-01-03 08:29:40 -06:00
|
|
|
function escape(html, encode) {
|
2012-03-10 17:27:44 -06:00
|
|
|
return html
|
|
|
|
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
|
|
|
|
.replace(/</g, '<')
|
|
|
|
.replace(/>/g, '>')
|
|
|
|
.replace(/"/g, '"')
|
|
|
|
.replace(/'/g, ''');
|
2013-01-03 08:29:40 -06:00
|
|
|
}
|
2012-03-10 17:27:44 -06:00
|
|
|
|
2013-01-03 08:29:40 -06:00
|
|
|
(__MAIN__)();
|
2012-03-10 17:27:44 -06:00
|
|
|
|
|
|
|
}).call(this);
|