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
As of writing. the following places in jsgen have lot's of JS hardcoded in strings:
for_in_loop
for_in_map
assert_stmt
gen_test_main
The whole file lib/bait/gen/js/str_methods.bt
This is prone to misspellings and errors if things are moved, renamed, etc.
Proposed Solution
The JS in strings should where possible be removed.
Instead in the parser or checker stage manipulate the AST and insert exprs or stmts that will lead to the generation of equivalent code utilizing the normal jsgen methods.
Additional Information
For example in the parser script_mode_main artificially inserts a FunDecl.
The text was updated successfully, but these errors were encountered:
Describe the feature
As of writing. the following places in jsgen have lot's of JS hardcoded in strings:
for_in_loop
for_in_map
assert_stmt
gen_test_main
lib/bait/gen/js/str_methods.bt
This is prone to misspellings and errors if things are moved, renamed, etc.
Proposed Solution
The JS in strings should where possible be removed.
Instead in the parser or checker stage manipulate the AST and insert exprs or stmts that will lead to the generation of equivalent code utilizing the normal jsgen methods.
Additional Information
For example in the parser
script_mode_main
artificially inserts a FunDecl.The text was updated successfully, but these errors were encountered: