From 10df2daf365eacffef511fa82995303a89a05092 Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Tue, 14 Nov 2017 15:57:57 +0300 Subject: [PATCH] FIXME: Revert 749b9c06 from the V8 repo It is supposed to be temporary, until the Node.js upgrade. --- patches/v8/012-revert_749b9c06.patch | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 patches/v8/012-revert_749b9c06.patch diff --git a/patches/v8/012-revert_749b9c06.patch b/patches/v8/012-revert_749b9c06.patch new file mode 100644 index 00000000..c41efa44 --- /dev/null +++ b/patches/v8/012-revert_749b9c06.patch @@ -0,0 +1,73 @@ +6e157c8eb4633da4b66aa3488c1f00b87f560505 +diff --git a/include/v8.h b/include/v8.h +index eec2256aea..cb16b21d2a 100644 +--- a/include/v8.h ++++ b/include/v8.h +@@ -6348,6 +6348,8 @@ typedef void (*FailedAccessCheckCallback)(Local target, + * Callback to check if code generation from strings is allowed. See + * Context::AllowCodeGenerationFromStrings. + */ ++typedef bool (*DeprecatedAllowCodeGenerationFromStringsCallback)( ++ Local context); + typedef bool (*AllowCodeGenerationFromStringsCallback)(Local context, + Local source); + +@@ -7627,6 +7629,9 @@ class V8_EXPORT Isolate { + */ + void SetAllowCodeGenerationFromStringsCallback( + AllowCodeGenerationFromStringsCallback callback); ++ V8_DEPRECATED("Use callback with source parameter.", ++ void SetAllowCodeGenerationFromStringsCallback( ++ DeprecatedAllowCodeGenerationFromStringsCallback callback)); + + /** + * Embedder over{ride|load} injection points for wasm APIs. The expectation +@@ -7787,6 +7792,15 @@ class V8_EXPORT V8 { + "Use isolate version", + void SetFatalErrorHandler(FatalErrorCallback that)); + ++ /** ++ * Set the callback to invoke to check if code generation from ++ * strings should be allowed. ++ */ ++ V8_INLINE static V8_DEPRECATED( ++ "Use isolate version", ++ void SetAllowCodeGenerationFromStringsCallback( ++ DeprecatedAllowCodeGenerationFromStringsCallback that)); ++ + /** + * Check if V8 is dead and therefore unusable. This is the case after + * fatal errors such as out-of-memory situations. +@@ -10266,6 +10280,14 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) { + #endif + } + ++void V8::SetAllowCodeGenerationFromStringsCallback( ++ DeprecatedAllowCodeGenerationFromStringsCallback callback) { ++ Isolate* isolate = Isolate::GetCurrent(); ++ isolate->SetAllowCodeGenerationFromStringsCallback( ++ reinterpret_cast(callback)); ++} ++ ++ + bool V8::IsDead() { + Isolate* isolate = Isolate::GetCurrent(); + return isolate->IsDead(); +diff --git a/src/api.cc b/src/api.cc +index d676a7426c..644ac55a69 100644 +--- a/src/api.cc ++++ b/src/api.cc +@@ -9023,6 +9023,13 @@ void Isolate::SetAllowCodeGenerationFromStringsCallback( + isolate->set_allow_code_gen_callback(callback); + } + ++void Isolate::SetAllowCodeGenerationFromStringsCallback( ++ DeprecatedAllowCodeGenerationFromStringsCallback callback) { ++ i::Isolate* isolate = reinterpret_cast(this); ++ isolate->set_allow_code_gen_callback( ++ reinterpret_cast(callback)); ++} ++ + #define CALLBACK_SETTER(ExternalName, Type, InternalName) \ + void Isolate::Set##ExternalName(Type callback) { \ + i::Isolate* isolate = reinterpret_cast(this); \