From cc2ae2d316b039ba599e3a8d3aed168ad7e77b10 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 18 Jun 2018 16:02:08 +0200 Subject: 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 --- deno2/file_util.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'deno2/file_util.cc') 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(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), -- cgit v1.2.3