Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !15558

Use strict mode in jQuery version check module. Closes #15535

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/peterblazejewicz/fix/strict-mode-config-bridge into master Jan 13, 2015
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: peterblazejewicz

This PR adds strict mode declaration missing in jQuery version check module which is inserted at runtime via Grunt tasks to distribution source code. Missing use strict missed JSHint code checks as it is part of content not covered by JSHint tests.

After build the non-minified distribution file will look like:

diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js
index 42e92bf..ab0ae1e 100644
--- a/dist/js/bootstrap.js
+++ b/dist/js/bootstrap.js
@@ -9,6 +9,7 @@ if (typeof jQuery === 'undefined') {
 }

 +function ($) {
+  'use strict';
   var version = $.fn.jquery.split(' ')[0].split('.')
   if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
     throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')

and version check module will look like:

+function ($) {
  'use strict';
  var version = $.fn.jquery.split(' ')[0].split('.')
  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
  }
}(jQuery);

Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/peterblazejewicz/fix/strict-mode-config-bridge