The type in the JSdoc is used for inferencing, but you do not have it 
specified correctly, it should be enclosed in "{}" before the param name, 
like
  * @param {Node} _this

Adding the directive @memberOf  like
  * @memberOf DOM
should make the static method work correctly, but there appears to be a 
bug preventing it from working correctly. I will fix it. As a workaround, 
you can add this line:
  var xx = new DOM();




Phil Berkland
IBM Software Group Emerging Technologies



"Andres C. Rodriguez" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
02/14/2008 01:19 PM
Please respond to
"General discussion of project-wide or architectural issues." 
<[email protected]>


To
[email protected]
cc

Subject
[wtp-dev] Type inferral on JSDT








Hello,

I am trying to make JSDT work for my JS libraries. I have a couple of 
questions.

1. Is the type in the JsDoc used for type inference?  I have the code 
below, but I am getting a warning saying: 'nextSibling cannot be 
resolved or is not a field' over 'nextSibling'.  If it is not used, what 
other way do I have to tell JSDT the type of a certain object.

2. Static functions such as the one below (not attached to prototype) 
are being shown in the outline, but then flagged as errors: 'The 
function insertAfter(any, any, any) is undefined for the type Function'. 
  I should note that this happens when I try to use the static function 
inside the same JS file, when I use it outside, things seem to work.

Thanks for your help and keep up the good work.


ACR


------

/**
  * Inserts 'newElem' as a child of '_this' after element 'refElem'
  * @param _this   Node
  * @param newElem Node
  * @param refElem Node
  */
DOM.insertAfter = function(_this, newElem, refElem) {
     var ns = refElem.nextSibling;
     if (ns == null) _this.appendChild(newElem);
     else _this.insertBefore(newElem, ns));
}
_______________________________________________
wtp-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/wtp-dev

_______________________________________________
wtp-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/wtp-dev

Reply via email to