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

Re: /*jslint is seen as a reserved word

Expand Messages
  • Zhami
    Woomla: You could also move the pragma further in (rather than out) In my code, I disable such pragma immediately after the line of code I need it suspended
    Message 1 of 8 , Mar 5, 2011
    View Source
    • 0 Attachment
      Woomla: You could also move the pragma further in (rather than out)

      In my code, I disable such pragma immediately after the line of code I need it suspended for.

      Douglas: In the following, JSLint reports the second appearance of the pragma as being unreachable, which is true were it executable (curiously though, the effect of that pragma is put into effect).

      (function () {
      "use strict";

      String.implement({
      getByteAt: function (index) {
      /*jslint bitwise: false*/
      return this.charCodeAt(index) & 0xFF;
      /*jslint bitwise: true*/
      }
      });
      }());


      --- In jslint_com@yahoogroups.com, "Woomla" <woomla@...> wrote:
      >
      > Hi,
      >
      > This code gives a message: Problem at line 5 character 9: Expected an identifier and instead saw '/*jslint' (a reserved word). That's correct and it's my intention to allow bitwise operator &.
      >
      >
      > (function () {
      > "use strict";
      >
      > String.implement({
      > /*jslint bitwise: false*/
      > getByteAt: function (index) {
      > return this.charCodeAt(index) & 0xFF;
      > }
      > });
      > }());
      >
      > If I move the /*jslint before String.implement, it is ok. But I guess it should be fine on the line in this example as well, shouldn't it?
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.