js-beautify icon indicating copy to clipboard operation
js-beautify copied to clipboard

Failed P_A_C_K_E_R.unpack test

Open Infocatcher opened this issue 2 years ago • 2 comments

Tests output:

==== P_A_C_K_E_R.unpack ============================================================
---- input -------
function test (){alert ('This is a test!')}; eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('0 2=\'{Íâ–+›ï;ã†Ù¥#\'',3,3,'var||a'.split('|'),0,{}))
---- expected ----
function test (){alert ('This is a test!')}; var a='{Íâ–+›ï;ã†Ù¥#'
---- output ------
function test (){alert ('This is a test!')}; 0 2='{Íâ–+›ï;ã†Ù¥#'
---- expected-ws ------
function_test_(){alert_('This_is_a_test!')};_var_a='{Íâ–+›ï;ã†Ù¥#'
---- output-ws ------
function_test_(){alert_('This_is_a_test!')};_0_2='{Íâ–+›ï;ã†Ù¥#'
================================================================

1 tests failed.

Looks like not depends on js-engine: I see that with latest Chrome 102 (Vivaldi) and with WSH's JScript.

Also how to show hidden block with "Run the tests" on https://beautifier.io without dev tools?

Infocatcher avatar Jul 05 '22 19:07 Infocatcher

@Infocatcher I think in the formatting update some functionality was lost. Please file a separate bug for that (and maybe a PR to fix it).

As to the Packer failure, I do not know. Sorry. If this is an area that matters to you, you'll need to dig and find a solution.

bitwiseman avatar Aug 07 '22 07:08 bitwiseman

This bug report comes from my attempts to eliminate issues, that cused by MS WSH/JScript limitations (https://github.com/Infocatcher/AkelPad_scripts/blob/2022-08-02/jsBeautifier.js#L10000-L10045), so this is not a real problem for me, but if I find something else or possible fix, I'll post new issue or PR.

Infocatcher avatar Aug 07 '22 20:08 Infocatcher