Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复对JS的处理 #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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