Skip to content
Browse files

allowed_option

  • Loading branch information...
1 parent f690208 commit e25b8eaf709b191a045b02fb58810c97d9ab1851 @douglascrockford committed Dec 9, 2011
Showing with 42 additions and 9 deletions.
  1. +42 −9 jslint.js
View
51 jslint.js
@@ -1,5 +1,5 @@
// jslint.js
-// 2011-12-08
+// 2011-12-09
// Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
@@ -425,6 +425,41 @@ var JSLINT = (function () {
adsafe_may, // The widget may load approved scripts.
adsafe_top, // At the top of the widget script.
adsafe_went, // ADSAFE.go has been called.
+ allowed_option = {
+ bitwise : true,
+ browser : true,
+ cap : true,
+ confusion : true,
+ 'continue': true,
+ css : true,
+ debug : true,
+ devel : true,
+ eqeq : true,
+ es5 : true,
+ evil : true,
+ forin : true,
+ fragment : true,
+ indent : 10,
+ maxerr : 1000,
+ maxlen : 256,
+ newcap : true,
+ node : true,
+ nomen : true,
+ on : true,
+ passfail : true,
+ plusplus : true,
+ properties: true,
+ regexp : true,
+ rhino : true,
+ undef : true,
+ unparam : true,
+ sloppy : true,
+ sub : true,
+ vars : true,
+ white : true,
+ widget : true,
+ windows : true
+ },
anonname, // The guessed name for anonymous functions.
approved, // ADsafe approved urls.
@@ -898,11 +933,6 @@ var JSLINT = (function () {
'regexp', 'string'
], true),
itself, // JSLint itself
- jslint_limit = {
- indent: 10,
- maxerr: 1000,
- maxlen: 256
- },
json_mode,
lex, // the tokenizer
lines,
@@ -2366,14 +2396,17 @@ klass: do {
var name, value;
while (next_token.id === '(string)' || next_token.identifier) {
name = next_token.string;
+ if (!allowed_option[name]) {
+ stop('unexpected_a');
+ }
advance();
if (next_token.id !== ':') {
stop('expected_a_b', next_token, ':', artifact());
}
advance(':');
- if (typeof jslint_limit[name] === 'number') {
+ if (typeof allowed_option[name] === 'number') {
value = next_token.number;
- if (value > jslint_limit[name] || value <= 0 ||
+ if (value > allowed_option[name] || value <= 0 ||
Math.floor(value) !== value) {
stop('expected_small_a');
}
@@ -6905,7 +6938,7 @@ klass: do {
};
itself.jslint = itself;
- itself.edition = '2011-12-08';
+ itself.edition = '2011-12-09';
return itself;
}());

0 comments on commit e25b8ea

Please sign in to comment.
Something went wrong with that request. Please try again.