mirror of https://gitee.com/bigwinds/arangodb
fixed tests
This commit is contained in:
parent
0044d7d1b0
commit
26c3b0174f
|
@ -49,15 +49,15 @@ using namespace triagens::arango;
|
|||
RestActionHandler::RestActionHandler (HttpRequest* request,
|
||||
action_options_t* data)
|
||||
: RestVocbaseBaseHandler(request),
|
||||
_action(0),
|
||||
_action(nullptr),
|
||||
_queue(),
|
||||
_dataLock(),
|
||||
_data(0) {
|
||||
_data(nullptr) {
|
||||
|
||||
_action = TRI_LookupActionVocBase(request);
|
||||
|
||||
// use the queue from options if an action is known
|
||||
if (_action != 0) {
|
||||
if (_action != nullptr) {
|
||||
_queue = data->_queue;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ RestActionHandler::RestActionHandler (HttpRequest* request,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool RestActionHandler::isDirect () {
|
||||
return _action == 0;
|
||||
return _action == nullptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -102,7 +102,7 @@ HttpHandler::status_t RestActionHandler::execute () {
|
|||
}
|
||||
|
||||
// need an action
|
||||
if (_action == 0) {
|
||||
if (_action == nullptr) {
|
||||
generateNotImplemented(_request->requestPath());
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
#include "HttpServer/ApplicationEndpointServer.h"
|
||||
#include "V8/v8-conv.h"
|
||||
#include "V8/v8-execution.h"
|
||||
#include "V8/v8-utils.h"
|
||||
#include "Wal/LogfileManager.h"
|
||||
|
||||
|
@ -1067,22 +1066,23 @@ static v8::Handle<v8::Value> JS_ExecuteAqlJson (v8::Arguments const& argv) {
|
|||
return scope.Close(result);
|
||||
}
|
||||
|
||||
TRI_json_t* extra = nullptr;
|
||||
if (queryResult.warnings != nullptr && queryResult.stats != nullptr) {
|
||||
extra = TRI_MergeJson(TRI_UNKNOWN_MEM_ZONE, queryResult.stats, queryResult.warnings, true);
|
||||
|
||||
if (extra == nullptr) {
|
||||
TRI_V8_EXCEPTION_MEMORY(scope);
|
||||
}
|
||||
TRI_json_t* extra = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
|
||||
if (extra == nullptr) {
|
||||
TRI_V8_EXCEPTION_MEMORY(scope);
|
||||
}
|
||||
else if (queryResult.warnings != nullptr) {
|
||||
extra = queryResult.warnings;
|
||||
|
||||
if (queryResult.warnings != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "warnings", queryResult.warnings);
|
||||
queryResult.warnings = nullptr;
|
||||
}
|
||||
else if (queryResult.stats != nullptr) {
|
||||
extra = queryResult.stats;
|
||||
if (queryResult.stats != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "stats", queryResult.stats);
|
||||
queryResult.stats = nullptr;
|
||||
}
|
||||
if (queryResult.profile != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "profile", queryResult.profile);
|
||||
queryResult.profile = nullptr;
|
||||
}
|
||||
|
||||
TRI_general_cursor_result_t* cursorResult = TRI_CreateResultGeneralCursor(queryResult.json);
|
||||
|
||||
|
@ -1202,20 +1202,13 @@ static v8::Handle<v8::Value> JS_ExecuteAql (v8::Arguments const& argv) {
|
|||
|
||||
auto queryResult = query.execute(static_cast<triagens::aql::QueryRegistry*>(v8g->_queryRegistry));
|
||||
|
||||
/* TODO: check if we need this here!
|
||||
if (tryCatch.HasCaught()) {
|
||||
if (tryCatch.CanContinue()) {
|
||||
return scope.Close(v8::ThrowException(tryCatch.Exception()));
|
||||
}
|
||||
else {
|
||||
if (queryResult.code != TRI_ERROR_NO_ERROR) {
|
||||
if (queryResult.code == TRI_ERROR_REQUEST_CANCELED) {
|
||||
TRI_v8_global_t* v8g = static_cast<TRI_v8_global_t*>(v8::Isolate::GetCurrent()->GetData());
|
||||
|
||||
v8g->_canceled = true;
|
||||
return scope.Close(TRI_CreateErrorObject(__FILE__, __LINE__, TRI_ERROR_REQUEST_CANCELED));
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (queryResult.code != TRI_ERROR_NO_ERROR) {
|
||||
|
||||
TRI_V8_EXCEPTION_FULL(scope, queryResult.code, queryResult.details);
|
||||
}
|
||||
|
||||
|
@ -1240,22 +1233,23 @@ static v8::Handle<v8::Value> JS_ExecuteAql (v8::Arguments const& argv) {
|
|||
return scope.Close(result);
|
||||
}
|
||||
|
||||
TRI_json_t* extra = nullptr;
|
||||
if (queryResult.warnings != nullptr && queryResult.stats != nullptr) {
|
||||
extra = TRI_MergeJson(TRI_UNKNOWN_MEM_ZONE, queryResult.stats, queryResult.warnings, true);
|
||||
|
||||
if (extra == nullptr) {
|
||||
TRI_V8_EXCEPTION_MEMORY(scope);
|
||||
}
|
||||
TRI_json_t* extra = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
|
||||
if (extra == nullptr) {
|
||||
TRI_V8_EXCEPTION_MEMORY(scope);
|
||||
}
|
||||
else if (queryResult.warnings != nullptr) {
|
||||
extra = queryResult.warnings;
|
||||
|
||||
if (queryResult.warnings != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "warnings", queryResult.warnings);
|
||||
queryResult.warnings = nullptr;
|
||||
}
|
||||
else if (queryResult.stats != nullptr) {
|
||||
extra = queryResult.stats;
|
||||
if (queryResult.stats != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "stats", queryResult.stats);
|
||||
queryResult.stats = nullptr;
|
||||
}
|
||||
if (queryResult.profile != nullptr) {
|
||||
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, extra, "profile", queryResult.profile);
|
||||
queryResult.profile = nullptr;
|
||||
}
|
||||
|
||||
TRI_general_cursor_result_t* cursorResult = TRI_CreateResultGeneralCursor(queryResult.json);
|
||||
|
||||
|
|
|
@ -245,8 +245,8 @@ var internal = require("internal");
|
|||
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
|
||||
///
|
||||
/// assert(response.code === 201);
|
||||
/// assert(JSON.parse(response.body).extra.operations.executed === 2);
|
||||
/// assert(JSON.parse(response.body).extra.operations.ignored === 0);
|
||||
/// assert(JSON.parse(response.body).extra.stats.writesExecuted === 2);
|
||||
/// assert(JSON.parse(response.body).extra.stats.writesIgnored === 0);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
|
@ -268,8 +268,8 @@ var internal = require("internal");
|
|||
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
|
||||
///
|
||||
/// assert(response.code === 201);
|
||||
/// assert(JSON.parse(response.body).extra.operations.executed === 0);
|
||||
/// assert(JSON.parse(response.body).extra.operations.ignored === 1);
|
||||
/// assert(JSON.parse(response.body).extra.stats.writesExecuted === 0);
|
||||
/// assert(JSON.parse(response.body).extra.stats.writesIgnored === 1);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
|
|
|
@ -50,12 +50,21 @@ var SimpleQueryWithin;
|
|||
/// @brief array query
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function GeneralArrayCursor (documents, skip, limit, extra) {
|
||||
function GeneralArrayCursor (documents, skip, limit, data) {
|
||||
this._documents = documents;
|
||||
this._countTotal = documents.length;
|
||||
this._skip = skip;
|
||||
this._limit = limit;
|
||||
this._extra = extra;
|
||||
this._extra = { };
|
||||
|
||||
var self = this;
|
||||
if (data !== null && data !== undefined && typeof data === 'object') {
|
||||
[ 'stats', 'warnings', 'profile' ].forEach(function(d) {
|
||||
if (data.hasOwnProperty(d)) {
|
||||
self._extra[d] = data[d];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.execute();
|
||||
}
|
||||
|
|
|
@ -49,12 +49,21 @@ var SimpleQueryWithin;
|
|||
/// @brief array query
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function GeneralArrayCursor (documents, skip, limit, extra) {
|
||||
function GeneralArrayCursor (documents, skip, limit, data) {
|
||||
this._documents = documents;
|
||||
this._countTotal = documents.length;
|
||||
this._skip = skip;
|
||||
this._limit = limit;
|
||||
this._extra = extra;
|
||||
this._extra = { };
|
||||
|
||||
var self = this;
|
||||
if (data !== null && data !== undefined && typeof data === 'object') {
|
||||
[ 'stats', 'warnings', 'profile' ].forEach(function(d) {
|
||||
if (data.hasOwnProperty(d)) {
|
||||
self._extra[d] = data[d];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.execute();
|
||||
}
|
||||
|
|
|
@ -1719,11 +1719,11 @@ function resultCursor (req, res, cursor, code, options) {
|
|||
cursor.dispose();
|
||||
}
|
||||
}
|
||||
else if (cursor.hasOwnProperty('docs')) {
|
||||
else if (cursor.hasOwnProperty('json')) {
|
||||
// cursor is a regular JS object (performance optimisation)
|
||||
hasCount = ((options && options.countRequested) ? true : false);
|
||||
count = cursor.docs.length;
|
||||
rows = cursor.docs;
|
||||
count = cursor.json.length;
|
||||
rows = cursor.json;
|
||||
extra = cursor.extra;
|
||||
hasNext = false;
|
||||
cursorId = null;
|
||||
|
|
|
@ -75,7 +75,7 @@ ArangoStatement.prototype.execute = function () {
|
|||
}
|
||||
var result = AQL_EXECUTE(this._query, this._bindVars, options);
|
||||
|
||||
return new GeneralArrayCursor(result.json, 0, null, result.extra);
|
||||
return new GeneralArrayCursor(result.json, 0, null, result);
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*jshint strict: false, maxlen: 500 */
|
||||
/*global require, assertEqual, assertTrue, AQL_EXPLAIN, AQL_EXECUTE */
|
||||
/*global require, assertEqual, assertTrue, assertNotEqual, AQL_EXPLAIN, AQL_EXECUTE */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief tests for optimizer rules
|
||||
|
|
|
@ -752,8 +752,8 @@ function transactionCollectionsSuite () {
|
|||
write: [ cn1 ]
|
||||
},
|
||||
action : function () {
|
||||
var ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn1", { "@cn1" : cn1 }).getExtra().operations;
|
||||
assertEqual(10, ops.executed);
|
||||
var ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn1", { "@cn1" : cn1 }).getExtra().stats;
|
||||
assertEqual(10, ops.writesExecuted);
|
||||
assertEqual(0, c1.count());
|
||||
return true;
|
||||
}
|
||||
|
@ -780,8 +780,8 @@ function transactionCollectionsSuite () {
|
|||
write: [ cn2 ]
|
||||
},
|
||||
action : function () {
|
||||
var ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn2", { "@cn1" : cn1, "@cn2" : cn2 }).getExtra().operations;
|
||||
assertEqual(10, ops.executed);
|
||||
var ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn2", { "@cn1" : cn1, "@cn2" : cn2 }).getExtra().stats;
|
||||
assertEqual(10, ops.writesExecuted);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -844,12 +844,12 @@ function transactionCollectionsSuite () {
|
|||
},
|
||||
action : function () {
|
||||
var ops;
|
||||
ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn1", { "@cn1" : cn1 }).getExtra().operations;
|
||||
assertEqual(10, ops.executed);
|
||||
ops = db._query("FOR i IN @@cn1 REMOVE i._key IN @@cn1", { "@cn1" : cn1 }).getExtra().stats;
|
||||
assertEqual(10, ops.writesExecuted);
|
||||
assertEqual(0, c1.count());
|
||||
|
||||
ops = db._query("FOR i IN @@cn2 REMOVE i._key IN @@cn2", { "@cn2" : cn2 }).getExtra().operations;
|
||||
assertEqual(10, ops.executed);
|
||||
ops = db._query("FOR i IN @@cn2 REMOVE i._key IN @@cn2", { "@cn2" : cn2 }).getExtra().stats;
|
||||
assertEqual(10, ops.writesExecuted);
|
||||
assertEqual(0, c2.count());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,6 @@ add_library(
|
|||
V8/V8StringConverter.cpp
|
||||
V8/v8-buffer.cpp
|
||||
V8/v8-conv.cpp
|
||||
V8/v8-execution.cpp
|
||||
V8/v8-globals.cpp
|
||||
V8/v8-json.cpp
|
||||
V8/v8-shell.cpp
|
||||
|
|
|
@ -181,7 +181,6 @@ lib_libarango_v8_a_SOURCES = \
|
|||
lib/V8/V8StringConverter.cpp \
|
||||
lib/V8/v8-buffer.cpp \
|
||||
lib/V8/v8-conv.cpp \
|
||||
lib/V8/v8-execution.cpp \
|
||||
lib/V8/v8-globals.cpp \
|
||||
lib/V8/v8-json.cpp \
|
||||
lib/V8/v8-shell.cpp \
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief V8 utility functions
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2014 ArangoDB GmbH, Cologne, Germany
|
||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany
|
||||
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "v8-execution.h"
|
||||
|
||||
#include "V8/v8-conv.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EXECUTION CONTEXT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief creates a new execution context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_js_exec_context_t* TRI_CreateExecutionContext (char const* script,
|
||||
size_t length) {
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
TRI_js_exec_context_t* ctx = new TRI_js_exec_context_t;
|
||||
ctx->_error = TRI_ERROR_NO_ERROR;
|
||||
|
||||
// execute script inside the context
|
||||
v8::Handle<v8::Script> compiled = v8::Script::Compile(v8::String::New(script, (int) length),
|
||||
v8::String::New("--script--"));
|
||||
|
||||
// compilation failed, return
|
||||
if (compiled.IsEmpty()) {
|
||||
ctx->_error = TRI_ERROR_INTERNAL;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
// compute the function
|
||||
v8::TryCatch tryCatch;
|
||||
v8::Handle<v8::Value> val = compiled->Run();
|
||||
|
||||
if (tryCatch.HasCaught()) {
|
||||
if (tryCatch.CanContinue()) {
|
||||
ctx->_error = TRI_ERROR_INTERNAL;
|
||||
}
|
||||
else {
|
||||
TRI_v8_global_t* v8g = static_cast<TRI_v8_global_t*>(v8::Isolate::GetCurrent()->GetData());
|
||||
|
||||
v8g->_canceled = true;
|
||||
ctx->_error = TRI_ERROR_REQUEST_CANCELED;
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
if (val.IsEmpty()) {
|
||||
ctx->_error = TRI_ERROR_INTERNAL;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
ctx->_func = v8::Persistent<v8::Function>::New(isolate, v8::Handle<v8::Function>::Cast(val));
|
||||
ctx->_arguments = v8::Persistent<v8::Object>::New(isolate, v8::Object::New());
|
||||
ctx->_isolate = isolate;
|
||||
ctx->_error = TRI_ERROR_NO_ERROR;
|
||||
|
||||
// return the handle
|
||||
return ctx;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief frees an new execution context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_FreeExecutionContext (TRI_js_exec_context_t* ctx) {
|
||||
if (ctx->_error == TRI_ERROR_NO_ERROR) {
|
||||
ctx->_func.Dispose(ctx->_isolate);
|
||||
ctx->_func.Clear();
|
||||
|
||||
ctx->_arguments.Dispose(ctx->_isolate);
|
||||
ctx->_arguments.Clear();
|
||||
}
|
||||
|
||||
delete ctx;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief executes a result context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_json_t* TRI_ExecuteResultContext (TRI_js_exec_context_t* ctx) {
|
||||
TRI_ASSERT(ctx->_error == TRI_ERROR_NO_ERROR);
|
||||
|
||||
// convert back into a handle
|
||||
v8::Persistent<v8::Function> func = ctx->_func;
|
||||
|
||||
v8::TryCatch tryCatch;
|
||||
|
||||
// and execute the function
|
||||
v8::Handle<v8::Value> args[] = { ctx->_arguments };
|
||||
v8::Handle<v8::Value> result = func->Call(func, 1, args);
|
||||
|
||||
if (tryCatch.HasCaught()) {
|
||||
if (tryCatch.CanContinue()) {
|
||||
ctx->_error = TRI_ERROR_INTERNAL;
|
||||
}
|
||||
else {
|
||||
TRI_v8_global_t* v8g = static_cast<TRI_v8_global_t*>(v8::Isolate::GetCurrent()->GetData());
|
||||
|
||||
v8g->_canceled = true;
|
||||
ctx->_error = TRI_ERROR_REQUEST_CANCELED;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (result.IsEmpty()) {
|
||||
ctx->_error = TRI_ERROR_INTERNAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return TRI_ObjectToJson(result);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
// End:
|
|
@ -1,94 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief V8 execution context
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2014 ArangoDB GmbH, Cologne, Germany
|
||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany
|
||||
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef ARANGODB_V8_V8__EXECUTION_H
|
||||
#define ARANGODB_V8_V8__EXECUTION_H 1
|
||||
|
||||
#include "Basics/Common.h"
|
||||
|
||||
#include <v8.h>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- forward declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
struct TRI_json_t;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief execution context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_js_exec_context_s {
|
||||
v8::Isolate* _isolate;
|
||||
v8::Persistent<v8::Function> _func;
|
||||
v8::Persistent<v8::Object> _arguments;
|
||||
int _error;
|
||||
}
|
||||
TRI_js_exec_context_t;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief creates a new execution context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_js_exec_context_t* TRI_CreateExecutionContext (const char*, size_t);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief frees an new execution context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_FreeExecutionContext (TRI_js_exec_context_t*);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief executes a result context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct TRI_json_t* TRI_ExecuteResultContext (TRI_js_exec_context_t* context);
|
||||
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
// End:
|
Loading…
Reference in New Issue