Switched to using new Function instead of eval for handling JSON parsing (Fixes bug #4680). Added support for JSON.parse, if it exists (Fixes bug #4429).
This commit is contained in:
parent
a0451f162e
commit
90a87c03b4
2 changed files with 33 additions and 6 deletions
|
@ -693,6 +693,25 @@ test("jQuery.getJSON(String, Function) - JSON object", function() {
|
|||
});
|
||||
});
|
||||
|
||||
test("jQuery.getJSON - Using Native JSON", function() {
|
||||
expect(2);
|
||||
|
||||
var old = window.JSON;
|
||||
JSON = {
|
||||
parse: function(str){
|
||||
ok( true, "Verifying that parse method was run" );
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
stop();
|
||||
jQuery.getJSON(url("data/json.php"), function(json) {
|
||||
window.JSON = old;
|
||||
equals( json, true, "Verifying return value" );
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() {
|
||||
expect(2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue