I have been developing javascript for the past few weeks and have been trying JSDT and Aptana to help complete the code. JSDT was not very good, but I was more fortunate with Aptana (used as an eclipse plugin, not a separate product). The problem I am facing is that when I create javascript classes, I cannot complete the code. For example, if I use the following, then code completion does not work:
var foo = new function(value){
this.myMethod= function(){
}
}
I also checked that the following will not work:
function foo(value){
this.myMethod= function(){
}
}
I found that using JSON style really works:
var foo = {
myMethod: function(){
}
}
Does anyone know why Aptana works for the latter style, but not the first? Using the JSON style will not work for me, because I must have separate instances of the class in question.
, . , 3 javascript, Aptana JSON . DID ( 2 , ), , , .
.
, :
function foo() {
}
function bar(a, b){
};
foo.prototype.b = bar;
var x = new foo();
x.b
, . , .
var foo = new function() {
}
function bar(a, b){
};
foo.prototype.b = bar;
var x = new foo();
x.b
? javascript?