Skip to content

Conversation

@jonathanz
Copy link
Contributor

fix parse issue for subscribe

@jonathanz
Copy link
Contributor Author

merge

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 indentation 能调整一下不?

@jeffhtli
Copy link

能否先Merge下“Parse error”的修改,那个BUG现在已经影响了weixin-robot了。

@ktmud ktmud merged commit a2a4f74 into node-webot:master Apr 13, 2016
@ktmud
Copy link
Member

ktmud commented Apr 13, 2016

抱歉这么晚回复,能否详细描述一下错误信息,并补全一下测试用例?

@jeffhtli
Copy link

var wechat = require('wechat-mp');

var test = ['<xml>',
    '<MsgId>1234567</MsgId>',
    '<ToUserName><![CDATA[webot]]></ToUserName>',
    '<FromUserName><![CDATA[client]]></FromUserName>',
    '<CreateTime>1460614681</CreateTime>',
    '<MsgType><![CDATA[text]]></MsgType>',
    '<Content><![CDATA[hi]]></Content>',
    '</xml>'].join('\n');

wechat.load(test);

test是webot-cli产生的一条消息,异常如下:

TypeError: Cannot use 'in' operator to search for 'MsgId' in 

    at c:\git\webot-example\node_modules\wechat-mp\lib\xml.js:62:24
    at Array.forEach (native)
    at flattern (c:\git\webot-example\node_modules\wechat-mp\lib\xml.js:56:17)
    at Function.parseXml [as load] (c:\git\webot-example\node_modules\wechat-mp\lib\xml.js:77:13)
    at Object.<anonymous> (c:\git\webot-example\test.js:12:8)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants