Notifications

72 views

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()) 

Article Information

Last Updated:2018-11-13 08:02:55
Published:2018-11-13