PureKrome / EcmaScript.NET

C# Port of the Java EcmaScript project.
Other
15 stars 14 forks source link

fixed "missing name after . operator" error for ES6 Promise .catch() #7

Closed pk910 closed 6 years ago

pk910 commented 7 years ago

Hi @PureKrome

I've noticed your implementation fails on minifying the recent jQuery version 3.2.1: "missing name after . operator"

It fails because of jQuery using the reserved Keyword catch without proper escaping... L3887: .catch( function( error ) {

In my opinion a minifier implementation should not complain about ANY structure/syntax problems at all! A minifier should be able to minify whatever it gets - it's the developers job to give a correct input....

My Patch fixes the Problem adressed above by simply passing any token after dot to the output (even if it's not NAME, MUL or XMLATTR) I don't know if this actually has any unwanted side effects - for me it works 😋

Greets pk910

pk910 commented 7 years ago

this should fix #4, too

mdvorscak commented 6 years ago

@PureKrome Any chance to review this PR? We are also looking for a fix for #4

tomap commented 6 years ago

Hi,

I took the liberty of integrating your fix into my fork: https://github.com/tomap/EcmaScript.NET It's not part of EcmaScript.Net.Signed https://www.nuget.org/packages/EcmaScript.Net45.Signed/2.0.12

And also of my fork of YUICompressor.Net: https://www.nuget.org/packages/YUICompressor.NET.Signed/3.0.16

Regards

PureKrome commented 6 years ago

Heya folks, I've created #8 to first upgrade the project to .NET45 and NS20.

Once that's up, then i'll see if i can manually patch in the code. I'll keep you folks posted.

PureKrome commented 6 years ago

Hi folks - new pre-release is now available on NuGet.

includes this PR fix.

Please give it a go and report back. if it's working ok, i'll promote it as a release.

trullock commented 6 years ago

bump

PureKrome commented 6 years ago

@trullock @tomap @pk910 Hi 👋

This has been pushed up to NuGet now as v 2.0.0.

Cheers!

trullock commented 6 years ago

Excellent! many thanks