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

There is some problem in uncompress.js #16

Open
DattyRabbit opened this issue Jul 4, 2018 · 2 comments
Open

There is some problem in uncompress.js #16

DattyRabbit opened this issue Jul 4, 2018 · 2 comments
Labels

Comments

@DattyRabbit
Copy link

The function currentScriptPath() is so skillfully method to get path. But i can't get the correct path on my device. I find why it not work correctly.

the problem in uncompress.js line 39 : "
line = stack.split('(')[1].split(')')[0];
"

because my project path include parenthesis mark, so that function can not cacth the correct path.

and I fix this bug with use RegEx like this : "
line = stack.split(/[\s][(]/)[1].split(/[)][\n]/)[0];

@workhorsy workhorsy added the bug label Jul 5, 2018
@workhorsy
Copy link
Owner

I'll have a look at this. Thanks.

@workhorsy
Copy link
Owner

I'm looking more into this. I notice a bunch more use cases where getting the file name from a stack trace fails.

Also noticed that chrome will sometimes return nonsense stack traces. For example the path

http://localhost:8001/js/uncompress (aaa).js returns a strange stack trace.

Error
    at getCallStack (http://localhost:8001/js/uncompress%20(:8001/examples/aaa/aaa).js:27:9)
    at currentScriptPath (http://localhost:8001/js/uncompress%20(:8001/examples/aaa/aaa).js:62:10)
    at loadArchiveFormats (http://localhost:8001/js/uncompress%20(:8001/examples/aaa/aaa).js:134:13)
    at main.js:110;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants