FLUID-5071: turn on strict mode in all javascript files

Metadata

Source
FLUID-5071
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Justin Obara
Created
2013-06-27T13:06:33.672-0400
Updated
2015-06-15T10:36:01.293-0400
Versions
N/A
Fixed Versions
  1. 1.5
Component
  1. Demos
  2. Framework
  3. Image Reorderer
  4. Inline Edit
  5. Keyboard Accessibility
  6. Layout Reorderer
  7. Pager
  8. Prefs Framework
  9. Progress
  10. Renderer
  11. Reorderer
  12. Sliding Panel
  13. Table of Contents
  14. Testing Infrastructure
  15. Textfield Slider
  16. Tooltip
  17. UIEnhancer
  18. UI Options
  19. Undo
  20. Uploader

Description

we should make use of strict mode for all of the infusion javascript code.

For details on what strict mode is see MDN;
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode

For any code that will concatenated into the single MyInfusion.js file we must ensure that the strict mode is within our closure scope, so as not to force strict mode onto any of our 3rd party dependencies.

e.g.

(function ($, fluid) {
use strict;

// infusion code

})(jQuery, fluid_version);

Comments

  • Justin Obara commented 2015-06-15T10:36:01.291-0400

    This was addressed in FLUID-5284 when switching to use jsHint.