7rulnik / source-map-js

Consume and generate source maps.
Other
92 stars 13 forks source link

eval in quick-sort.js gives err when used in chrome extension. #15

Closed YuanboXue-Amber closed 6 months ago

YuanboXue-Amber commented 2 years ago

Hi, I'm using source-map-js in a chrome extension. However I'm getting error 'Refuse to evaluate a string as JavaScript...', because quick-sort.js is using new Function(), and it is a eval-like structure. I found out this is introduced by #2. Would it be possible to release a version of source-map-js without the evaluation?

7rulnik commented 6 months ago

@YuanboXue-Amber hi! Sorry for really late response.

Well, I guess it's not possible because the whole idea of this project — speed up source-map JS implementation in node.js. I saw you patched package which is fine I think. I can suggest to find another implementation which will be fast and will not require patching for you. You can pick something from this issue https://github.com/tc39/source-map/issues/47

You can find more details here https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html#optimizing-sorting---monomorphisation