Bug 960619 - part 5 - avoid warning about non-top-level-ish declaration of functions in SimpleTest.js; r=jmaher

This commit is contained in:
Nathan Froyd 2014-01-16 09:57:15 -05:00
parent 646e9152c0
commit 538e26345d

View File

@ -51,7 +51,7 @@ var isPrimaryTestWindow = !!parent.TestRunner || (parent == window && !opener);
/* Helper functions pulled out of various MochiKit modules */
if (typeof(repr) == 'undefined') {
function repr(o) {
this.repr = function(o) {
if (typeof(o) == "undefined") {
return "undefined";
} else if (o === null) {
@ -94,7 +94,7 @@ if (typeof(repr) == 'undefined') {
* This is used by SimpleTest.showReport
*/
if (typeof(partial) == 'undefined') {
function partial(func) {
this.partial = function(func) {
var args = [];
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
@ -111,7 +111,7 @@ if (typeof(partial) == 'undefined') {
}
if (typeof(getElement) == 'undefined') {
function getElement(id) {
this.getElement = function(id) {
return ((typeof(id) == "string") ?
document.getElementById(id) : id);
};
@ -137,7 +137,7 @@ SimpleTest._newCallStack = function(path) {
};
if (typeof(addLoadEvent) == 'undefined') {
function addLoadEvent(func) {
this.addLoadEvent = function(func) {
var existing = window["onload"];
var regfunc = existing;
if (!(typeof(existing) == 'function'
@ -175,7 +175,7 @@ function createEl(type, attrs, html) {
/* lots of tests use this as a helper to get css properties */
if (typeof(computedStyle) == 'undefined') {
function computedStyle(elem, cssProperty) {
this.computedStyle = function(elem, cssProperty) {
elem = getElement(elem);
if (elem.currentStyle) {
return elem.currentStyle[cssProperty];