summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-03 00:49:12 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-12-11 06:40:09 +0800
commit44a5fe145759a2fa43247da2f40a55df23572944 (patch)
tree74c346b396e14f5da4fbc85d4a48bd974b2a3432 /src/env.h
parent9fb4fa8ded0504f63c89ed969640e5a2df8d0d59 (diff)
downloadandroid-node-v8-44a5fe145759a2fa43247da2f40a55df23572944.tar.gz
android-node-v8-44a5fe145759a2fa43247da2f40a55df23572944.tar.bz2
android-node-v8-44a5fe145759a2fa43247da2f40a55df23572944.zip
process: specialize building and storage of process.config
Instead of treating config.gypi as a JavaScript file, specialize the processing in js2c and make the serialized result a real JSON string (with 'true' and 'false' converted to boolean values) so we don't have to use a custom deserializer during bootstrap. In addition, store the JSON string separately in NativeModuleLoader, and keep it separate from the map of the builtin source code, so we don't have to put it onto `NativeModule._source` and delete it later, though we still preserve it in `process.binding('natives')`, which we don't use anymore. This patch also makes the map of builtin source code and the config.gypi string available through side-effect-free getters in C++. PR-URL: https://github.com/nodejs/node/pull/24816 Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/env.h b/src/env.h
index ec0368e040..b46f45a0d2 100644
--- a/src/env.h
+++ b/src/env.h
@@ -138,6 +138,7 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
V(channel_string, "channel") \
V(chunks_sent_since_last_write_string, "chunksSentSinceLastWrite") \
V(code_string, "code") \
+ V(config_string, "config") \
V(constants_string, "constants") \
V(cwd_string, "cwd") \
V(dest_string, "dest") \
@@ -307,7 +308,7 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
V(write_host_object_string, "_writeHostObject") \
V(write_queue_size_string, "writeQueueSize") \
V(x_forwarded_string, "x-forwarded-for") \
- V(zero_return_string, "ZERO_RETURN") \
+ V(zero_return_string, "ZERO_RETURN")
#define ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) \
V(as_external, v8::External) \