Script Include does not return anything added to the "initialize" block


Description

Symptoms


Return statements placed inside a initialize block does not return any values, When logged returns [object Object]

Release


All

Cause


 the initial block will always return the object reference to the script include

Resolution


Script Include with the issue 

var abc = Class.create(); 
abc.prototype = { 
initialize: function() { 
return "test"; 
}, 

type: 'abc' 

Background Script: 
Var a = new abc(); 
gs.log(a) 

 

Script Include with the correct use case,

var abc = Class.create(); 
abc.prototype = { 
initialize: function() { 
}, 
func: function(){ 
return 'test' 


type: 'abc' 

BackGround Script: 
Var a = new abc(); 
gs.log(a.func())