From: Ryan Prichard Date: Tue, 24 Nov 2015 22:49:52 +0000 (-0600) Subject: Fix https://github.com/atom/electron/issues/3565 by adding a typeof X-Git-Tag: v0.35.2~14^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0f5a3baff4f6d1bcfb1ff9efbb05eff9d5e14ebc;p=electron.git Fix https://github.com/atom/electron/issues/3565 by adding a typeof --- diff --git a/atom/browser/lib/rpc-server.coffee b/atom/browser/lib/rpc-server.coffee index ce63d918..d9b1047b 100644 --- a/atom/browser/lib/rpc-server.coffee +++ b/atom/browser/lib/rpc-server.coffee @@ -107,7 +107,7 @@ unwrapArgs = (sender, args) -> # style function and the caller didn't pass a callback. callFunction = (event, func, caller, args) -> funcMarkedAsync = v8Util.getHiddenValue(func, 'asynchronous') - funcPassedCallback = args[args.length - 1] is 'function' + funcPassedCallback = typeof args[args.length - 1] is 'function' try if funcMarkedAsync and not funcPassedCallback