开发者

TypeError: boolean is not a function

开发者 https://www.devze.com 2023-04-03 16:23 出处:网络
I\'m using SocketStream. I\'m calling @session.save cb response The error doesn\'t happen until I pass response into the callback.

I'm using SocketStream.

I'm calling @session.save cb response

The error doesn't happen until I pass response into the callback.

开发者_如何学C

response is...

{ success: true,
  attributes: 
   { _id: 00000000,
     email: 'test@example.com',
     type: 'example' 
   }
}

Any ideas?

The callback is fired and everything works. The server just crashes with TypeError: boolean is not a function


@session.save cb response will execute the callback with 'response' as an argument, and then take the result of the callback, and pass it to @session.save. In thise case it looks like the return value of 'cb' is probably a boolean.

Without more info I can only guess, but maybe sommething like this is what you want?

@session.save ->
  cb response
0

精彩评论

暂无评论...
验证码 换一张
取 消