I think you're a bit confused here. If you're using Demo like a class, you don't want to invoke it like a function, but rather like an instantiation.
When used with instantiation, you can definitely do this:
function Demo(){
var abc = "some value";
this.setAbc = function(val){
return abc = val;
}
this.getAbc = function(){
return abc;
}
}
var d = new Demo();
d.getAbc() // => 'some value';
d.setAbc('another value');
d.getAbc() // => 'another value';
These types of functions (defined within the 'constructor') are referred to as privileged functions. They have access to both public (ie. defined on the prototype) and private variables. Read this for a good rundown on public/private/privileged members of a 'class'.
note that if you just do:
var d = Demo();
You're not getting an instance of Demo, you're just getting what it returns. In my case undefined.
edit
After reading your post again, the quick answer is just NO, not with your particular definition, you'd have to do something like what I'm doing.
OR if you're sticking with your paradigm:
function Demo(){
var abc = "some value";
return {
get test(){ return abc; },
set test(val){ abc = val; }
}
}