Repository: jshint/jshint
Pull request #2189 (2015-02-23 17:06:21)

[[DOCS]] Update link to CLA
The project now uses the CLAHub service to assist in the process of
verifying contributor agreements.

Here's the status report as displayed by GitHub on an unrelated pull request. In the second half of the image, you can see that CLAHub automatically re-checked the pull request after I signed the agreement:

![jshint-cla](https://cloud.githubusercontent.com/assets/677252/6332512/fdaead7e-bb53-11e4-8dc2-ca7533c3a12b.png)



Patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b48203e2..0db9003c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,7 +7,7 @@ to a snippet, graffiti outside of Anton's apartment, etc.
 However, before sending a patch, please make sure that the following applies:
 
 * Your commit message follows the [Commit Message Guidelines](#commit-message-guidelines).
-* You have signed the [Contributor's License Agreement](https://docs.google.com/forms/d/1BkEC9ds73aQLF73_kTX-9nhKCBJ8U5aFFUb-_Trt8Bc/viewform).
+* You have signed the [Contributor's License Agreement](https://www.clahub.com/agreements/jshint/jshint).
 * Your patch doesn't have useless merge commits.
 * Your coding style is similar to ours (see below).
 * Your patch is 100% tested. We don't accept any test regressions.
diff --git a/src/jshint.js b/src/jshint.js
index 8b09cc88..43d29d42 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -197,12 +197,8 @@ var JSHINT = (function() {
 
     processenforceall();
 
-    if (!state.option.es3) {
-      combine(predefined, vars.ecmaIdentifiers[5]);
-    }
-
     if (state.option.esnext) {
-      combine(predefined, vars.ecmaIdentifiers[6]);
+      combine(predefined, vars.newEcmaIdentifiers);
     }
 
     if (state.option.couch) {
@@ -3368,15 +3364,8 @@ var JSHINT = (function() {
           if (state.option.inESNext() && funct[t.id] === "const") {
             warning("E011", null, t.id);
           }
-          if (funct["(global)"]) {
-            if (predefined[t.id] === false) {
-              warning("W079", t.token, t.id);
-            } else if (!state.option.futurehostile) {
-              if ((!state.option.inES5() && vars.ecmaIdentifiers[5][t.id] === false) ||
-                (!state.option.inESNext() && vars.ecmaIdentifiers[6][t.id] === false)) {
-                warning("W129", t.token, t.id);
-              }
-            }
+          if (funct["(global)"] && predefined[t.id] === false) {
+            warning("W079", t.token, t.id);
           }
           if (t.id) {
             addlabel(t.id, { type: "unused", token: t.token });
@@ -4930,7 +4919,7 @@ var JSHINT = (function() {
     }
 
     predefined = Object.create(null);
-    combine(predefined, vars.ecmaIdentifiers[3]);
+    combine(predefined, vars.ecmaIdentifiers);
     combine(predefined, vars.reservedVars);
 
     combine(predefined, g || {});
diff --git a/src/messages.js b/src/messages.js
index f5e65749..5aa1f2c5 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -202,9 +202,7 @@ var warnings = {
   W125: "This line contains non-breaking spaces: http://jshint.com/doc/options/#nonbsp",
   W126: "Unnecessary grouping operator.",
   W127: "Unexpected use of a comma operator.",
-  W128: "Empty array elements require elision=true.",
-  W129: "'{a}' is defined in a future version of JavaScript. Use a " +
-    "different variable name to avoid migration issues."
+  W128: "Empty array elements require elision=true."
 };
 
 var info = {
diff --git a/src/options.js b/src/options.js
index a5175556..3a5cccf2 100644
--- a/src/options.js
+++ b/src/options.js
@@ -352,14 +352,6 @@ exports.bool = {
     */
     evil        : true,
 
-    /**
-     * This option supresses warnings about the use of identifiers which are
-     * defined in future versions of JavaScript. Although overwriting them has
-     * no effect in contexts where they are not implemented, this practice can
-     * cause issues when migrating codebases to newer versions of the language.
-     */
-    futurehostile: true,
-
     /**
      * This option prohibits the use of unary increment and decrement
      * operators.  Some people think that `++` and `--` reduces the quality of
diff --git a/src/vars.js b/src/vars.js
index 08865c21..91ac6565 100644
--- a/src/vars.js
+++ b/src/vars.js
@@ -10,47 +10,51 @@ exports.reservedVars = {
 };
 
 exports.ecmaIdentifiers = {
-  3: {
-    Array              : false,
-    Boolean            : false,
-    Date               : false,
-    decodeURI          : false,
-    decodeURIComponent : false,
-    encodeURI          : false,
-    encodeURIComponent : false,
-    Error              : false,
-    "eval"             : false,
-    EvalError          : false,
-    Function           : false,
-    hasOwnProperty     : false,
-    isFinite           : false,
-    isNaN              : false,
-    Math               : false,
-    Number             : false,
-    Object             : false,
-    parseInt           : false,
-    parseFloat         : false,
-    RangeError         : false,
-    ReferenceError     : false,
-    RegExp             : false,
-    String             : false,
-    SyntaxError        : false,
-    TypeError          : false,
-    URIError           : false
-  },
-  5: {
-    JSON               : false
-  },
-  6: {
-    Map                : false,
-    Promise            : false,
-    Proxy              : false,
-    Reflect            : false,
-    Set                : false,
-    Symbol             : false,
-    WeakMap            : false,
-    WeakSet            : false
-  }
+  Array              : false,
+  Boolean            : false,
+  Date               : false,
+  decodeURI          : false,
+  decodeURIComponent : false,
+  encodeURI          : false,
+  encodeURIComponent : false,
+  Error              : false,
+  "eval"             : false,
+  EvalError          : false,
+  Function           : false,
+  hasOwnProperty     : false,
+  isFinite           : false,
+  isNaN              : false,
+  JSON               : false,
+  Map                : false,
+  Math               : false,
+  Number             : false,
+  Object             : false,
+  Proxy              : false,
+  Promise            : false,
+  parseInt           : false,
+  parseFloat         : false,
+  RangeError         : false,
+  ReferenceError     : false,
+  RegExp             : false,
+  Set                : false,
+  String             : false,
+  SyntaxError        : false,
+  TypeError          : false,
+  URIError           : false,
+  WeakMap            : false,
+  WeakSet            : false
+};
+
+exports.newEcmaIdentifiers = {
+  Set     : false,
+  Map     : false,
+  WeakMap : false,
+  WeakSet : false,
+  Proxy   : false,
+  Promise : false,
+  Reflect : false,
+  Symbol  : false,
+  System  : false
 };
 
 // Global variables commonly provided by a web browser environment.


Test patch:
diff --git a/tests/regression/thirdparty.js b/tests/regression/thirdparty.js
index f5cf927b..45f888cc 100644
--- a/tests/regression/thirdparty.js
+++ b/tests/regression/thirdparty.js
@@ -185,7 +185,7 @@ exports.json2 = function (test) {
   TestRun(test)
     .addError(177, "'key' is defined but never used.")
     .addError(191, "'key' is defined but never used.")
-    .test(src, { singleGroups: true, undef: true, unused: true, laxbreak: true, predef: ["-JSON"] }, { JSON: true });
+    .test(src, { singleGroups: true, undef: true, unused: true, laxbreak: true }, { JSON: true });
 
   test.done();
 };
diff --git a/tests/unit/options.js b/tests/unit/options.js
index 62bf6740..4260762e 100644
--- a/tests/unit/options.js
+++ b/tests/unit/options.js
@@ -1818,7 +1818,8 @@ exports.esnextPredefs = function (test) {
     '/* global alert: true */',
     'var mySym = Symbol("name");',
     'var myBadSym = new Symbol("name");',
-    'alert(Reflect);'
+    'alert(Reflect);',
+    'alert(System);'
   ];
 
   TestRun(test)
@@ -2182,98 +2183,3 @@ exports.badInlineOptionValue = function (test) {
 
   test.done();
 };
-
-exports.futureHostile = function (test) {
-  var code = [
-    "var JSON = {};",
-    "var Map = function() {};",
-    "var Promise = function() {};",
-    "var Proxy = function() {};",
-    "var Reflect = function() {};",
-    "var Set = function() {};",
-    "var Symbol = function() {};",
-    "var WeakMap = function() {};",
-    "var WeakSet = function() {};"
-  ];
-
-  TestRun(test, "ES3 without option")
-    .addError(1, "'JSON' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(2, "'Map' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(3, "'Promise' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(4, "'Proxy' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(5, "'Reflect' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(6, "'Set' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(7, "'Symbol' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(8, "'WeakMap' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(9, "'WeakSet' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .test(code, { es3: true, es5: false });
-
-  TestRun(test, "ES3 with option")
-    .test(code, { es3: true, es5: false, futurehostile: true });
-
-  TestRun(test, "ES5 without option")
-    .addError(1, "Redefinition of 'JSON'.")
-    .addError(2, "'Map' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(3, "'Promise' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(4, "'Proxy' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(5, "'Reflect' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(6, "'Set' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(7, "'Symbol' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(8, "'WeakMap' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .addError(9, "'WeakSet' is defined in a future version of JavaScript. Use a different variable name to avoid migration issues.")
-    .test(code, {});
-
-  TestRun(test, "ES5 with option")
-    .addError(1, "Redefinition of 'JSON'.")
-    .test(code, {
-      futurehostile: true
-    });
-
-  TestRun(test, "ES5 with opt-out")
-    .test(code, {
-      futurehostile: true,
-      predef: ["-JSON"]
-    });
-
-  TestRun(test, "ESNext without option")
-    .addError(1, "Redefinition of 'JSON'.")
-    .addError(2, "Redefinition of 'Map'.")
-    .addError(3, "Redefinition of 'Promise'.")
-    .addError(4, "Redefinition of 'Proxy'.")
-    .addError(5, "Redefinition of 'Reflect'.")
-    .addError(6, "Redefinition of 'Set'.")
-    .addError(7, "Redefinition of 'Symbol'.")
-    .addError(8, "Redefinition of 'WeakMap'.")
-    .addError(9, "Redefinition of 'WeakSet'.")
-    .test(code, { esnext: true });
-
-  TestRun(test, "ESNext with option")
-    .addError(1, "Redefinition of 'JSON'.")
-    .addError(2, "Redefinition of 'Map'.")
-    .addError(3, "Redefinition of 'Promise'.")
-    .addError(4, "Redefinition of 'Proxy'.")
-    .addError(5, "Redefinition of 'Reflect'.")
-    .addError(6, "Redefinition of 'Set'.")
-    .addError(7, "Redefinition of 'Symbol'.")
-    .addError(8, "Redefinition of 'WeakMap'.")
-    .addError(9, "Redefinition of 'WeakSet'.")
-    .test(code, { esnext: true, futurehostile: true });
-
-  TestRun(test, "ESNext with opt-out")
-    .test(code, {
-      esnext: true,
-      predef: [
-        "-JSON",
-        "-Map",
-        "-Promise",
-        "-Proxy",
-        "-Reflect",
-        "-Set",
-        "-Symbol",
-        "-WeakMap",
-        "-WeakSet"
-      ]
-    });
-
-  test.done();
-};