Option to preserve function names in Output Js file

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
eddy
Posts: 124
Joined: Thu Mar 27, 2014 8:34 am

Option to preserve function names in Output Js file

Post by eddy »

Hi,
I wonder why functions are renamed in debug mode ?

SB continues to rename functions even if I uncheck 'optimize javascript output' option.
Last edited by eddy on Sat May 30, 2015 2:30 pm, edited 1 time in total.
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Option to preserve function names

Post by Fred »

What do you mean by 'renamed' ?
User avatar
eddy
Posts: 124
Joined: Thu Mar 27, 2014 8:34 am

Re: Option to preserve function names

Post by eddy »

For example :

Code: Select all

Procedure Calc ()  ;--------------> becomes Proc0 in js output file
EndProcedure

Procedure Move ()  ;--------------> becomes Proc1 in js output file
EndProcedure
Is it possible to add a prefix ?

Code: Select all

Procedure Move ()  ;--------------> will become proc_Move, pr_Move or sb_Move
EndProcedure
User avatar
skywalk
Posts: 55
Joined: Tue Feb 25, 2014 2:13 am
Location: Boston, MA

Re: Option to preserve function names in Output Js file

Post by skywalk »

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
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Option to preserve function names in Output Js file

Post by Fred »

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.
the.weavster
Posts: 229
Joined: Sat Mar 01, 2014 3:02 pm

Re: Option to preserve function names in Output Js file

Post by the.weavster »

Fred wrote:I think we will uses the 'sb_procname' all in lowercase in a next version.
Any idea of the ETA for that version? This feature would come in dead handy right now :)
the.weavster
Posts: 229
Joined: Sat Mar 01, 2014 3:02 pm

Re: Option to preserve function names in Output Js file

Post by the.weavster »

And could we have something like this (maybe there's already a way to do this?):

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
So that we can pass JS objects around without having to convert them to SB types.
Post Reply