... I think the error may be that you are using the wrong method: reduce when you should forEach. I am not sure how to test for that....
3082
rodobrist
Nov 26, 2012 11:34 pm
... No, I know when to use each method. Ill try to give another example, the JSLint source uses a method named array_to_object, which can be re-written like...
3083
douglascrockford
douglascrock...
Nov 26, 2012 11:38 pm
... function array_to_object(array) { var result = {}; array.forEach(function (key) { result[key] = true; }); return result; }...
3084
rodobrist
Nov 27, 2012 12:28 am
... Ok, thanks Doug. I suppose that construct is less prone to errors....
3085
sandyhead25
Dec 27, 2012 7:21 pm
There appears to be a new rule that looks for unnecessary parenthesis, but this rule gets confused when wrapping regex: var mhtml = true, disqualify = (mhtml)...
3086
douglascrockford
douglascrock...
Dec 27, 2012 7:32 pm
... I completely agree. It is wise to wrap regexp literals in parens to avoid syntactic weirdness. But that is not what JSLint is complaining about. Try this: ...
3087
sandyhead25
Dec 28, 2012 4:01 am
Thank you! Austin...
3088
Matthew Potter
askmatthewpo...
Jan 2, 2013 12:04 am
I’ve run into an error that is a bit strange to see. The <summary> tag is not allowed as it is unrecognized however the <details> tag is allowed. I’ve...
3089
douglascrockford
douglascrock...
Jan 2, 2013 1:53 pm
... Thanks. Please try it now....
3090
george_weilenmann
george_weile...
Jan 10, 2013 5:48 am
Unexpected '*'. Rationale for acceptance: The * selector in CSS, also known as the universal selector, is useful for setting styling to the full array of...
3091
george_weilenmann
george_weile...
Jan 12, 2013 6:06 am
Would also like to see CSS 3.0 style attributes added as modern browsers now support them. And those that don't can have graceful fallback....
3092
douglascrockford
douglascrock...
Jan 14, 2013 9:55 pm
... Can you be more specific?...
3093
george_weilenmann
george_weile...
Jan 15, 2013 6:59 am
Directives Missing @media @keyframes FF 16+, IE 10, Opera 12.10; Chrome, Android, Safari 4, Opera 12, with prefix, @import [url] list-of-media-queries the...
3094
Luke Page
page.luke...
Jan 18, 2013 9:28 am
Hi, My colleague was linting this and getting an error var a = /<.+>[^]<.+>/; Unescaped '^'. He argued that [^] was a valid succinct way of saying "any...
3095
Tom Worster
thefsb
Jan 18, 2013 2:22 pm
... ah yes, very clever. most impressive. and *therefore* it is, i think, the kind of thing jslint should grumble about. regexes are hard enough to understand...
3096
Luke Page
page.luke...
Jan 18, 2013 3:02 pm
I think it looks like an error if you haven't come across it before, but once you have, it is probably quite understandable. You could argue that it could be a...
3097
Peter Buckner
peterrbuckner
Jan 18, 2013 3:42 pm
such cleverness isn't valid in other regex languages, so it would seem to an unfortunate pattern to learn. -- -Peter Buckner ... [Non-text portions of this...
3098
Ben White
benxwhite
Jan 18, 2013 6:35 pm
If you read the documentation on mozilla.org you will find [^] as their suggested "any character" expression Ben ... [Non-text portions of this message have...
3099
george_weilenmann
george_weile...
Jan 18, 2013 11:37 pm
Can you point me to the specific link, page, paragraph etc. where this is spec'd, I looked on mozilla and could not find this "suggestion". I wanted to take a...
3100
Keradus
keradmaster
Jan 19, 2013 1:07 am
2013/1/19 george_weilenmann <abyssoft@...> ... https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp "The character set [^]...
3101
george_weilenmann
george_weile...
Jan 19, 2013 1:54 am
Thankyou that did not pop out at me when I looked through that document earlier. I would say avoid that pattern as it is not valid RegExp. I think the way they...
3102
george_weilenmann
george_weile...
Jan 19, 2013 2:02 am
Did a little digging [^] compiles to not null/empty it is a side effect resulting from the spec for RegExp as performed in JavaScript but does not apply to...
3103
Felix E. Klee
feklee
Jan 19, 2013 12:47 pm
On Sat, Jan 19, 2013 at 3:01 AM, george_weilenmann <abyssoft@...> ... So, which regular expression syntax should JSLint enforce? POSIX? Is that even...
3104
douglascrockford
douglascrock...
Jan 19, 2013 1:20 pm
... One of the design principles behind JSLint is that if a feature is problematic, and if it can be completely replaced with another feature that is less...
3105
John Hawkinson
john.hawkinson
Jan 19, 2013 1:48 pm
douglascrockford <douglas@...> wrote on Sat, 19 Jan 2013 ... It would really help if the documentation explained why [^] was excluded. ...
3106
george_weilenmann
george_weile...
Jan 19, 2013 10:27 pm
from http://www.regular-expressions.info/javascript.html JavaScript implements Perl-style regular expressions. However, it lacks quite a number of advanced...
3108
firstbakingbook
Jan 29, 2013 6:08 pm
I need to support user-supplied math functions. Are there any good alternatives to using eval, or, more likely, the Function constructor? I could write js code...
3109
andrew_wh
Jan 29, 2013 6:22 pm
I understand why the following code generates the warning "Unexpected 'typeof39;. Use '===' to compare directly with undefined" var foo; if (typeof foo ===...
3110
douglascrockford
douglascrock...
Jan 29, 2013 6:35 pm
... Thanks. Please try it now....
3111
andrew_wh
Jan 29, 2013 8:28 pm
Looks like it's been fixed. Thanks for the quick turnaround!...