-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
(apologies if this topic has been covered before, I looked but couldn't find anything about it)
Given the following class:
class MyKlass
sub new()
end sub
function abc() as integer
end function
function def() as object
end function
end classWe currently transpile it like so:
function __MyKlass_builder()
instance = {}
instance.new = sub()
end sub
instance.abc = function() as integer
end function
instance.def = function() as object
end function
return instance
end function
function MyKlass()
instance = __MyKlass_builder()
instance.new()
return instance
end functionHowever, when it comes to crash logs and profiling, all of the class' methods will appear as $anon_....
To improve this, I was wondering if it would be possible to transpile them with all methods being named instead:
sub __MyKlass_new()
end sub
function __MyKlass_abc() as integer
end function
function __MyKlass_def() as object
end function
function __MyKlass_builder()
instance = {}
instance.new = __MyKlass_new
instance.abc = __MyKlass_abc
instance.def = __MyKlass_def
return instance
end function
function MyKlass()
instance = __MyKlass_builder()
instance.new()
return instance
end functionThis would make it so that in class-heavy projects, Roku's crash logs would become a lot more readable at a glance, and we'd be able to more easily use tools such as the BrightScript Profiler without having to repeatedly check for filenames and line numbers.
Thoughts? Has this been considered in the past?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested