Permalink
Browse files

[refactoring] Reduction of Google closure compiler warnings. Remains …

…now 28.
  • Loading branch information...
1 parent f86e58c commit d3a101de753a66d2bc99eda82cecb205b020497c @fpessaux fpessaux committed Jun 22, 2011
View
@@ -886,5 +886,5 @@ function bsldom_do_slide_out(dom, maybe_duration, maybe_easing, maybe_cb)
ev.returnValue = prompt; //For IE, FF
return prompt; //For Safari
}
- $(window).bind('beforeunload', f);
+ (new $(window)).bind('beforeunload', f);
}
View
@@ -74,7 +74,8 @@ function is_float(n){
str = str.substr(1);
while (str.length > 0){
var start_json = str.search(/[^0-9]/);
- var json_length = parseInt(str.substr(0, start_json));
+ // Numbers are parsed as decimal strings.
+ var json_length = parseInt(str.substr(0, start_json), 10);
var json = str.substr(start_json, json_length);
tab.push(JSON.parse(json));
str = str.substr(start_json + json_length);
@@ -239,7 +239,7 @@ this.close_jlog= function () { (new jQuery("#" + jlog_id)).remove() };
var jlog_item;
var jlog_with_colors= function(foreground, background, message)
{
- $(function(){
+ new $(function(){
if (!document.getElementById(jlog_id))
{
var item = "position: absolute; right: 0px; top: 0px; z-index: 100; font-size: .7em; ";
@@ -508,6 +508,7 @@ function opa_event_to_dom_event(event, name)
return result;
}
+/* Looks like it is not used anymore.
function tn_encaps(tn, fun){
var a = (new $(document.createElement('span')));
a.append(tn[0].data);
@@ -516,6 +517,7 @@ function tn_encaps(tn, fun){
a.myrplce(tn);
return ret;
}
+*/
// jQuery Plugins
@@ -36,13 +36,13 @@ var _true
*/
var _false
/**
- * @type {!*}
+ * @type {!Object}
*/
var js_none
/**
* @param {!*} s
- * @return {!*}
+ * @return {!Object}
*/
var js_some
@@ -104,7 +104,7 @@ var field_of_name = function(name) {}
/**
* @param {!string} name
- * @return {!*}
+ * @return {!string}
*/
var static_field_of_name = function(name) {}
@@ -19,7 +19,13 @@
var js_void = {}
var _true = true
var _false = false
+/**
+ * @type {!Object}
+ */
var js_none = {none:js_void}
+/**
+ * @return(!Object)
+ */
function js_some(x) { return {some:x} }
function bool2obj(x) {
// WONT BE IMPLEMENTED or change the name

0 comments on commit d3a101d

Please sign in to comment.