Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
Fix capitalization of Array and Object types
Browse files Browse the repository at this point in the history
Array and Object were often written as array and object, causing
warnings such as:

./buffer.js:32: WARNING - Bad type annotation. Unknown type object
 * @type {object.<string,*>}
          ^

Fix the warnings by correcting the capitalization.

Signed-off-by: Kevin Locke <[email protected]>
  • Loading branch information
kevinoid committed Apr 13, 2013
1 parent 2f5d78c commit ecba869
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions contrib/Preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Preprocessor.indent = function(str, indent) {};
Preprocessor.nlToStr = function(str) {};

/**
* @param {object.<strin,string>} defines
* @param {Object.<string,string>} defines
* @param {string} expr
* @return {*}
* @throws {Error}
Expand All @@ -72,7 +72,7 @@ Preprocessor.nlToStr = function(str) {};
Preprocessor.evaluate = function(defines, expr) {};

/**
* @param {object.<string,*>} directives
* @param {Object.<string,*>} directives
* @return {string}
*/
Preprocessor.prototype.process = function(directives) {};
Expand Down
12 changes: 6 additions & 6 deletions contrib/ProtoBuf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/

/**
* {@type object.<string.*>}
* {@type Object.<string.*>}
*/
var ProtoBuf = {};

Expand All @@ -38,7 +38,7 @@ var ProtoBuf = {};
ProtoBuf.VERSION = "0.9.2";

/**
* @type {!object.<string,number>}
* @type {!Object.<string,number>}
* @const
*/
ProtoBuf.WIRE_TYPES = {};
Expand Down Expand Up @@ -81,7 +81,7 @@ ProtoBuf.WIRE_TYPES.BITS32 = 5;

/**
* @dict
* @type {!object.<string,{name: string, wireType: number}>}
* @type {!Object.<string,{name: string, wireType: number}>}
* @const
*/
ProtoBuf.TYPES = {
Expand Down Expand Up @@ -136,12 +136,12 @@ ProtoBuf.TYPES = {
};

/**
* @type {!object.<string,string|RegExp>}
* @type {!Object.<string,string|RegExp>}
*/
ProtoBuf.Lang = {};

/**
* @type {!object.<string,function>}
* @type {!Object.<string,function>}
*/
ProtoBuf.DotProto = {};

Expand All @@ -162,7 +162,7 @@ ProtoBuf.DotProto.Tokenizer.prototype.source;
ProtoBuf.DotProto.Tokenizer.prototype.index;

/**
* @type {array.<string>}
* @type {Array.<string>}
*/
ProtoBuf.DotProto.Tokenizer.prototype.stack;

Expand Down
14 changes: 7 additions & 7 deletions contrib/Ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ws.Server.prototype.handleUpgrade = function(request, socket, upgradeHead, callb

/**
* @param {string} address
* @param {object.<string,*>=} options
* @param {Object.<string,*>=} options
* @constructor
* @extends events.EventEmitter
*/
Expand All @@ -84,7 +84,7 @@ ws.WebSocket.prototype.protocolVersion;
ws.WebSocket.prototype.url;

/**
* @type {object.<string,*>}
* @type {Object.<string,*>}
*/
ws.WebSocket.prototype.supports;

Expand All @@ -100,14 +100,14 @@ ws.WebSocket.prototype.pause = function() {};

/**
* @param {*=} data
* @param {object.<string,*>=} options
* @param {Object.<string,*>=} options
* @param {boolean=} dontFailWhenClosed
*/
ws.WebSocket.prototype.ping = function(data, options, dontFailWhenClosed) {};

/**
* @param {*=}data
* @param {object.<string,*>=} options
* @param {Object.<string,*>=} options
* @param {boolean=} dontFailWhenClosed
*/
ws.WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) {};
Expand All @@ -118,13 +118,13 @@ ws.WebSocket.prototype.resume = function() {};

/**
* @param {*} data
* @param {object.<string,*>=} options
* @param {Object.<string,*>=} options
* @param {function(...[*])=} callback
*/
ws.WebSocket.prototype.send = function(data, options, callback) {};

/**
* @param {object.<string,*>|function(string, boolean)} options
* @param {Object.<string,*>|function(string, boolean)} options
* @param {function(string, boolean)=} callback
*/
ws.WebSocket.prototype.stream = function(options, callback) {};
Expand All @@ -149,6 +149,6 @@ ws.WebSocket.prototype.onerror = function(error) {};
ws.WebSocket.prototype.onclose = function(code, message) {};

/**
* @type {?function(*, object.<string,*>)}
* @type {?function(*, Object.<string,*>)}
*/
ws.WebSocket.prototype.onmessage = function(data, flags) {};
8 changes: 4 additions & 4 deletions fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ fs.readlinkSync = function(path) {};

/**
* @param {string} path
* @param {object.<string,string>|function(string, string)=} cache
* @param {Object.<string,string>|function(string, string)=} cache
* @param {function(string, string)=} callback
* @nosideeffects
*/
fs.realpath = function(path, cache, callback) {};

/**
* @param {string} path
* @param {object.<string,string>=} cache
* @param {Object.<string,string>=} cache
* @return {string}
* @nosideeffects
*/
Expand Down Expand Up @@ -277,14 +277,14 @@ fs.mkdirSync = function(path, mode) {};

/**
* @param {string} path
* @param {function(string,array.<string>)=} callback
* @param {function(string,Array.<string>)=} callback
* @nosideeffects
*/
fs.readdir = function(path, callback) {};

/**
* @param {string} path
* @return {array.<string>}
* @return {Array.<string>}
* @nosideeffects
*/
fs.readdirSync = function(path) {};
Expand Down
6 changes: 3 additions & 3 deletions os.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ os.release = function() {};
os.uptime = function() {};

/**
* @return {array.<number>}
* @return {Array.<number>}
* @nosideeffects
*/
os.loadavg = function() {};
Expand All @@ -95,7 +95,7 @@ os.freemem = function() {};
var osCpusInfo;

/**
* @return {array.<osCpusInfo>}
* @return {Array.<osCpusInfo>}
* @nosideeffects
*/
os.cpus = function() {};
Expand All @@ -106,7 +106,7 @@ os.cpus = function() {};
var osNetworkInterfacesInfo;

/**
* @return {object.<string,osNetworkInterfacesInfo>}
* @return {Object.<string,osNetworkInterfacesInfo>}
* @nosideeffects
*/
os.networkInterfaces = function() {};
Expand Down
8 changes: 4 additions & 4 deletions process.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ process.stdout;
process.stderr;

/**
* @type {array.<string>}
* @type {Array.<string>}
*/
process.argv;

Expand All @@ -68,7 +68,7 @@ process.chdir = function(directory) {};
process.cwd = function() {};

/**
* @type {object.<string,string>}
* @type {Object.<string,string>}
*/
process.env;

Expand Down Expand Up @@ -110,7 +110,7 @@ process.version;
process.versions;

/**
* @type {object.<string,*>}
* @type {Object.<string,*>}
*/
process.config;

Expand Down Expand Up @@ -141,7 +141,7 @@ process.arch;
process.platform;

/**
* @return {object.<string,number>}
* @return {Object.<string,number>}
* @nosideeffects
*/
process.memoryUsage = function() {};
Expand Down

0 comments on commit ecba869

Please sign in to comment.