EditBox控件在微信小游戏中弹出键盘时报错

在项目中使用了EditBox控件,在h5页面使用时没有问题,在微信小游戏中点击输入时候,报错,日志如下:
WAGame.js:4 gameSDKScriptError
e.defaultValue.slice is not a function;wx.showKeyboard
TypeError: e.defaultValue.slice is not a function
at Function.r (http://127.0.0.1:16263/game/dev/WAGame.js:13:8530)
at Object. (http://127.0.0.1:16263/game/dev/WAGame.js:6:30686)
at HTMLElement.tmpEdTxt.focus (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:20382:14)
at 105._ccsg.EditBox.WebGLRenderCmd.105.proto._beginEditing (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:20503:59)
at TheClass._onTouchEnded (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:19989:25)
at CCClass._onTouchEnded (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:15330:38)
at EventListeners.111.EventListeners.invoke (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:21829:22)
at _doDispatchEvent (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:21875:101)
at CCClass.112.proto.dispatchEvent (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:21992:7)
at TheClass._touchEndHandler [as onTouchEnded] (http://127.0.0.1:16263/game/cocos2d-js.b4b5f.js:9577:12)
不知道这个问题该 如何解?

因为cocos中EditBox的setString方法没有强制把传入的参数转为String类型,但微信调起输入法的api要求default字段必须是String类型,所以报错了
这里可以找到引擎调wx.showKeyboard的地方,在调用它之前,把defaultValue转成字符串类型就好了,例如:
var defaultVal = editbox._text;
if (!cc.isString(defaultVal)) defaultVal = String(defaultVal)

好的,感谢大牛指导,非常感谢!