Permalink
Browse files

Merge pull request #2 from nicoo/master

Fix variable scope in ElasticSearchCall exec method.
  • Loading branch information...
2 parents 44be96e + 2b43c51 commit e0894af9288b91877781723a9cc913282bff16e2 @phillro phillro committed Aug 25, 2011
Showing with 6 additions and 12 deletions.
  1. +6 −12 lib/elasticsearchclient/calls/elasticSearchCall.js
View
18 lib/elasticsearchclient/calls/elasticSearchCall.js
@@ -1,6 +1,7 @@
var events = require('events'),
-http = require('http');
-https = require('https');
+http = require('http'),
+https = require('https'),
+util = require('util');
module.exports = ElasticSearchCall;
@@ -12,20 +13,13 @@ function ElasticSearchCall(params, options) {
self.defaultMethod = options.defaultMethod || 'GET'
self.auth = options.auth || false
self.params = params || {}
-
-
+ events.EventEmitter.call(this);
}
-ElasticSearchCall.super_ = events.EventEmitter;
-ElasticSearchCall.prototype = Object.create(events.EventEmitter.prototype, {
- constructor: {
- value: ElasticSearchCall,
- enumerable: false
- }
-});
+util.inherits(ElasticSearchCall, events.EventEmitter);
ElasticSearchCall.prototype.exec = function() {
- self = this
+ var self = this
var reqOptions = {
path:this.params.path,
method:this.params.method || this.defaultMethod,

0 comments on commit e0894af

Please sign in to comment.