Skip to content

Conversation

@mark0smith
Copy link

这个PR只改动了ujs.go文件中extractDefineParams函数对JS代码的正则表达式。

原来的表达式会对isPage字符串进行检测,但实际上部分小程序JS代码中并不包含该字符串,例如问题#63中的截图。

define\s*\(\s*["']([^"']+)["']\s*,\s*function\s*\(([^)]*)\)\s*\{([\s\S]*?)\}\s*,\s*\{[^}]*isPage\s*:\s*[^}]*\}\s*\)\s*;

改动之后的正则表达式直接匹配definefunction的下一行的所有内容。

define\s*\(\s*["']([^"']+)["']\s*,\s*function\s*\(([^)]*)\)\{\s*\n[^\n]+\n`

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.

1 participant