mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
031b1d9d0a
|
@ -5139,6 +5139,7 @@ static v8::Handle<v8::Value> JS_SaveVocbaseCol (v8::Arguments const& argv) {
|
|||
/// @END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if 0
|
||||
static v8::Handle<v8::Value> JS_SaveOrReplaceVocbaseCol (v8::Arguments const& argv) {
|
||||
v8::HandleScope scope;
|
||||
|
||||
|
@ -5216,6 +5217,7 @@ static v8::Handle<v8::Value> JS_SaveOrReplaceVocbaseCol (v8::Arguments const& ar
|
|||
|
||||
return scope.Close(result);
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets a parameter attribute of a collection
|
||||
|
@ -6803,7 +6805,9 @@ TRI_v8_global_t* TRI_InitV8VocBridge (v8::Handle<v8::Context> context,
|
|||
|
||||
TRI_AddMethodVocbase(rt, "replace", JS_ReplaceVocbaseCol);
|
||||
TRI_AddMethodVocbase(rt, "save", JS_SaveVocbaseCol);
|
||||
#if 0
|
||||
TRI_AddMethodVocbase(rt, "saveOrReplace", JS_SaveOrReplaceVocbaseCol);
|
||||
#endif
|
||||
TRI_AddMethodVocbase(rt, "update", JS_UpdateVocbaseCol);
|
||||
|
||||
v8g->VocbaseColTempl = v8::Persistent<v8::ObjectTemplate>::New(rt);
|
||||
|
@ -6857,7 +6861,6 @@ TRI_v8_global_t* TRI_InitV8VocBridge (v8::Handle<v8::Context> context,
|
|||
// create global variables
|
||||
// .............................................................................
|
||||
|
||||
TRI_AddGlobalVariableVocbase(context, "DATABASEPATH", v8::String::New(vocbase->_path));
|
||||
TRI_AddGlobalVariableVocbase(context, "db", TRI_WrapVocBase(vocbase));
|
||||
|
||||
// current thread number
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, nonpropdel: true */
|
||||
/*global require, db, ArangoCollection, ArangoDatabase, ArangoError, ArangoCursor,
|
||||
ShapedJson, RELOAD_AUTH, SYS_DEFINE_ACTION, SYS_EXECUTE_GLOBAL_CONTEXT_FUNCTION,
|
||||
DATABASEPATH, AHUACATL_RUN, AHUACATL_PARSE, AHUACATL_EXPLAIN */
|
||||
AHUACATL_RUN, AHUACATL_PARSE, AHUACATL_EXPLAIN */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief module "internal"
|
||||
|
@ -78,13 +78,6 @@
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief database path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal.DATABASEPATH = DATABASEPATH;
|
||||
delete DATABASEPATH;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief execute an AQL query
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
var db = internal.db;
|
||||
|
||||
// path to the VERSION file
|
||||
var versionFile = internal.DATABASEPATH + "/VERSION";
|
||||
var versionFile = internal.db._path + "/VERSION";
|
||||
|
||||
function runUpgrade (currentVersion) {
|
||||
var allTasks = [ ];
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/// @author Copyright 2011, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <BasicsC/common.h>
|
||||
#include "BasicsC/common.h"
|
||||
|
||||
#include "V8/v8-globals.h"
|
||||
|
||||
|
@ -2249,15 +2249,18 @@ static v8::Handle<v8::Value> ParseObject (yyscan_t scanner, int c) {
|
|||
else {
|
||||
// string is not empty
|
||||
ptr = TRI_UnescapeUtf8StringZ(yyextra._memoryZone, yytext + 1, yyleng - 2, &outLength);
|
||||
}
|
||||
|
||||
if (ptr == NULL) {
|
||||
yyextra._message = "out-of-memory";
|
||||
return scope.Close(v8::Undefined());
|
||||
if (ptr == NULL || outLength == 0) {
|
||||
yyextra._message = "out-of-memory";
|
||||
return scope.Close(v8::Undefined());
|
||||
}
|
||||
}
|
||||
|
||||
str = v8::String::New(ptr, outLength);
|
||||
TRI_FreeString(yyextra._memoryZone, ptr);
|
||||
|
||||
if (0 < outLength) {
|
||||
TRI_FreeString(yyextra._memoryZone, ptr);
|
||||
}
|
||||
|
||||
return scope.Close(str);
|
||||
|
||||
|
@ -2321,6 +2324,7 @@ v8::Handle<v8::Value> TRI_FromJsonString (char const* text, char** error) {
|
|||
tri_v8_lex_init(&scanner);
|
||||
yyg = (struct yyguts_t*) scanner;
|
||||
|
||||
yyextra._memoryZone = TRI_CORE_MEM_ZONE;
|
||||
buf = tri_v8__scan_string(text,scanner);
|
||||
|
||||
c = tri_v8_lex(scanner);
|
||||
|
|
|
@ -360,15 +360,18 @@ static v8::Handle<v8::Value> ParseObject (yyscan_t scanner, int c) {
|
|||
else {
|
||||
// string is not empty
|
||||
ptr = TRI_UnescapeUtf8StringZ(yyextra._memoryZone, yytext + 1, yyleng - 2, &outLength);
|
||||
}
|
||||
|
||||
if (ptr == NULL) {
|
||||
yyextra._message = "out-of-memory";
|
||||
return scope.Close(v8::Undefined());
|
||||
if (ptr == NULL || outLength == 0) {
|
||||
yyextra._message = "out-of-memory";
|
||||
return scope.Close(v8::Undefined());
|
||||
}
|
||||
}
|
||||
|
||||
str = v8::String::New(ptr, outLength);
|
||||
TRI_FreeString(yyextra._memoryZone, ptr);
|
||||
|
||||
if (0 < outLength) {
|
||||
TRI_FreeString(yyextra._memoryZone, ptr);
|
||||
}
|
||||
|
||||
return scope.Close(str);
|
||||
|
||||
|
@ -432,6 +435,7 @@ v8::Handle<v8::Value> TRI_FromJsonString (char const* text, char** error) {
|
|||
yylex_init(&scanner);
|
||||
yyg = (struct yyguts_t*) scanner;
|
||||
|
||||
yyextra._memoryZone = TRI_CORE_MEM_ZONE;
|
||||
buf = yy_scan_string(text, scanner);
|
||||
|
||||
c = yylex(scanner);
|
||||
|
|
Loading…
Reference in New Issue