@xolvio/fiber-utils
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -268,2 +268,5 @@ describe('fiber-utils', function () { | ||
var myFunc = myObject.myFunc; | ||
myFunc.bind = function () { | ||
return myFunc; | ||
} | ||
@@ -270,0 +273,0 @@ var myObjectWrapper = fiberUtils.wrapAsyncObject(myObject, ['myFunc'], { |
@@ -64,2 +64,3 @@ var Fiber = require('fibers'); | ||
var asyncMethod = object[propertyName]; | ||
var boundAsyncMethod = asyncMethod.bind(object); | ||
if (_.isFunction(asyncMethod)) { | ||
@@ -72,3 +73,3 @@ var syncMethod = wrapAsync(asyncMethod, object); | ||
} | ||
wrapper[asyncMethodName] = asyncMethod.bind(object); | ||
wrapper[asyncMethodName] = boundAsyncMethod; | ||
@@ -81,3 +82,3 @@ var syncMethodName = propertyName + 'Sync'; | ||
wrapper[propertyName] = syncByDefault ? syncMethod : asyncMethod; | ||
wrapper[propertyName] = syncByDefault ? syncMethod : boundAsyncMethod; | ||
} | ||
@@ -84,0 +85,0 @@ }); |
{ | ||
"name": "@xolvio/fiber-utils", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Fiber utilities to convert async functions to sync ones", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
12413
340