Skip to content

Commit ad8bc18

Browse files
committed
Sort members of EmccOptions. NFC
Also, use class variables instead of instance fields. This doesn't change the semantics (at least not the way we use this class) and it saves a little bit of visual noise. The other nice thing this would allow if we ever wanted to to it is to compare the current option with its default (by comparing `self.foo` with `__class__.foo`, the default value).
1 parent 975f97d commit ad8bc18

File tree

1 file changed

+52
-53
lines changed

1 file changed

+52
-53
lines changed

tools/cmdline.py

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -60,59 +60,58 @@ class OFormat(Enum):
6060

6161

6262
class EmccOptions:
63-
def __init__(self):
64-
self.target = ''
65-
self.output_file = None
66-
self.input_files = []
67-
self.no_minify = False
68-
self.post_link = False
69-
self.save_temps = False
70-
self.executable = False
71-
self.oformat = None
72-
self.requested_debug = None
73-
self.emit_symbol_map = False
74-
self.use_closure_compiler = None
75-
self.js_transform = None
76-
self.pre_js = [] # before all js
77-
self.post_js = [] # after all js
78-
self.extern_pre_js = [] # before all js, external to optimized code
79-
self.extern_post_js = [] # after all js, external to optimized code
80-
self.preload_files = []
81-
self.embed_files = []
82-
self.exclude_files = []
83-
self.ignore_dynamic_linking = False
84-
self.shell_path = None
85-
self.source_map_base = ''
86-
self.emit_tsd = ''
87-
self.emrun = False
88-
self.cpu_profiler = False
89-
self.memory_profiler = False
90-
self.use_preload_cache = False
91-
self.use_preload_plugins = False
92-
self.valid_abspaths = []
93-
# Specifies the line ending format to use for all generated text files.
94-
# Defaults to using the native EOL on each platform (\r\n on Windows, \n on
95-
# Linux & MacOS)
96-
self.output_eol = os.linesep
97-
self.no_entry = False
98-
self.shared = False
99-
self.relocatable = False
100-
self.reproduce = None
101-
self.syntax_only = False
102-
self.dash_c = False
103-
self.dash_E = False
104-
self.dash_S = False
105-
self.dash_M = False
106-
self.input_language = None
107-
self.nostdlib = False
108-
self.nostdlibxx = False
109-
self.nodefaultlibs = False
110-
self.nolibc = False
111-
self.nostartfiles = False
112-
self.sanitize_minimal_runtime = False
113-
self.sanitize = set()
114-
self.lib_dirs = []
115-
self.fast_math = False
63+
cpu_profiler = False
64+
dash_E = False
65+
dash_M = False
66+
dash_S = False
67+
dash_c = False
68+
embed_files: list[str] = []
69+
emit_symbol_map = False
70+
emit_tsd = ''
71+
emrun = False
72+
exclude_files: list[str] = []
73+
executable = False
74+
extern_post_js: list[str] = [] # after all js, external to optimized code
75+
extern_pre_js: list[str] = [] # before all js, external to optimized code
76+
fast_math = False
77+
ignore_dynamic_linking = False
78+
input_files: list[str] = []
79+
input_language = None
80+
js_transform = None
81+
lib_dirs: list[str] = []
82+
memory_profiler = False
83+
no_entry = False
84+
no_minify = False
85+
nodefaultlibs = False
86+
nolibc = False
87+
nostartfiles = False
88+
nostdlib = False
89+
nostdlibxx = False
90+
oformat = None
91+
# Specifies the line ending format to use for all generated text files.
92+
# Defaults to using the native EOL on each platform (\r\n on Windows, \n on
93+
# Linux & MacOS)
94+
output_eol = os.linesep
95+
output_file = None
96+
post_js: list[str] = [] # after all js
97+
post_link = False
98+
pre_js: list[str] = [] # before all js
99+
preload_files: list[str] = []
100+
relocatable = False
101+
reproduce = None
102+
requested_debug = None
103+
sanitize: set[str] = set()
104+
sanitize_minimal_runtime = False
105+
save_temps = False
106+
shared = False
107+
shell_path = None
108+
source_map_base = ''
109+
syntax_only = False
110+
target = ''
111+
use_closure_compiler = None
112+
use_preload_cache = False
113+
use_preload_plugins = False
114+
valid_abspaths: list[str] = []
116115

117116

118117
def is_int(s):

0 commit comments

Comments
 (0)