-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegExp after instanceof #2773
Closed
nicolo-ribaudo opened this issue
Nov 19, 2015
· 1 comment
· Fixed by chauncey-garrett/dotfiles#15 · May be fixed by ajesse11x/cjdns#1
Closed
RegExp after instanceof #2773
nicolo-ribaudo opened this issue
Nov 19, 2015
· 1 comment
· Fixed by chauncey-garrett/dotfiles#15 · May be fixed by ajesse11x/cjdns#1
Comments
Sounds good to me! See also gh-2777. |
nicolo-ribaudo
added a commit
to nicolo-ribaudo/jshint
that referenced
this issue
Dec 5, 2015
ehjay
added a commit
to ehjay/jshint
that referenced
this issue
May 18, 2016
This patch adds a new parse error that is used when a literal or function declaration is found on the right-hand side of the `instanceof` infix operator. Specifically, it checks for number, string, object, array and regular expression literals, as well as the null and undefined keywords and function declarations. The following generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: /x/ instanceof /x/.constructor; as per jshintGH-2773 References: Closes jshintGH-2777
ehjay
pushed a commit
to ehjay/jshint
that referenced
this issue
May 24, 2016
This patch adds a new error that is used when a literal is found on the right-hand side of the `instanceof` infix operator. A warning is used when a function declaration is found. Literals generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof ``; Function declarations generate warnings: x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: x instanceof /x/.constructor; x instanceof "".constructor; as per jshintGH-2773 References: Closes jshintGH-2777
ehjay
pushed a commit
to ehjay/jshint
that referenced
this issue
May 29, 2016
This patch adds a new error that is used when a literal is found on the right-hand side of the `instanceof` infix operator. A warning is used when a function declaration is found. Literals generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof ``; Function declarations generate warnings: x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: x instanceof /x/.constructor; x instanceof "".constructor; as per jshintGH-2773 References: Closes jshintGH-2777
ehjay
pushed a commit
to ehjay/jshint
that referenced
this issue
Jun 4, 2016
This patch adds a new error that is used when a literal is found on the right-hand side of the `instanceof` infix operator. A warning is used when a function declaration is found. Literals generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof ``; Function declarations generate warnings: x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: x instanceof /x/.constructor; x instanceof "".constructor; as per jshintGH-2773 References: Closes jshintGH-2777
jugglinmike
pushed a commit
that referenced
this issue
Jun 11, 2016
This patch adds a new error that is used when a literal is found on the right-hand side of the `instanceof` infix operator. A warning is used when a function declaration is found. Literals generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof ``; Function declarations generate warnings: x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: x instanceof /x/.constructor; x instanceof "".constructor; as per GH-2773 References: Closes GH-2777
jugglinmike
pushed a commit
to jugglinmike/jshint
that referenced
this issue
Sep 4, 2016
jugglinmike
pushed a commit
to jugglinmike/jshint
that referenced
this issue
Sep 4, 2016
This patch adds a new error that is used when a literal is found on the right-hand side of the `instanceof` infix operator. A warning is used when a function declaration is found. Literals generate errors: x instanceof 0; x instanceof ''; x instanceof null; x instanceof undefined; x instanceof {}; x instanceof []; x instanceof /./; x instanceof ``; Function declarations generate warnings: x instanceof function() {}; x instanceof function MyUnusableFunction() {}; But this is okay: x instanceof /x/.constructor; x instanceof "".constructor; as per jshintGH-2773 References: Closes jshintGH-2777
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A stupid example:
JSHint doesn't like the
/
afterinstanceof
, even if this is valid js.The text was updated successfully, but these errors were encountered: