You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not to allocate intermediate temporary variables, Unreal.js supports call-by-ref and ghost-return-target-value.
letisolate=Root.GetOuter().GetOuter()letstats=isolate.GetHeapStatistics().Statisticsletstats2=isolate.GetHeapStatistics(stats).Statisticsconsole.log(stats,stats2,stats==stats2)// [object JavascriptHeapStatistics] [object JavascriptHeapStatistics] trueletx=newVector(),y=newVector(),z=newVector()x.X=1y.X=2z.X=4letw=x.Add_VectorVector(y,z)// NOTE: z is a ghost argument which is passed by ref to catch return value.console.log(JSON.stringify(z),'pre')console.log(JSON.stringify(w),'result',w==z)console.log(JSON.stringify(z))// {"X":4,"Y":0,"Z":0} pre// {"X":3,"Y":0,"Z":0} result true// {"X":3,"Y":0,"Z":0}