From 0151569fd8ce287d675dafd3dac3eeecb59323b3 Mon Sep 17 00:00:00 2001 From: Benjamin Byholm Date: Sat, 24 Aug 2024 05:42:28 +0300 Subject: [PATCH] remove Isolate from ScriptOrigin --- nan_scriptorigin.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/nan_scriptorigin.h b/nan_scriptorigin.h index ce79cdf8..2d1b3c2a 100644 --- a/nan_scriptorigin.h +++ b/nan_scriptorigin.h @@ -11,7 +11,27 @@ class ScriptOrigin : public v8::ScriptOrigin { public: -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 9 || \ +#if defined(V8_MAJOR_VERSION) && \ + (V8_MAJOR_VERSION > 12 || \ + (V8_MAJOR_VERSION == 12 && \ + (defined(V8_MINOR_VERSION) && \ + (V8_MINOR_VERSION > 6 || \ + (V8_MINOR_VERSION == 6 && defined(V8_BUILD_NUMBER) && \ + V8_BUILD_NUMBER >= 175))))) + explicit ScriptOrigin(v8::Local name) : + v8::ScriptOrigin(name) {} + + ScriptOrigin(v8::Local name + , v8::Local line) : + v8::ScriptOrigin(name , To(line).FromMaybe(0)) {} + + ScriptOrigin(v8::Local name + , v8::Local line + , v8::Local column) : + v8::ScriptOrigin(name + , To(line).FromMaybe(0) + , To(column).FromMaybe(0)) {} +#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 9 || \ (V8_MAJOR_VERSION == 9 && (defined(V8_MINOR_VERSION) && (V8_MINOR_VERSION > 0\ || (V8_MINOR_VERSION == 0 && defined(V8_BUILD_NUMBER) \ && V8_BUILD_NUMBER >= 1)))))