Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rethinkdbdash

Package Overview
Dependencies
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkdbdash - npm Package Compare versions

Comparing version 1.11.4 to 1.11.5

test/backtrace.js

35

lib/error.js

@@ -40,2 +40,3 @@ var helper = require(__dirname+"/helper.js");

frames = frames.backtrace.frames;
if (frames) this.frames = frames.slice(0);
//this.frames = JSON.stringify(frames, null, 2);

@@ -267,3 +268,3 @@

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
// +1 for index because it's like if there was a r.db(...) before .table(...)

@@ -306,3 +307,3 @@ backtrace = generateBacktrace(term.args[i], i+1, term, frames, options)

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 0)) {
if ((currentFrame != null) && (currentFrame.pos === 0)) {
backtrace = generateBacktrace(term.args[0], 0, term, frames, options)

@@ -318,3 +319,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
backtrace = generateBacktrace(term.args[1], 1, term, frames, options)

@@ -354,3 +355,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === i)) {
if ((currentFrame != null) && (currentFrame.pos === i)) {
backtrace = generateBacktrace(term.args[i], i, term, frames, options);

@@ -442,3 +443,3 @@ }

if ((term.args[0].args.length === 1) && (helper.hasImplicit(term.args[1]))) {
if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
backtrace = generateBacktrace(term.args[1], 1, term, frames, options);

@@ -468,3 +469,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
backtrace = generateBacktrace(term.args[1], 1, term, frames, options);

@@ -515,3 +516,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
backtrace = generateBacktrace(term.args[1], 0, term, frames, options);

@@ -527,3 +528,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 0)) {
if ((currentFrame != null) && (currentFrame.pos === 0)) {
backtrace = generateBacktrace(term.args[0], 0, term, frames, options);

@@ -568,3 +569,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 0)) {
if ((currentFrame != null) && (currentFrame.pos === 0)) {
backtrace = generateBacktrace(term.args[0], 0, term, frames, options);

@@ -580,3 +581,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 1)) {
if ((currentFrame != null) && (currentFrame.pos === 1)) {
backtrace = generateBacktrace(term.args[1], 1, term, frames, {indent: options.indent, noBracket: true});

@@ -590,3 +591,5 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 2)) {
carify(result, ", ", underline);
//TODO Could parse the object to rebuild r.count/r.avg/r.sum... sub 1.12 discard these...
if ((currentFrame != null) && (currentFrame.pos === 2)) {
backtrace = generateBacktrace(term.args[2], 2, term, frames, options);

@@ -597,2 +600,4 @@ }

}
result.str += backtrace.str;
result.car += backtrace.car;

@@ -664,3 +669,3 @@ carify(result, ")", underline);

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === 0)) {
if ((currentFrame != null) && (currentFrame.pos === 0)) {
backtrace = generateBacktrace(term.args[0], 0, term, frames, options);

@@ -690,3 +695,3 @@ }

}
if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === i)) {
if ((currentFrame != null) && (currentFrame.pos === i)) {
backtrace = generateBacktrace(term.args[i], i, term, frames, options);

@@ -735,3 +740,3 @@ }

if ((currentFrame != null) && (currentFrame.pos != null) && (currentFrame.pos.low === i)) {
if ((currentFrame != null) && (currentFrame.pos === i)) {
backtrace = generateBacktrace(term.args[i], i, term, frames, options)

@@ -785,2 +790,2 @@ }

}
module.exports.generateBacktrace = generateBacktrace;

@@ -59,16 +59,28 @@ var Promise = require('bluebird');

if (self._line.getLength() > 0) {
clearTimeout(connection.timeout);
var resolve = self._line.shift();
resolve(connection);
if (self._draining) {
self._numConnections--;
connection.close();
if (self.getLength() === 0) {
self._draining.resolve();
}
}
else {
self._pool.push(connection);
if (self._line.getLength() > 0) {
clearTimeout(connection.timeout);
var timeoutCb = function() {
if (self._pool.get(0) === connection) {
if (self._pool.getLength() > self.options.min) {
self._pool.shift();
self._numConnections--;
var resolve = self._line.shift();
resolve(connection);
}
else {
self._pool.push(connection);
var timeoutCb = function() {
if (self._pool.get(0) === connection) {
if (self._pool.getLength() > self.options.min) {
self._pool.shift();
self._numConnections--;
}
else {
connection.timeout = setTimeout(timeoutCb, self.options.timeoutGb);
}
}

@@ -79,8 +91,4 @@ else {

}
else {
connection.timeout = setTimeout(timeoutCb, self.options.timeoutGb);
}
connection.timeout = setTimeout(timeoutCb, self.options.timeoutGb);
}
connection.timeout = setTimeout(timeoutCb, self.options.timeoutGb);
}

@@ -93,2 +101,4 @@ };

self._r.connect(self.options.connection).then(function(connection) {
connection.on('error', function(e) {

@@ -111,3 +121,2 @@ // We are going to close connection, but we don't want another process to use it before

}).error(function(e) {
console.log(e.message);
// We failed to close this connection, but we removed it from the pool... so err, let's just ignore that.

@@ -144,12 +153,3 @@ self._numConnections--;

connection.on('release', function() {
if (this._draining) {
self._numConnections--;
this.close();
if (self.getLength() === 0) {
resolve();
}
}
else {
if (this._isOpen()) self.putConnection(this);
}
if (this._isOpen()) self.putConnection(this);
});

@@ -194,3 +194,3 @@ self.putConnection(connection);

var self = this;
self._draining = new Promise(function(resolve, reject) {
var p = new Promise(function(resolve, reject) {
var connection = self._pool.pop();

@@ -207,4 +207,10 @@ while(connection) {

}
else {
self._draining = {
resolve: resolve,
reject: reject
}
}
});
return this._draining;
return p;
}

@@ -211,0 +217,0 @@

{
"name": "rethinkdbdash",
"version": "1.11.4",
"version": "1.11.5",
"description": "A Node.js driver for RethinkDB with promises and a connection pool",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -265,2 +265,2 @@ rethinkdbdash

============
- Add better tests for backtraces
- Pre-serialize a query (not sure if possible though)

@@ -25,1 +25,12 @@ var config = require(__dirname+'/config.js');

})
It("toString should work", function* (done) {
try {
assert.equal(r.expr(1).add(2).toString(), "r.expr(1).add(2)");
assert.equal(r.expr(1).toString(), "r.expr(1)");
done();
}
catch(e) {
done(e);
}
})

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc