abujehad139 / js-addin

Automatically exported from code.google.com/p/js-addin
0 stars 0 forks source link

Error in parsing #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.

Open attached file.

Addin not correct parsed this place 

App.util.anim = function (elem, prop, time, callback) {
    if (!elem.style.opacity) { elem.style.opacity = 1 };
    var offset = (prop.opacity - elem.style.opacity) / Math.floor(time / 25);
    var k = Math.floor(time / 25);
    var int = setInterval(function q() {
        if (elem) {
            elem.style.opacity = parseFloat(elem.style.opacity) + offset;
            k--;
            if (k == 0) {
                clearInterval(int);
                callback();
            }
        }
    }, 25)
}

and yet 2 error in picture

1)  wrong line
2) parsing abort after line 2160 (in file over 3500 line)

Original issue reported on code.google.com by hartflam...@gmail.com on 10 Nov 2011 at 2:53

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by hartflam...@gmail.com on 10 Nov 2011 at 2:53

Attachments:

GoogleCodeExporter commented 9 years ago
This is duplicate:
http://code.google.com/p/js-addin/issues/detail?id=21

Your problem is in using reserved word "int".
http://javascript.about.com/od/reference/g/rint.htm
http://www.kourbatov.com/faq/reserved.htm

Also it is not recommended to define functions inside if statement. See more in 
google javascript guidelines about this
http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml?showone=Fu
nction_Declarations_Within_Blocks#Function_Declarations_Within_Blocks

Original comment by mega.boich@gmail.com on 11 Nov 2011 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by mega.boich@gmail.com on 11 Nov 2011 at 9:52