Loading ...
Sorry, an error occurred while loading the content.

Hallo, I have a really really little bug to report. Using Rhino I have to explic

Expand Messages
  • Christian
    Hallo, I have a really really little bug to report. Using Rhino I have to explicitly write that I want to use the . in regular expressions (instead of leaving
    Message 1 of 2 , Sep 22, 2009
    • 0 Attachment
      Hallo, I have a really really little bug to report.
      Using Rhino I have to explicitly write that I want to use the . in regular expressions (instead of leaving the option away):

      /*jslint regexp: false */
      /.*/.test("it's a dot");

      Otherwise I get this:

      Lint at line 1 character 2: Insecure '.'.
      /.*/.test("it's a dot");


      That does not happen using the input mask on the website; and I think that's the way it should be, because the option is called "Disallow insecure . and [^...] in /RegExp/"

      Christian
    • Douglas Crockford
      ... rhino.js contains if (!JSLINT(input, {bitwise: true, eqeqeq: true, immed: true, newcap: true, nomen: true, onevar: true, plusplus: true, regexp: true,
      Message 2 of 2 , Sep 22, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Christian" <christian.wirkus@...> wrote:
        >
        > Hallo, I have a really really little bug to report.
        > Using Rhino I have to explicitly write that I want to use the .
        > in regular expressions (instead of leaving the option away):
        >
        > /*jslint regexp: false */
        > /.*/.test("it's a dot");
        >
        > Otherwise I get this:
        >
        > Lint at line 1 character 2: Insecure '.'.
        > /.*/.test("it's a dot");

        rhino.js contains

        if (!JSLINT(input, {bitwise: true, eqeqeq: true, immed: true,
        newcap: true, nomen: true, onevar: true, plusplus: true,
        regexp: true, rhino: true, undef: true, white: true})) {

        which sets the options. You are free to set it any way you like,
        or to override it with the /*jslint*/ comment.
      Your message has been successfully submitted and would be delivered to recipients shortly.