cyklop_77, консоль все правильно говорит. Вложенная функция не становится свойством функции, внутри которой она определена.
Чтобы ваш код работал надо сделать так:
function a(){
var rrr = 8;
this.aim = function(arg){
console.log('aim' + arg);
console.log(rrr);
}
};
function b(){
new a().aim('this is argument');
};
Или так:
var a = (function(){
var rrr = 8;
return {
aim: function(arg) {
console.log('aim' + arg);
console.log(rrr);
}
}
})();
function b(){
a.aim('this is argument');
};