Skip to main content

Bug Tracker

Side navigation

#12202 closed bug (duplicate)

Opened August 06, 2012 09:08AM UTC

Closed August 06, 2012 07:28PM UTC

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

1. Parse error. syntax error at input line 5795 : 16

1. Parse error. syntax error at input line 5796 : 9

1. Parse error. missing name after . operator at input line 7917 : 27

1. Parse error. syntax error at input line 7918 : 17

1. Parse error. missing ) in parenthetical at input line 7936 : 4

1. 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.

Attachments (0)
Change History (2)

Changed August 06, 2012 09:14AM UTC by znerd comment:1

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 {

Changed August 06, 2012 07:28PM UTC by timmywil comment:2

resolution: → duplicate
status: newclosed

Duplicate of #12158.