From 76069cc7989da3e637fdb62d6e7756577f46d0c1 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 17 Feb 2017 11:47:30 +0100 Subject: [PATCH] Use 'FromMaybe' variant of GetFunction()->NewInstance() to avoid deprecation warning Signed-off-by: Tim Janik --- v8pp/class.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v8pp/class.hpp b/v8pp/class.hpp index 24c57158..249396d4 100644 --- a/v8pp/class.hpp +++ b/v8pp/class.hpp @@ -370,7 +370,8 @@ class class_singleton : public class_info v8::EscapableHandleScope scope(isolate_); v8::Local obj = class_function_template() - ->GetFunction()->NewInstance(); + ->GetFunction()->NewInstance (v8::Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(v8::Local()); obj->SetAlignedPointerInInternalField(0, object); obj->SetAlignedPointerInInternalField(1, this);