prototype: Add some missing semicolons to the source tree. Closes #9140.

This commit is contained in:
Sam Stephenson 2007-08-07 19:41:13 +00:00
parent 12f87a77a7
commit c9a0485b60
10 changed files with 27 additions and 27 deletions

View File

@ -8,7 +8,7 @@ var Ajax = {
},
activeRequestCount: 0
}
};
Ajax.Responders = {
responders: [],
@ -59,7 +59,7 @@ Ajax.Base.prototype = {
parameters: '',
evalJSON: true,
evalJS: true
}
};
Object.extend(this.options, options || {});
this.options.method = this.options.method.toLowerCase();
@ -310,7 +310,7 @@ Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
this.container = {
success: (container.success || container),
failure: (container.failure || (container.success ? null : container))
}
};
this.transport = Ajax.getTransport();
this.setOptions(options);

View File

@ -124,13 +124,13 @@ if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
for (; i < length; i++)
if (this[i] === item) return i;
return -1;
}
};
if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
var n = this.slice(0, i).reverse().indexOf(item);
return (n < 0) ? n : i - n - 1;
}
};
Array.prototype.toArray = Array.prototype.clone;
@ -152,5 +152,5 @@ if (Prototype.Browser.Opera){
}
}
return array;
}
};
}

View File

@ -389,7 +389,7 @@ Element.Methods = {
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
}
for (var property in styles)
if (property == 'opacity') element.setOpacity(styles[property])
if (property == 'opacity') element.setOpacity(styles[property]);
else
elementStyle[(property == 'float' || property == 'cssFloat') ?
(elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
@ -712,7 +712,7 @@ if (!document.createRange || Prototype.Browser.Opera) {
}
return element;
}
};
}
if (Prototype.Browser.Opera) {
@ -879,7 +879,7 @@ else if (Prototype.Browser.WebKit) {
} catch (e) { }
return element;
}
};
// Safari returns margins on body which is incorrect if the child is absolutely
// positioned. For performance reasons, redefine Position.cumulativeOffset for
@ -896,7 +896,7 @@ else if (Prototype.Browser.WebKit) {
} while (element);
return [valueL, valueT];
}
};
}
if (Prototype.Browser.IE || Prototype.Browser.Opera) {
@ -959,7 +959,7 @@ Element._returnOffset = function(l, t) {
};
Element._getContentFromAnonymousElement = function(tagName, html) {
var div = new Element('div'); t = Element._insertionTranslations.tags[tagName]
var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
div.innerHTML = t[0] + html + t[1];
t[2].times(function() { div = div.firstChild });
return $A(div.childNodes);

View File

@ -206,7 +206,7 @@ var Enumerable = {
inspect: function() {
return '#<Enumerable:' + this.toArray().inspect() + '>';
}
}
};
Object.extend(Enumerable, {
map: Enumerable.collect,

View File

@ -108,7 +108,7 @@ Form.Methods = {
return new Ajax.Request(action, options);
}
}
};
/*--------------------------------------------------------------------------*/
@ -122,7 +122,7 @@ Form.Element = {
$(element).select();
return element;
}
}
};
Form.Element.Methods = {
serialize: function(element) {
@ -183,7 +183,7 @@ Form.Element.Methods = {
element.disabled = false;
return element;
}
}
};
/*--------------------------------------------------------------------------*/
@ -253,11 +253,11 @@ Form.Element.Serializers = {
// extend element because hasAttribute may not be native
return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
}
}
};
/*--------------------------------------------------------------------------*/
Abstract.TimedObserver = function() {}
Abstract.TimedObserver = function() {};
Abstract.TimedObserver.prototype = {
initialize: function(element, frequency, callback) {
this.frequency = frequency;
@ -281,7 +281,7 @@ Abstract.TimedObserver.prototype = {
this.lastValue = value;
}
}
}
};
Form.Element.Observer = Class.create();
Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
@ -299,7 +299,7 @@ Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
/*--------------------------------------------------------------------------*/
Abstract.EventObserver = function() {}
Abstract.EventObserver = function() {};
Abstract.EventObserver.prototype = {
initialize: function(element, callback) {
this.element = $(element);
@ -337,7 +337,7 @@ Abstract.EventObserver.prototype = {
}
}
}
}
};
Form.Element.EventObserver = Class.create();
Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {

View File

@ -38,7 +38,7 @@ Hash.toQueryString.addPair = function(key, value, prefix) {
key = encodeURIComponent(key);
if (value === undefined) this.push(key);
else this.push(key + '=' + (value == null ? '' : encodeURIComponent(value)));
}
};
Object.extend(Hash.prototype, Enumerable);
Object.extend(Hash.prototype, {
@ -84,7 +84,7 @@ Object.extend(Hash.prototype, {
if (result === undefined) result = value;
else {
if (!Object.isArray(result)) result = [result];
result.push(value)
result.push(value);
}
}
delete this[arguments[i]];

View File

@ -23,5 +23,5 @@ Object.extend(Number.prototype, {
});
$w('abs round ceil floor').each(function(method){
Number.prototype[method] = Math[method].methodize()
Number.prototype[method] = Math[method].methodize();
});

View File

@ -26,4 +26,4 @@ Object.extend(ObjectRange.prototype, {
var $R = function(start, end, exclusive) {
return new ObjectRange(start, end, exclusive);
}
};

View File

@ -44,7 +44,7 @@ Selector.prototype = {
compileXPathMatcher: function() {
var e = this.expression, ps = Selector.patterns,
x = Selector.xpath, le, m;
x = Selector.xpath, le, m;
if (Selector._cache[e]) {
this.xpath = Selector._cache[e]; return;
@ -228,7 +228,7 @@ Object.extend(Selector, {
m[3] = (m[5] || m[6]);
return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
},
pseudo: function(m) {
pseudo: function(m) {
if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
},

View File

@ -219,7 +219,7 @@ String.prototype.gsub.prepareReplacement = function(replacement) {
if (typeof replacement == 'function') return replacement;
var template = new Template(replacement);
return function(match) { return template.evaluate(match) };
}
};
String.prototype.parseQuery = String.prototype.toQueryParams;