JavaScript auto complete on object creation
Hello.
I can't to get auto-complete worked with 'new' operator.
I use "class" abstraction (Base.js from Dean Edwards or Class.js from John Resig) that have hidden method to instantiate object.
It called "init" or "constructor". Here is a sample code how i used it:
var Animal = Base.extend( /** * @lends Animal# */ { /** * @class {Animal} * @constructs {Animal} * @param {String} name */ constructor: function(name) { this.name = name; }, name: "", eat: function() { this.say("Yum!"); }, say: function(message) { alert(this.name + ": " + message); } } );
When i use 'var a = new Animal()' i expect that i will have auto-complete on constructor params ('name' argument). But of course it doesn't happen.
Is there ways to write JsDoc that IDEA will know that 'constructor' method is a initialize method for Animal?
请先登录再写评论。