Permalink
Browse files

Added Element to the browser globals list.

Fixes GH-707.
  • Loading branch information...
1 parent 7483f07 commit 05134c1e5b9571d5490b08c8c02ab4c362124a6e @valueof valueof committed Oct 27, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −0 src/stable/jshint.js
  2. +3 −2 tests/stable/unit/envs.js
View
@@ -389,6 +389,7 @@ var JSHINT = (function () {
DOMParser : false,
defaultStatus : false,
document : false,
+ Element : false,
event : false,
FileReader : false,
Float32Array : false,
@@ -4,8 +4,8 @@
"use strict";
-var JSHINT = require('../../../src/stable/jshint.js').JSHINT;
-var fs = require('fs');
+var JSHINT = require('../../../src/stable/jshint.js').JSHINT;
+var fs = require('fs');
var TestRun = require("../helpers/testhelper").setup.testRun;
function wrap(globals) {
@@ -241,6 +241,7 @@ exports.browser = function (test) {
"defaultStatus",
"document",
"event",
+ "Element",
"FileReader",
"Float32Array",
"Float64Array",

5 comments on commit 05134c1

Why hasn't this been implemented?

The Element value still hasn't been added to the browser globals list yet.

Owner

valueof replied Feb 1, 2013

You're commenting on a commit that adds Element to the browser globals list.

Try entering this js snippet on the JSHint website. It still gives the "Element is not defined" error, while the String global produces no error. Am I missing something?

(function(){
  'use strict';

  // Modify an element's textContent
  Element.prototype.text = function (string) {
          this.textContent = string;
  };

  // Capitalize first letter in string
  String.prototype.capitalize = function() {
          return this.charAt(0).toUpperCase() + this.slice(1);
  };

})();
Owner

valueof replied Feb 1, 2013

The version that contains this update (1.0.0) was not released yet.

Owner

valueof replied Feb 1, 2013

You can use a Release Candidate if you really want it. See jshint.com/blog for more information.

Please sign in to comment.