uncompress.js icon indicating copy to clipboard operation
uncompress.js copied to clipboard

There is some problem in uncompress.js

Open DattyRabbit opened this issue 7 years ago • 2 comments

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]; “

DattyRabbit avatar Jul 04 '18 06:07 DattyRabbit

I'll have a look at this. Thanks.

workhorsy avatar Jul 05 '18 05:07 workhorsy

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;

workhorsy avatar Jul 09 '18 06:07 workhorsy