Various minor cleanups to WASM code generation
* Add newline function to code_builder * Remove type aliases which made jump to definition less ergonomic * Add types to constants PiperOrigin-RevId: 827863199 Change-Id: Ib4390d398926466ecce491a3d0ebe308ed5e0cbe
This commit is contained in:
committed by
Copybara-Service
parent
10130297c0
commit
c22d94e470
@@ -74,14 +74,15 @@ def _build_struct_header_internal(
|
||||
|
||||
builder.line(f"{struct_name}* get() const {{ return ptr_; }}")
|
||||
builder.line(f"void set({struct_name}* ptr) {{ ptr_ = ptr; }}")
|
||||
builder.line("")
|
||||
|
||||
builder.newline()
|
||||
builder.line("private:")
|
||||
builder.line(f"{struct_name}* ptr_;")
|
||||
if not is_mjs:
|
||||
builder.line("bool owned_ = false;")
|
||||
|
||||
if is_mjs and fields_with_init:
|
||||
builder.line("")
|
||||
builder.newline()
|
||||
builder.line("public:")
|
||||
for field in fields_with_init:
|
||||
if field.definition:
|
||||
|
||||
Reference in New Issue
Block a user