1
0
Fork 0

isEnterprise must also be defined during database upgrade

move it to a more central location
This commit is contained in:
Andreas Streichardt 2016-10-20 10:53:34 +02:00
parent c3de3ca792
commit 6d2d5ee8b3
2 changed files with 16 additions and 14 deletions

View File

@ -1304,17 +1304,6 @@ static void JS_GetCurrentResponse(
TRI_V8_TRY_CATCH_END
}
static void JS_IsEnterprise(v8::FunctionCallbackInfo<v8::Value> 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<v8::Context> 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);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -2732,6 +2732,18 @@ void TRI_V8ReloadRouting(v8::Isolate* isolate) {
TRI_V8_ASCII_STRING("reload routing"), false);
}
static void JS_IsEnterprise(v8::FunctionCallbackInfo<v8::Value> 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<v8::Context> 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
// .............................................................................