tools: dump config.gypi as json · nodejs/node@1c38f80 · GitHub
Skip to content

Commit 1c38f80

Browse files
legendecasRafaelGSS
authored andcommitted
tools: dump config.gypi as json
This helps js2c processing the node.gypi correctly when a string contains a quote. PR-URL: #60794 Refs: #60703 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent c6d7a7b commit 1c38f80

3 files changed

Lines changed: 7 additions & 17 deletions

File tree

configure.py

Lines changed: 2 additions & 1 deletion

test/parallel/test-process-config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ let config = fs.readFileSync(configPath, 'utf8');
4949

5050
// Clean up comment at the first line.
5151
config = config.split('\n').slice(1).join('\n');
52-
config = config.replace(/"/g, '\\"');
53-
config = config.replace(/'/g, '"');
52+
// Turn pseudo-booleans strings into booleans.
5453
config = JSON.parse(config, (key, value) => {
5554
if (value === 'true') return true;
5655
if (value === 'false') return false;

tools/js2c.cc

Lines changed: 4 additions & 14 deletions

0 commit comments

Comments
 (0)