
from compressor.filters import FilterBase


class JSUseStrictFilter(FilterBase):

    def output(self, **kwargs):
        return self.remove_use_strict(self.content)

    def remove_use_strict(js):
        js = js.replace("'use strict';", '')
        js = js.replace('"use strict";', '')
        return js


from compressor.filters import FilterBase


class JSUseStrictFilter(FilterBase):

    def output(self, **kwargs):
        return self.remove_use_strict(self.content)

    def remove_use_strict(self, js):
        # Replacing by a ';' is safer than replacing by ''
        js = js.replace("'use strict';", ';')
        js = js.replace('"use strict";', ';')
        return js

Fix a bug while replacing "use strict" JS pragmas
Fix a bug while replacing "use strict" JS pragmas

  
  from compressor.filters import FilterBase
  
  
  class JSUseStrictFilter(FilterBase):
  
      def output(self, **kwargs):
          return self.remove_use_strict(self.content)
  
-     def remove_use_strict(js):
+     def remove_use_strict(self, js):
+         # Replacing by a ';' is safer than replacing by ''
-         js = js.replace("'use strict';", '')
+         js = js.replace("'use strict';", ';')
-         js = js.replace('"use strict";', '')
+         js = js.replace('"use strict";', ';')
          return js
  
Fix a bug while replacing "use strict" JS pragmas
## Code Before:

from compressor.filters import FilterBase


class JSUseStrictFilter(FilterBase):

    def output(self, **kwargs):
        return self.remove_use_strict(self.content)

    def remove_use_strict(js):
        js = js.replace("'use strict';", '')
        js = js.replace('"use strict";', '')
        return js

## Instruction:
Fix a bug while replacing "use strict" JS pragmas
## Code After:

from compressor.filters import FilterBase


class JSUseStrictFilter(FilterBase):

    def output(self, **kwargs):
        return self.remove_use_strict(self.content)

    def remove_use_strict(self, js):
        # Replacing by a ';' is safer than replacing by ''
        js = js.replace("'use strict';", ';')
        js = js.replace('"use strict";', ';')
        return js
