Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix config serialization w/ long strings #35982

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion tools/js2c.py
Expand Up @@ -163,9 +163,11 @@ def handle_config_gypi(config_filename):
def jsonify(config):
# 1. string comments
config = re.sub(r'#.*?\n', '', config)
# 2. join multiline strings
config = re.sub(r"'$\s+'", '', config, flags=re.M)
# 3. normalize string literals from ' into "
config = re.sub('\'', '"', config)
# 2. turn pseudo-booleans strings into Booleans
# 4. turn pseudo-booleans strings into Booleans
config = re.sub('"true"', 'true', config)
config = re.sub('"false"', 'false', config)
return config
Expand Down