diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-06-18 16:02:08 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-19 15:07:31 +0200 |
commit | cc2ae2d316b039ba599e3a8d3aed168ad7e77b10 (patch) | |
tree | 9b96fafe8671b59aaa65ad182de984e09797eba4 /deno2/file_util.cc | |
parent | 064d889af05365b3d2051f0db800adc1ad977f3a (diff) |
Snapshot clean ups
- Don't call eval() in mock_runtime - not allowed - see js2c.py.
- Don't use v8_use_external_startup_data
- Move MakeSnapshot to snapshot_creator.cc
- Use logging.h in from_snapshot.cc
Diffstat (limited to 'deno2/file_util.cc')
-rw-r--r-- | deno2/file_util.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/deno2/file_util.cc b/deno2/file_util.cc index c78d3e227..20711bae7 100644 --- a/deno2/file_util.cc +++ b/deno2/file_util.cc @@ -44,16 +44,18 @@ class StartupDataCppWriter { void WritePrefix() { file_ << "// Autogenerated snapshot file. Do not edit.\n\n"; file_ << "#include \"v8/include/v8.h\"\n\n"; + file_ << "namespace deno { \n\n"; } void WriteSuffix() { char buffer[500]; - snprintf(buffer, sizeof(buffer), - "const v8::StartupData* StartupBlob_%s() {\n", name_); + snprintf(buffer, sizeof(buffer), "v8::StartupData* StartupBlob_%s() {\n", + name_); file_ << buffer; snprintf(buffer, sizeof(buffer), " return &%s_blob;\n", name_); file_ << buffer; file_ << "}\n\n"; + file_ << "} // namespace deno\n\n"; } void WriteBinaryContentsAsCArray() { @@ -78,7 +80,7 @@ class StartupDataCppWriter { snprintf(buffer, sizeof(buffer), "static const int %s_blob_size = %llu;\n", name_, static_cast<unsigned long long>(data_.size())); file_ << buffer; - snprintf(buffer, sizeof(buffer), "static const v8::StartupData %s_blob =\n", + snprintf(buffer, sizeof(buffer), "static v8::StartupData %s_blob =\n", name_); file_ << buffer; snprintf(buffer, sizeof(buffer), |