Skip to content

Commit

Permalink
before merging master
Browse files Browse the repository at this point in the history
  • Loading branch information
xdenser committed Oct 15, 2011
1 parent 45c5a67 commit a17dcba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
11 changes: 9 additions & 2 deletions src/fb-bindings-connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,22 @@ int Connection::EIO_After_Query(eio_req *req)
argv[1] = Local<Value>::New(scope.Close(js_result));
argv[0] = Local<Value>::New(Null());
}


{
TryCatch try_catch;


q_req->callback->Call(Context::GetCurrent()->Global(), 2, argv);


printf("After cb\n");

if (try_catch.HasCaught()) {
node::FatalException(try_catch);
}
}

printf("After cb 1\n");

q_req->callback.Dispose();
q_req->conn->stop_async();
q_req->conn->Unref();
Expand Down
2 changes: 2 additions & 0 deletions tests/def/test-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ exports.AsyncQueryWithError = function (test) {
var conn = fb_binding.createConnection();
conn.connect(cfg.db, cfg.user, cfg.password, cfg.role, function(){
test.ok(conn.connected,"Connected to database");
console.log('before err');
conn.query("select * from non_existent_table", function(err,res){
console.log('err');
test.ok(err,"There is error");
test.ok(!res,"No result");
conn.disconnect();
Expand Down
16 changes: 8 additions & 8 deletions tests/def/test-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ function WaitForFinish(finished,clean,timeout){
timedout = true;
},timeout);

/*

process.nextTick(function loop(){
if(finished.call()||timedout){
clearTimeout(tid);
clean.call();
}
else process.nextTick(loop);
});
*/
/*
setTimeout(function loop(){
if(finished.call()||timedout){
clearTimeout(tid);
clean.call();
}
else setTimeout(loop,0);
},0);

*/
}

function CleanUp(){
Expand Down Expand Up @@ -142,13 +142,13 @@ exports.oneEventBetween = function(test) {

conn.addFBevent(eName);

//setTimeout(function(){
setTimeout(function(){
GenEvent(eName);
var z = 0;
for(var i=0; i< 1000000; i++) z++;
conn.addFBevent("strange");
//},0);

// for(var i=0; i< 1000000; i++) z++;

},0);
conn.addFBevent("strange");

// Wait 2 sec for event
WaitForFinish(function(){ return finished; },
Expand Down

0 comments on commit a17dcba

Please sign in to comment.