From 6d2d5ee8b3a3433bcc99f0b0524ecbd4e6531ebb Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Thu, 20 Oct 2016 10:53:34 +0200 Subject: [PATCH] isEnterprise must also be defined during database upgrade move it to a more central location --- arangod/V8Server/v8-actions.cpp | 14 -------------- arangod/V8Server/v8-vocbase.cpp | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/arangod/V8Server/v8-actions.cpp b/arangod/V8Server/v8-actions.cpp index 20aaf14896..502bb1dfe0 100644 --- a/arangod/V8Server/v8-actions.cpp +++ b/arangod/V8Server/v8-actions.cpp @@ -1304,17 +1304,6 @@ static void JS_GetCurrentResponse( TRI_V8_TRY_CATCH_END } -static void JS_IsEnterprise(v8::FunctionCallbackInfo const& args) { - TRI_V8_TRY_CATCH_BEGIN(isolate); - v8::HandleScope scope(isolate); -#ifndef USE_ENTERPRISE - TRI_V8_RETURN(v8::False(isolate)); -#else - TRI_V8_RETURN(v8::True(isolate)); -#endif - TRI_V8_TRY_CATCH_END -} - //////////////////////////////////////////////////////////////////////////////// /// @brief stores the V8 actions function inside the global variable //////////////////////////////////////////////////////////////////////////////// @@ -1345,9 +1334,6 @@ void TRI_InitV8Actions(v8::Isolate* isolate, v8::Handle context) { TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("SYS_REQUEST_PARTS"), JS_RequestParts, true); - TRI_AddGlobalFunctionVocbase(isolate, context, - TRI_V8_ASCII_STRING("SYS_IS_ENTERPRISE"), - JS_IsEnterprise); } //////////////////////////////////////////////////////////////////////////////// diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 344e3cb3e5..dfd3e45ff6 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -2732,6 +2732,18 @@ void TRI_V8ReloadRouting(v8::Isolate* isolate) { TRI_V8_ASCII_STRING("reload routing"), false); } + +static void JS_IsEnterprise(v8::FunctionCallbackInfo const& args) { + TRI_V8_TRY_CATCH_BEGIN(isolate); + v8::HandleScope scope(isolate); +#ifndef USE_ENTERPRISE + TRI_V8_RETURN(v8::False(isolate)); +#else + TRI_V8_RETURN(v8::True(isolate)); +#endif + TRI_V8_TRY_CATCH_END +} + //////////////////////////////////////////////////////////////////////////////// /// @brief creates a TRI_vocbase_t global context //////////////////////////////////////////////////////////////////////////////// @@ -2919,6 +2931,10 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle context, TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("TRUSTED_PROXIES"), JS_TrustedProxies, true); + + TRI_AddGlobalFunctionVocbase(isolate, context, + TRI_V8_ASCII_STRING("SYS_IS_ENTERPRISE"), + JS_IsEnterprise); // ............................................................................. // create global variables // .............................................................................