Permalink
Browse files

ix IE7 errors

  • Loading branch information...
1 parent 2831d3f commit bf621ad5229e8c17251e0198dfc1eccfaf4d935d @unscriptable unscriptable committed Aug 9, 2012
Showing with 7 additions and 6 deletions.
  1. +5 −4 object.js
  2. +1 −1 test/json.html
  3. +1 −1 test/object.html
View
9 object.js
@@ -212,15 +212,16 @@ define(['./lib/_base'], function (base) {
if (!has('object-isextensible')) {
Object.isExtensible = shims.isExtensible = function isExtensible (object) {
var prop = '_poly_';
- // create unique property name
- while (prop in object) prop += '_';
- // try to set it
try {
+ // create unique property name
+ while (prop in object) prop += '_';
+ // try to set it
object[prop] = 1;
return hasProp(object, prop);
}
+ catch (ex) { return false; }
finally {
- delete object[prop];
+ try { delete object[prop]; } catch (ex) { /* squelch */ }
}
};
}
View
2 test/json.html
@@ -36,7 +36,7 @@
}).next(['curl/_privileged'], function (priv) {
// remove JSON and poly/json
- delete window.JSON;
+ try { delete window.JSON; } catch (ex) {}
// we have to force-load the json2 inner module here due to curl caching issues
}).next(['test/testutils', 'poly/support/json2'], function (tester) {
View
2 test/object.html
@@ -150,7 +150,7 @@
canSetProp = false;
}
tester.assertEquals('Object.isExtensible should return false on non-expando objects (IE only)', function () {
- return Object.isExtensible(document.documentElement);
+ return Object.isExtensible(document);
}, canSetProp);
}());
}

0 comments on commit bf621ad

Please sign in to comment.