Skip to content

Commit

Permalink
ENYO-1619: fix FormData constructor error on Android Chrome by guardi…
Browse files Browse the repository at this point in the history
…ng code that uses native version with constructor check.

Enyo-DCO-1.1-Signed-Off-By: Ben Combee (ben.combee@palm.com)
  • Loading branch information
Ben Combee committed Dec 13, 2012
1 parent d097d3d commit 8cf01dd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions source/ajax/formdata.js
Expand Up @@ -19,9 +19,17 @@ _enyo.FormData_ is inspired by
*/
(function(w) {
if (w.FormData) {
enyo.FormData = w.FormData;
enyo.Blob = w.Blob;
return;
try {
var t1 = new w.FormData();
var t2 = new w.Blob();
// Android Chrome 18 will throw an error trying to create these
enyo.FormData = w.FormData;
enyo.Blob = w.Blob;
return;
}
catch (e) {
// ignore error and fall through to fake FormData code
}
}
function FormData() {
this.fake = true;
Expand Down

0 comments on commit 8cf01dd

Please sign in to comment.