Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12202 closed bug (duplicate)

jQuery 1.8rc1 is considered invalid

Reported by: znerd Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8rc1
Keywords: Cc:
Blocked by: Blocking:

Description

While validating the jQuery 1.8rc1 .js file, I got some errors:

  1. Parse error. invalid property id at input line 5795 : 15
  2. Parse error. syntax error at input line 5795 : 16
  3. Parse error. syntax error at input line 5796 : 9
  4. Parse error. missing name after . operator at input line 7917 : 27
  5. Parse error. syntax error at input line 7918 : 17
  6. Parse error. missing ) in parenthetical at input line 7936 : 4
  7. Parse error. syntax error at input line 9222 : 1

Looking at the source it's clear that line 5795 is indeed causing a problem: 'throws' is used as an identifier, while it is also a JavaScript keyword. Something similar applies to line 7917/7918, where 's.throws' is used as a condition.

Line 9222 is the last line of the file.

Change History (2)

comment:1 Changed 7 years ago by znerd

BTW, note that this is a regression since jQuery 1.7.2.

However, the issue is easy to fix; here is a diff file that fixes the problem by renaming 'throws' to 'throwz':

diff --git a/src/main/js/jquery.js b/src/main/js/jquery.js
index ac25463..169b7f9 100644
--- a/src/main/js/jquery.js
+++ b/src/main/js/jquery.js
@@ -5792,7 +5792,7 @@ jQuery.fn.extend({
                                                                dataType: "script",
                                                                async: false,
                                                                global: false,
-                                                               throws: true
+                                                               throwz: true
                                                        });
                                                } else {
                                                        jQuery.error("no ajax");
@@ -7333,7 +7333,7 @@ jQuery.extend({
                username: null,
                password: null,
                cache: null,
-               throws: false,
+               throwz: false,
                traditional: false,
                headers: {},
                */
@@ -7914,7 +7914,7 @@ function ajaxConvert( s, response ) {
                                if ( conv !== true ) {
 
                                        // Unless errors are allowed to bubble, catch and return them
-                                       if ( conv && s.throws ) {
+                                       if ( conv && s.throwz ) {
                                                response = conv( response );
                                        } else {
                                                try {

comment:2 Changed 7 years ago by timmywil

Resolution: duplicate
Status: newclosed

Duplicate of #12158.

Note: See TracTickets for help on using tickets.