Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Issue #1388 regressed a "globalscript" behavior #1451

julienw opened this Issue · 4 comments

2 participants


Issue #1388 regressed the following code using globalscript: true:

(function() {
  'use strict';

  var a = 'toto';
  a = a + 'plop';

I think "globalstrict" is not supposed to force using it in global, but only to allow it.


I made #1452 which contains:

  • an indentation fix, which prevents npm test from running
  • a failing test
  • revert of the fix to issue 1388

I don't exactly know how to fix issue 1388 though... @antonkovalyov if you have an idea I can try to do it.

I thought of calling block for the global scope too, with an additional boolean argument isGlobal. Do you think it's a good idea? Also we could convert block into using an option object instead of 5 or 6 boolean parameters.


Added some code to make the existing test pass, but as my modified test shows, it's not enough ;)

Trying to find the correct place to put this code... ideally, it would be in statements with a way to not test this if the current statement is a function. (not sure this sentence is easy to read ;) )


Just pushed a new version of the pull request #1452 that fixes both the regression and issue #1388. I don't find it very clean so I'm very open to any change you think would be necessary.

@valueof valueof referenced this issue from a commit
@julienw julienw Issue #1451: Fix a regression caused by #1388
Signed-off-by: Anton Kovalyov <>


@valueof valueof closed this
@jugglinmike jugglinmike referenced this issue from a commit in jugglinmike/jshint
@julienw julienw Issue #1451: Fix a regression caused by #1388
Signed-off-by: Anton Kovalyov <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.