jshint complaining about not defined?-Collection of common programming errors
Why does jshint warn that gConfiguration is not defined? I have it defined before the start of the func. I also tried placing it inside. I know I can declare it as a global variable in the configuration but I don’t see what this is wrong? requirejs uses a similar pattern at the top of its declaration.
/*jshint strict:true, undef:true */
/*global Backbone: true, $: true */
var gConfiguraton;
(function (global) {
'use strict';
var MYAPP = global.MYAPP = {};
MYAPP.version = '0.0.1';
// Defaults
MYAPP.settings = {
// Authorization
authorizationKey: null,
authorizationTokenType: 'Bearer',
authorizationTimestamp: null,
// Proxy
proxyUrl: null
};
// Depend on jQuery and Backbone
if (typeof $ !== 'undefined' && typeof Backbone !== 'undefined') {
// Look for global configuration provided by user and merge their settings
if (typeof gConfiguration !== 'undefined') {
$.extend(MYAPP.settings, gConfiguration);
}
MYAPP.Events = $.extend({}, Backbone.Events);
}
} (this));
Originally posted 2013-11-09 21:40:10.