<@U9U62UJMD> when when we call your pageInit scrip...
# sdf
m
@fkrauthan when when we call your pageInit script, if we call directly NetSuiteSSP.pageInit(options) will not work right? what you really want is us to call NetSSP(options).pageInit(). where options are context information for the pageInit call.
f
The only thing I would like is a way to add some meta information to tell your static code analyzer which lifecycle hooks I've implemented instead of rejecting my file. Everything else works as expected
m
so your right script would actually work? i don't see how it work theoretically. of course i didn't run it.
f
Yes ofcourse. V1 and V2 the only difference is that V1 is returning my compiled object that defines a pageInit method while V2 is manual recreating the object and pass the reference to pageInit that was returned in my compiled project
thats why I showed you the diff. The only difference is the bottom 3-4 lines everything else is the same.
NetSuiteSSP
is a java object that has a method pageInit defined by the time
return
on the bottom is called
m
Is there the correct simplication of your program?
define([], function()){ var NetSuiteSSP = function(t){ var e = {}; e.pageInit = function(){console.log('test');} }; return { pageInit: NetSuiteSSP.pageInit }; }
wait, missing the return. here you go again? if so, i will give a try myself.
define([], function()){ var NetSuiteSSP = function(t){ var e = {}; e.pageInit = function(){console.log('test');}; return e; }; return { pageInit: NetSuiteSSP.pageInit }; }
f
Copy code
define([], function()){
   var NetSuiteSSP = (function(t){
       var e = {};
       e.pageInit = function(){console.log('test');};
       return e;
   })();
   return {
       pageInit: NetSuiteSSP.pageInit
   };
}
That is the accurate simplification for the working solution. The non working solution would be to return
NetSuiteSSP
right away
m
ok, thanks.
ok, i see you're invoking the NetSuiteSSP, missed the () at the end.
i understand what you're doing. I will communicate this use case to the team for enhancement.
f
Perfect thank you very much