Spket completely ignores JSDoc @return properties in files added in jQuery JavaScript Profile, causing all methods to return jQuery objects, which is incorrect behavior, because jQuery has number of methods that returns different result types (string, boolean, array etc.). For example, offset() method return Object, get() returns Element and so on. Here is a test case:
1. Create simple file and add it to default JavaScript Profile:
Code: Select all
/**
* @return {Object}
*/
jQuery.prototype.offset = function(){ return {top: 0, left: 0};};
2. Write this in editor:
Code: Select all
$('div').offset(). //code assist shows that offset() return jQuery
Or maybe I do something wrong?