Bug Tracker

Opened 15 years ago

Closed 14 years ago

Last modified 11 years ago

#3277 closed bug (wontfix)

'eval' in IE will not return function values, therefore json data == "function() {}" doesn't work.

Reported by: harningt Owned by:
Priority: major Milestone: 1.3
Component: ajax Version: 1.2.6
Keywords: Cc: harningt, flesler
Blocked by: Blocking:


Related to #1298 and [2092] - the fix breaks evaluation of functions in "json" data...

Ex: eval("(function() {})") returns undefined in IE

Technically this isn't really JSON data, but isn't even dealt w/ by any other dataType except by taking it in as text and eval-ing it with the old method.... so long as you don't "pack" it... (though I suppose doing the following works ... but is ugly....

eval("data = function() {}"); data = eval("data")

Change History (3)

comment:1 Changed 15 years ago by flesler

Cc: harningt flesler added
need: ReviewTest Case

That does that happen for functions inside json objects ? or only for "just-one-function" responses ?

comment:2 Changed 15 years ago by arrix

data = eval("false || (" + data + ")");

works with "function() {...}" as well as any other expression.

comment:3 Changed 14 years ago by john

Resolution: wontfix
Status: newclosed

Yeah, I don't think we can guarantee arbitrary expressions as JSON when, in fact, they aren't JSON.

Note: See TracTickets for help on using tickets.