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

对 define 的查找正则问题 #22

Open
renxia opened this issue Mar 23, 2016 · 0 comments
Open

对 define 的查找正则问题 #22

renxia opened this issue Mar 23, 2016 · 0 comments

Comments

@renxia
Copy link

renxia commented Mar 23, 2016

在 amd.js 中定义的 rDefine 存在匹配问题:

var rDefine = /('.*?'|".*?"|[^\\]\/\/[^\r\n\f]*|\/\*[\s\S]*?\*\/)|((?:^|[^\.])\bdefine\s*\()/ig;

如错误的匹配 test:

rDefine.test('define: function define(rules) {') // true

一个出了问题的文件:

https://github.com/yiminghe/async-validator/blob/master/src/index.js#L32

经过 babel 编译后,对应位置的代码就为上面测试的格式了

node_modules/async-validator/lib/index.js

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

No branches or pull requests

1 participant