Side navigation
#14459 closed bug (fixed)
Opened October 17, 2013 07:16PM UTC
Closed October 28, 2013 03:40PM UTC
data-* attribute parsing bypasses jQuery.parseJSON (inconsistent with 1.x)
Reported by: | gibson042 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.11/2.1 |
Component: | data | Version: | 2.0.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
2.x data-* attribute parsing directly utilizes JSON.parse, in contrast to both 1.x and the rest of the codebase (i.e., ajax). We should probably switch back to jQuery.parseJSON, but could alternatively switch ajax to JSON.parse. I prefer the former mostly for 1.x consistency.
Attachments (0)
Change History (6)
Changed October 17, 2013 10:17PM UTC by comment:1
component: | unfiled → data |
---|---|
milestone: | None → 1.11/2.1 |
priority: | undecided → low |
status: | new → open |
Changed October 18, 2013 01:29PM UTC by comment:2
+1 for former
Changed October 18, 2013 02:36PM UTC by comment:3
In jQuery 2.x:
(src/ajax/parseJSON.js)
jQuery.parseJSON = JSON.parse;
(src/data.js)
rbrace.test( data ) ? JSON.parse( data ) :
How does it benefit jQuery to go through an alias to the same function?
Changed October 18, 2013 02:46PM UTC by comment:4
Replying to [comment:3 rwaldron]:
How does it benefit jQuery to go through an alias to the same function?
Duckpunching in a spy (which is how I came across the 1.x/2.x discrepancy) or a behavior tweak (e.g., for jQuery migrate and #13169).
Changed October 18, 2013 03:25PM UTC by comment:5
Replying to [comment:4 gibson042]:
Replying to [comment:3 rwaldron]: > How does it benefit jQuery to go through an alias to the same function? Duckpunching in a spy
Seems reasonable enough. +1
I agree this should all go through the same path.