1
0
Fork 0

load monkeypatches on all occasions

This commit is contained in:
Jan Steemann 2012-11-20 16:50:15 +01:00
parent 9a306f74f4
commit a2b404123a
8 changed files with 23 additions and 30 deletions

View File

@ -11,6 +11,7 @@
JAVASCRIPT_HEADER = \
js/common/bootstrap/js-errors.h \
js/common/bootstrap/js-modules.h \
js/common/bootstrap/js-monkeypatches.h \
js/common/bootstrap/js-print.h \
js/client/js-client.h \
js/server/js-server.h \

View File

@ -656,7 +656,7 @@ int ArangoServer::executeConsole (OperationMode::server_operation_mode_e mode) {
context->_context->Global()->Set(v8::String::New("DATABASEPATH"), v8::String::New(_databasePath.c_str()), v8::ReadOnly);
context->_context->Global()->Set(v8::String::New("VALGRIND"), _runningOnValgrind ? v8::True() : v8::False(), v8::ReadOnly);
context->_context->Global()->Set(TRI_V8_SYMBOL("VERSION"), v8::String::New(TRIAGENS_VERSION), v8::ReadOnly);
context->_context->Global()->Set(v8::String::New("VERSION"), v8::String::New(TRIAGENS_VERSION), v8::ReadOnly);
ok = true;

View File

@ -426,7 +426,7 @@ namespace triagens {
}
}
if (docs.size() == 0) {
if (count == 0) {
// barrier not needed, kill it
TRI_FreeBarrier(*barrier);
}

View File

@ -44,6 +44,7 @@ using namespace triagens::arango;
using namespace std;
#include "js/common/bootstrap/js-modules.h"
#include "js/common/bootstrap/js-monkeypatches.h"
#include "js/common/bootstrap/js-print.h"
#include "js/common/bootstrap/js-errors.h"
#include "js/server/js-ahuacatl.h"
@ -530,6 +531,7 @@ bool ApplicationV8::prepare () {
LOGGER_INFO << "using built-in JavaScript startup files";
_startupLoader.defineScript("common/bootstrap/modules.js", JS_common_bootstrap_modules);
_startupLoader.defineScript("common/bootstrap/monkeypatches.js", JS_common_bootstrap_monkeypatches);
_startupLoader.defineScript("common/bootstrap/print.js", JS_common_bootstrap_print);
_startupLoader.defineScript("common/bootstrap/errors.js", JS_common_bootstrap_errors);
_startupLoader.defineScript("server/ahuacatl.js", JS_server_ahuacatl);
@ -633,6 +635,7 @@ void ApplicationV8::stop () {
bool ApplicationV8::prepareV8Instance (const size_t i) {
static char const* files[] = { "common/bootstrap/modules.js",
"common/bootstrap/monkeypatches.js",
"common/bootstrap/print.js",
"common/bootstrap/errors.js",
"server/ahuacatl.js",

View File

@ -64,6 +64,7 @@ using namespace triagens::arango;
#include "js/common/bootstrap/js-print.h"
#include "js/common/bootstrap/js-modules.h"
#include "js/common/bootstrap/js-monkeypatches.h"
#include "js/common/bootstrap/js-errors.h"
#include "js/client/js-client.h"
@ -1222,6 +1223,7 @@ int main (int argc, char* argv[]) {
// load java script from js/bootstrap/*.h files
if (StartupPath.empty()) {
StartupLoader.defineScript("common/bootstrap/modules.js", JS_common_bootstrap_modules);
StartupLoader.defineScript("common/bootstrap/monkeypatches.js", JS_common_bootstrap_monkeypatches);
StartupLoader.defineScript("common/bootstrap/print.js", JS_common_bootstrap_print);
StartupLoader.defineScript("common/bootstrap/errors.js", JS_common_bootstrap_errors);
StartupLoader.defineScript("client/client.js", JS_client_client);
@ -1237,6 +1239,7 @@ int main (int argc, char* argv[]) {
// load all init files
char const* files[] = {
"common/bootstrap/modules.js",
"common/bootstrap/monkeypatches.js",
"common/bootstrap/print.js",
"common/bootstrap/errors.js",
"client/client.js"

View File

@ -43,8 +43,6 @@ var internal = require("internal"),
findOrCreateCollectionByName,
findOrCreateEdgeCollectionByName;
require("monkeypatches");
////////////////////////////////////////////////////////////////////////////////
/// @brief find or create a collection by name
////////////////////////////////////////////////////////////////////////////////
@ -638,6 +636,10 @@ Vertex.prototype.commonNeighborsWith = function (target_vertex, options) {
return neighbor.id;
};
if (typeof(target_vertex) != 'object') {
throw "<target_vertex> must be a vertex object";
}
neighbor_set_one = this.getNeighbors(options).map(id_only);
neighbor_set_two = target_vertex.getNeighbors(options).map(id_only);
@ -701,6 +703,9 @@ Vertex.prototype.commonPropertiesWith = function (other_vertex, options) {
////////////////////////////////////////////////////////////////////////////////
Vertex.prototype.pathTo = function (target_vertex, options) {
if (typeof(target_vertex) != 'object') {
throw "<target_vertex> must be an object";
}
var predecessors = target_vertex.determinePredecessors(this, options || {});
return (predecessors ? target_vertex.pathesForTree(predecessors) : []);
};
@ -857,8 +862,13 @@ Vertex.prototype.pathesForTree = function (tree, path_to_here) {
Vertex.prototype.getNeighbors = function (options) {
var current_vertex,
target_array = [],
addNeighborToList,
direction = options.direction || 'both',
addNeighborToList;
if (! options) {
options = { };
}
var direction = options.direction || 'both',
labels = options.labels,
weight = options.weight,
weight_function = options.weight_function,

View File

@ -133,30 +133,6 @@
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- Module "monkeypatches"
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ModuleMonkeypatches
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief monkeypatches module
////////////////////////////////////////////////////////////////////////////////
try {
require("monkeypatches");
}
catch (err) {
console.error("while loading 'monkeypatches' module: %s", err);
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- ShapedJson
// -----------------------------------------------------------------------------