Skip to content

Commit

Permalink
Throw an error when framework loads twice
Browse files Browse the repository at this point in the history
Fixes #2379
  • Loading branch information
daftspunk committed Feb 4, 2017
1 parent 66f56a3 commit 97c659d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assets/js/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
* OctoberCMS: front-end JavaScript framework
* http://octobercms.com
* ========================================================================
* Copyright 2016 Alexey Bobkov, Samuel Georges
* Copyright 2017 Alexey Bobkov, Samuel Georges
* ======================================================================== */

if (window.jQuery === undefined)
if (window.jQuery === undefined) {
throw new Error('The jQuery library is not loaded. The OctoberCMS framework cannot be initialized.');
}
if (window.jQuery.request !== undefined) {
throw new Error('The OctoberCMS framework is already loaded.');
}

+function ($) { "use strict";

Expand All @@ -17,7 +21,7 @@ if (window.jQuery === undefined)
/*
* Validate handler name
*/
if (handler == undefined) {
if (handler === undefined) {
throw new Error('The request handler name is not specified.')
}

Expand Down

0 comments on commit 97c659d

Please sign in to comment.