Merge pull request #3573 from rprichard/fix_3565

Fix https://github.com/atom/electron/issues/3565 by adding a typeof
This commit is contained in:
Cheng Zhao 2015-11-26 11:00:29 +08:00
commit ec88567683

View file

@ -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