Add empty array, object to set-constant scriptlet · gorhill/uBlock@ce801b9 (original) (raw)

Original file line number Diff line number Diff line change
@@ -831,6 +831,12 @@
831 831 cValue = true;
832 832 } else if ( cValue === 'null' ) {
833 833 cValue = null;
834 +} else if ( cValue === "''" ) {
835 +cValue = '';
836 +} else if ( cValue === '[]' ) {
837 +cValue = [];
838 +} else if ( cValue === '{}' ) {
839 +cValue = {};
834 840 } else if ( cValue === 'noopFunc' ) {
835 841 cValue = function(){};
836 842 } else if ( cValue === 'trueFunc' ) {
@@ -841,8 +847,6 @@
841 847 cValue = parseFloat(cValue);
842 848 if ( isNaN(cValue) ) { return; }
843 849 if ( Math.abs(cValue) > 0x7FFF ) { return; }
844 -} else if ( cValue === "''" ) {
845 -cValue = '';
846 850 } else {
847 851 return;
848 852 }