Hi,
I wonder why functions are renamed in debug mode ?
SB continues to rename functions even if I uncheck 'optimize javascript output' option.
Option to preserve function names in Output Js file
Option to preserve function names in Output Js file
Last edited by eddy on Sat May 30, 2015 2:30 pm, edited 1 time in total.
Re: Option to preserve function names
What do you mean by 'renamed' ?
Re: Option to preserve function names
For example :
Is it possible to add a prefix ?
Code: Select all
Procedure Calc () ;--------------> becomes Proc0 in js output file
EndProcedure
Procedure Move () ;--------------> becomes Proc1 in js output file
EndProcedure
Code: Select all
Procedure Move () ;--------------> will become proc_Move, pr_Move or sb_Move
EndProcedure
Re: Option to preserve function names in Output Js file
Is this intended as obfuscation of the source code?
When working toward the solution of a problem, it always helps if you know the answer. ~ ?
An expert is one who knows more and more about less and less until he knows absolutely everything about nothing. ~ Weber
An expert is one who knows more and more about less and less until he knows absolutely everything about nothing. ~ Weber
Re: Option to preserve function names in Output Js file
It was a bit easier for code generation, but I have to admit it does not fit well with inline JS feature. I think we will uses the 'sb_procname' all in lowercase in a next version.
-
- Posts: 229
- Joined: Sat Mar 01, 2014 3:02 pm
Re: Option to preserve function names in Output Js file
Any idea of the ETA for that version? This feature would come in dead handy right nowFred wrote:I think we will uses the 'sb_procname' all in lowercase in a next version.

-
- Posts: 229
- Joined: Sat Mar 01, 2014 3:02 pm
Re: Option to preserve function names in Output Js file
And could we have something like this (maybe there's already a way to do this?):
So that we can pass JS objects around without having to convert them to SB types.
Code: Select all
Procedure proc_1()
!var obj = {};
!obj["greeting"] = "Hello, World!";
!sb_proc_2(obj);
EndProcedure
Procedure proc_2(*obj)
!alert(v_obj["greeting"]);
EndProcedure