Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [2.1] Bug when loading ext-all.js or ext-all-debug.js

  1. #1
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default [2.1] Bug when loading ext-all.js or ext-all-debug.js

    In ie7 I get an error loading the ext-all library. With the ext-all-debug.js library the message is
    Line: 6680
    Char: 9
    Error: Syntax error

    I get the same error when using FF with firebug. But the error appears to be upstream a bit from the line number. I started matching braces and when I get to line 6593 the braces don't match up anymore. The code at this line is

    if (/["\\\x00-\x1f]/.test(s)) {

    and is the first line of Ext.util.JSON.encodeString() function.

    I tried to back down to ext2.0.2 and the bug was present there also.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    This is almost definitely not a bug. It's probable that you have a corrupted version of the scripts, or your web server is not serving them up correctly.

  3. #3
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default

    I downloaded the file from your site again ext2.1. Did a diff on the files and no difference. I get the same errors on the same lines with a new install. The ext files are being loaded as the very first javascript files as


    <!-- EXT -->
    <link rel='stylesheet' type='text/css' href='js/ext/resources/css/ext-all.css' />
    <script type='text/javascript' src='js/ext/adapter/ext/ext-base.js'></script>
    <script type='text/javascript' src='js/ext/ext-all.js' ></script>

    I have unpacked them on both my PC, and the linux system that is the websever. I see the file as described above on both systems with 2 different downloads from your site.

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Look at the response in firebug. Check the size of the downloaded files.

  5. #5
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default

    Error I get in firebug with debug version is

    invalid flag after regular expression
    http://site.guildcircle.com/js/ext/ext-all-debug.js
    Line 6680

    These are the sizes on the linux server
    -rw-r--r-- 1 root root 942534 Apr 21 04:04 ext-all-debug.js
    -rw-r--r-- 1 root root 523229 Apr 21 04:05 ext-all.js
    -rw-r--r-- 1 root root 160730 Apr 21 04:04 ext-core-debug.js
    -rw-r--r-- 1 root root 86260 Apr 21 04:04 ext-core.js

    firebug says ext-all-debug is 928kb

    You can look directly at the site with http://site.guildcircle.com

  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    I went to your demo site and everything loads correctly.

    Try clearing your cache?

  7. #7
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default

    I cleared my cache and I when I reload I still get the error. It doesn't stop the page from loading, but you see it when firebug is enabled. In safari it doesn't report the error. In ie7 I run with the IE web developer toolbar and it reports the error. My friend on the other side of the US gets its also. So I know it isn't anything particular about my machines/browsers or ISP. But I really don't understand how you got a clean version of the file. The error doesn't stop the site from working but I do get the parse error none the less.

    Maybe there is something really stupid I'm doing. But I can load a fresh download of ext2.1 from the extjs site. I go to the line number 6680 that I'm getting the error on. It is at the closing of the Ext.util.JSON class. spket doesn't show a parse error there, but if you look at the closing brace of the class it doesn't match with the head of the class. Then match the braces on each function they get off kilter on line 6593 on the encodeString function.

    This is the code there
    Code:
        var encodeString = function(s){
            if (/["\\\x00-\x1f]/.test(s)) {
                return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                    var c = m[b];
                    if(c){
                        return c;
                    }
                    c = b.charCodeAt();
                    return "\\u00" +
                        Math.floor(c / 16).toString(16) +
                        (c % 16).toString(16);
                }) + '"';
            }
            return '"' + s + '"';
        };
    Last edited by deanna; 25 Apr 2008 at 7:40 AM. Reason: Attempt to use English before morning coffee, fixed.

  8. #8
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default

    I just loaded the file into vi and its syntax coloring also doesn't like that line. Are you sure that this regular expression is right?

    if (/["\\\x00-\x1f]/.test(s))

  9. #9
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306

    Default

    More info.

    I did some working with it. And although that RE doesn't parse right in spket or vi, it doesn't cause the but I am seeing. The bug is actually not a parse error of the javascript, but runtime when it parses a php warning that comes back instead of the expected JSON. I don't mean it returns an error but is a javascript error on the php generated warning. The warning I can fix - but I wouldn't think bad data would cause the function to crash, just return an error.

    This is the warning that crashed the JSON.decode
    Code:
    <br />
    
    <b>Warning</b>:  main(./classes/user/User.php) [<a href='function.main'>function.main</a>]: failed to
    
     open stream: No such file or directory in <b>/usr/www/GuildDesktop/classes/Site.php</b> on line <b>26
    
    </b><br />
    
    <br />
    
    <b>Fatal error</b>:  main() [<a href='function.require'>function.require</a>]: Failed opening required
    
     './classes/user/User.php' (include_path='.:/usr/share/pear') in <b>/usr/www/GuildDesktop/classes/Site
    
    .php</b> on line <b>26</b><br />

  10. #10

    Default

    The regular expression is right, Spket has two part, one is for syntax highlighting, which is design for speed, and other is for syntax error report, code assist, which is using javascript parser. The brace not match is the bug of syntax highlighting...
    Spket IDE - Development Tool for RIA

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •