Skip to content
GitLab
    • Explore Projects Groups Snippets
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
An error occurred while fetching the assigned milestone of the selected merge_request.

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 10 years ago
  • 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!

Compare
  • master (base)

and
  • latest version
    6122a57d
    1 commit, 2 years ago

1 file
+ 1
- 0

    Preferences

    File browser
    Compare changes
grunt/configBridge.json
+ 1
- 0
  • View file @ 6122a57d


@@ -34,6 +34,7 @@
],
"jqueryVersionCheck": [
"+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')",
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference:
Source branch: github/fork/peterblazejewicz/fix/strict-mode-config-bridge

Menu

Explore Projects Groups Snippets