goog.provide('myphysicslab.lab.util.DoubleRect');goog.require('myphysicslab.lab.util.Vector');goog.require('myphysicslab.lab.util.UtilityCore');goog.scope(function() {var Vector = myphysicslab.lab.util.Vector;var UtilityCore = myphysicslab.lab.util.UtilityCore;var NF5 = myphysicslab.lab.util.UtilityCore.NF5;/**@param {!DoubleRect | !Vector | number} arg1 left edge,or center of rect, or entire DoubleRect to copy@param {number=} arg2 right edge, or width (when arg1 is center)@param {number=} arg3 bottom edge or height (when arg1 is center)@param {number=} arg4 top edge@constructor*/myphysicslab.lab.util.DoubleRect = function(arg1, arg2, arg3, arg4) {var left, right, bottom, top, width, height;if (arg1 instanceof myphysicslab.lab.util.DoubleRect) {left = arg1.getLeft();right = arg1.getRight();bottom = arg1.getBottom();top = arg1.getTop();} else if (arg1 instanceof Vector) {// arg1 is the centerif (!(goog.isDef(arg2) && goog.isDef(arg3))) {throw new Error();}width = arg2;height = arg3;left = arg1.getX() - width/2;right = arg1.getX() + width/2;bottom = arg1.getY() - height/2;top = arg1.getY() + height/2;} else {if (!goog.isDef(arg2) || !goog.isDef(arg3) || !goog.isDef(arg4)) {throw new Error();}left = arg1;right = arg2;bottom = arg3;top = arg4;}if (left > right) {throw new Error();}if (bottom > top) {throw new Error();}/*** @type {number}* @private*/this.left_ = left;/*** @type {number}* @private*/this.right_ = right;/*** @type {number}* @private*/this.bottom_ = bottom;/*** @type {number}* @private*/this.top_ = top;};
var DoubleRect = myphysicslab.lab.util.DoubleRect;
The JSDoc dictionary (at http://usejsdoc.org/tags-type.html ) states that ! is a valid character in a type. Yet I'm getting an error on@param {!DoubleRect | !Vector | number}I'm trying to run JSDoc on my Google Closure Compiler code. I've read bits and pieces about how JSDoc is moving towards compatibility with Closure Compiler, so I'm aware that it is probably not going to work. But I thought I'd try it and see what happens.Following some advice on https://github.com/jsdoc3/jsdoc/issues/152 "Parse Google Closure type annotations correctly" I'm using the --lenient option. Here is the command and the results:$ ./jsdoc -vJSDoc 3.2.0-dev (Fri, 19 Apr 2013 22:04:23 GMT)$ ./jsdoc -l ../jssimlab/src/lab/util/DoubleRect.jsError: cannot create a doclet for the comment "/**@param {!DoubleRect | !Vector | number} arg1 left edge, or center of rect, or entire DoubleRect to copy@param {number=} arg2 right edge, or width (when arg1 is center)@param {number=} arg3 bottom edge or height (when arg1 is center)@param {number=} arg4 top edge@constructor*/": unable to parse the type expression "!DoubleRect | !Vector | number": Expected "$", "*", "...", "?", "\\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "null", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with", "yield", "{", Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode titlecase letter or Unicode uppercase letter but "!" found.TagValueRequiredError: The @description tag requires a value. File: undefined, line: undefinedThere are more errors, but they all seem to be complaining about a "!" in a type. Perhaps ! doesn't work in a union type? Or perhaps I need a newer version than the pre-packaged "latest development version"?Thanks,--ErikN
/*** Foo function.* @param {(!DoubleRect | !Vector | number)} bar - The bar parameter.*/function foo(bar) {}
The JSDoc dictionary (at http://usejsdoc.org/tags-type.html ) states that ! is a valid character in a type. Yet I'm getting an error on@param {!DoubleRect | !Vector | number}I'm trying to run JSDoc on my Google Closure Compiler code. I've read bits and pieces about how JSDoc is moving towards compatibility with Closure Compiler, so I'm aware that it is probably not going to work. But I thought I'd try it and see what happens.Following some advice on https://github.com/jsdoc3/jsdoc/issues/152 "Parse Google Closure type annotations correctly" I'm using the --lenient option. Here is the command and the results:$ ./jsdoc -vJSDoc 3.2.0-dev (Fri, 19 Apr 2013 22:04:23 GMT)$ ./jsdoc -l ../jssimlab/src/lab/util/DoubleRect.jsError: cannot create a doclet for the comment "/**@param {!DoubleRect | !Vector | number} arg1 left edge, or center of rect, or entire DoubleRect to copy@param {number=} arg2 right edge, or width (when arg1 is center)@param {number=} arg3 bottom edge or height (when arg1 is center)@param {number=} arg4 top edge@constructor*/": unable to parse the type expression "!DoubleRect | !Vector | number": Expected "$", "*", "...", "?", "\\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "null", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with", "yield", "{", Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode titlecase letter or Unicode uppercase letter but "!" found.TagValueRequiredError: The @description tag requires a value. File: undefined, line: undefinedThere are more errors, but they all seem to be complaining about a "!" in a type. Perhaps ! doesn't work in a union type? Or perhaps I need a newer version than the pre-packaged "latest development version"?Thanks,--ErikN
--
You received this message because you are subscribed to the Google Groups "JSDoc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsdoc-users...@googlegroups.com.
To post to this group, send email to jsdoc...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsdoc-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.