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

为什么限制 withSourceURL 中路径的长度? #30

Closed
RenderCoder opened this issue May 31, 2020 · 1 comment
Closed

为什么限制 withSourceURL 中路径的长度? #30

RenderCoder opened this issue May 31, 2020 · 1 comment

Comments

@RenderCoder
Copy link

具体问题是这一行:

jsFilePathPrefix = [jsFilePathPrefix substringFromIndex:jsFilePathPrefix.length - preixLen];

文件地址:

jsFilePathPrefix = [jsFilePathPrefix substringFromIndex:jsFilePathPrefix.length - preixLen];

如果对 JS 文件路径进行截断,会导致在真机运行时文件路径错误,iOS JavaScriptCore 执行文件内容会失败,这里这样做的考虑是什么?(想了解 230 行存在的理由)

@mxflutter
Copy link
Owner

原路径太长,导致用safari 调试时无法看到是哪个JS文件,如果只用JS文件名,不同目录相同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

2 participants