Skip to content

Commit

Permalink
Add debug information for enum type parameters
Browse files Browse the repository at this point in the history
- This change improves debugging capabilities by providing more detailed
information about enum type parameters in the generated JavaScript code.
  • Loading branch information
AkiSakurai committed Dec 15, 2024
1 parent 542b241 commit d800fdb
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ class JavaScriptCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)

if (config.readStoresPos) {
out.puts("this._debug = {};")
params.foreach { p =>
// Add debug information for enum type parameters
p.dataType match {
case t: EnumType =>
out.puts(s"this._debug['${idToStr(p.id)}'] = {")
out.inc
out.puts(s"enumName: \"${types2class(t.enumSpec.get.name, false)}\"")
out.dec
out.puts("};")
case _ => // Do nothing for non-enum types
}
}
}
out.puts
}
Expand Down

0 comments on commit d800fdb

Please sign in to comment.