Skip to content

Commit ece128d

Browse files
committed
netteForms.js: removed support for IE =< 7
1 parent 3790302 commit ece128d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/assets/netteForms.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
*/
77

88
(function(global, factory) {
9+
if (!global.JSON) {
10+
return;
11+
}
12+
913
if (typeof define === 'function' && define.amd) {
1014
define(function() {
1115
return factory(global);
@@ -490,11 +494,9 @@ Nette.toggleControl = function(elem, rules, success, firsttime, value) {
490494

491495

492496
Nette.parseJSON = function(s) {
493-
s = s || '[]';
494-
if (s.substr(0, 3) === '{op') {
495-
return eval('[' + s + ']'); // backward compatibility
496-
}
497-
return window.JSON && window.JSON.parse ? JSON.parse(s) : eval(s);
497+
return (s || '').substr(0, 3) === '{op'
498+
? eval('[' + s + ']') // backward compatibility with Nette 2.0.x
499+
: JSON.parse(s || '[]');
498500
};
499501

500502

0 commit comments

Comments
 (0)