Commit 16494021 authored by Boris Kocherov's avatar Boris Kocherov

tv4: disable alerts in jslint/jshint

parent 704e691d
...@@ -6,7 +6,11 @@ This code is released into the "public domain" by its author(s). Anybody may us ...@@ -6,7 +6,11 @@ This code is released into the "public domain" by its author(s). Anybody may us
If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory. If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.
*/ */
/*global module, define*/
/*jslint indent: 2, white: true*/
/*jshint -W014: true, -W089: true, -W084: true, -W069: true*/
(function (global, factory) { (function (global, factory) {
"use strict";
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define([], factory); define([], factory);
...@@ -18,6 +22,7 @@ If you find a bug or make an improvement, it would be courteous to let the autho ...@@ -18,6 +22,7 @@ If you find a bug or make an improvement, it would be courteous to let the autho
global.tv4 = factory(); global.tv4 = factory();
} }
}(this, function () { }(this, function () {
"use strict";
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys
if (!Object.keys) { if (!Object.keys) {
...@@ -82,6 +87,7 @@ if(!Array.isArray) { ...@@ -82,6 +87,7 @@ if(!Array.isArray) {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf
if (!Array.prototype.indexOf) { if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
/*jslint bitwise: true */
if (this === null) { if (this === null) {
throw new TypeError(); throw new TypeError();
} }
...@@ -262,7 +268,7 @@ function uriTemplateSubstitution(spec) { ...@@ -262,7 +268,7 @@ function uriTemplateSubstitution(spec) {
result += "="; result += "=";
} }
} }
if (varSpec.truncate != null) { if (varSpec.truncate !== null) {
value = value.substring(0, varSpec.truncate); value = value.substring(0, varSpec.truncate);
} }
result += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value); result += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value);
...@@ -1515,6 +1521,7 @@ function ValidationError(code, params, dataPath, schemaPath, subErrors) { ...@@ -1515,6 +1521,7 @@ function ValidationError(code, params, dataPath, schemaPath, subErrors) {
var err = new Error(this.message); var err = new Error(this.message);
this.stack = err.stack || err.stacktrace; this.stack = err.stack || err.stacktrace;
if (!this.stack) { if (!this.stack) {
/*jshint -W002: true*/
try { try {
throw err; throw err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment