Permalink
Browse files

Added Buffer and GLOBAL to Node.js predefined globals

  • Loading branch information...
1 parent 1d9088b commit 3c681448a20b634d4ba629814186d3f2a4dc46e5 @valueof valueof committed Jan 30, 2011
Showing with 13 additions and 9 deletions.
  1. +4 −2 jshint.js
  2. +9 −7 tests/jshint.js
View
@@ -159,7 +159,7 @@
"(identifier)", "(last)", "(line)", "(loopage)", "(name)", "(onevar)",
"(params)", "(scope)", "(statement)", "(verb)", "*", "+", "++", "-",
"--", "\/", "<", "<=", "==", "===", ">", ">=", ADSAFE, __filename, __dirname,
- ActiveXObject, Array, Boolean, COM, CScript, Canvas, CustomAnimation,
+ ActiveXObject, Array, Boolean, Buffer, COM, CScript, Canvas, CustomAnimation,
Date, Debug, E, Enumerator, Error, EvalError, FadeAnimation, Flash,
FormField, Frame, Function, HotKey, Image, JSON, LN10, LN2, LOG10E,
LOG2E, MAX_VALUE, MIN_VALUE, Math, MenuItem, MoveAnimation,
@@ -205,7 +205,7 @@
"font-size-adjust", "font-stretch", "font-style", "font-variant",
"font-weight", footer, forestgreen, forin, form, fragment, frame,
frames, frameset, from, fromCharCode, fuchsia, fud, funct, function,
- functions, g, gainsboro, gc, getComputedStyle, ghostwhite, global,
+ functions, g, gainsboro, gc, getComputedStyle, ghostwhite, GLOBAL, global,
globals, gold, goldenrod, gray, graytext, green, greenyellow, h1, h2,
h3, h4, h5, h6, handheld, hasOwnProperty, head, header, height, help,
hgroup, highlight, highlighttext, history, honeydew, hotpink, hr,
@@ -759,6 +759,8 @@ var JSHINT = (function () {
node = {
__filename : false,
__dirname : false,
+ Buffer : false,
+ GLOBAL : false,
global : false,
module : false,
process : false,
View
@@ -110,12 +110,14 @@ describe("Control statements", function () {
describe("Globals", function () {
var win = "window.location = 'http://google.com/';",
node = [
- "__filename",
- "__dirname",
- "global",
- "module",
- "process",
- "require"
+ "__filename"
+ , "__dirname"
+ , "Buffer"
+ , "GLOBAL"
+ , "global"
+ , "module"
+ , "process"
+ , "require"
];
it("must know that window is a predefined global", function () {
@@ -133,7 +135,7 @@ describe("Globals", function () {
var report = JSHINT.data()
expect(report.implieds).toEqual(undefined);
- expect(report.globals.length).toEqual(6);
+ expect(report.globals.length).toEqual(8);
var globals = {};
for (var i = 0, g; g = report.globals[i]; i++)

0 comments on commit 3c68144

Please sign in to comment.