@@ -299,24 +299,30 @@ ok = JSLINT script, {
299
299
plugin : false
300
300
}
301
301
302
+ out = {errors : [],warnings : []}
302
303
unless ok
303
304
result = JSLINT .data ()
304
305
if VERBOSE
305
306
console .error util .inspect result, false , 3 , true
306
- else
307
- out = {errors : []}
308
- for error in result .errors
309
- if error?
310
- out .errors .push
311
- raw : error .raw
312
- reason : error .reason
313
- line : error .line
314
- character : error .character
315
- evidence : error .evidence
316
- console .error JSON .stringify out
317
- process .exit 1
318
- else
319
- script = script .substr (head .length , script .length - (head .length + foot .length ))
320
- script = " new ADSAFE_APP(#{ id} , \" #{ adsafeId} \" , #{ JSON .stringify (details)} , function(ADSAFE){\n #{ script} \n });"
321
- fs .writeFileSync outputFilename, script
322
- process .exit 0
307
+ for error in result .errors
308
+ if error?
309
+ entry =
310
+ raw : error .raw
311
+ reason : error .reason
312
+ line : error .line
313
+ character : error .character
314
+ evidence : error .evidence
315
+ if entry .reason is " Confusing use of '!'."
316
+ out .warnings .push entry
317
+ else
318
+ out .errors .push entry
319
+ else
320
+ out .errors .push null
321
+ console .error JSON .stringify out
322
+ if out .errors .length > 0
323
+ process .exit 1
324
+
325
+ script = script .substr (head .length , script .length - (head .length + foot .length ))
326
+ script = " new ADSAFE_APP(#{ id} , \" #{ adsafeId} \" , #{ JSON .stringify (details)} , function(ADSAFE){\n #{ script} \n });"
327
+ fs .writeFileSync outputFilename, script
328
+ process .exit 0
0 commit comments