js_to_oxc icon indicating copy to clipboard operation
js_to_oxc copied to clipboard

Formatter crashes when the generated code is long

Open 7086cmd opened this issue 1 year ago • 3 comments

reproduction link: https://kermanx.github.io/js_to_oxc/#N4IglgdgDgrgLiAXCABCg8gIwFYFMDGcAdACa4BmkuACgE4D2UutcAngBS4AeU9LAzgBoUAa1ythwADoQ0aXBBgBbZgENMAG1yIUcWjFyCZclAHNccHeRgRCYerPYBKFNNkmUtCzFqyA+qoA2mKsALoA3MZyAL5R0U7hIIIgUAymtKpKALL0ZEh6Bsmq/HAAQjBgGmS0SCD8uBrkRMVwfpgVVcxJdVCqELUAytQAggByINFAA===

When the code appears with

  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _a[key];
    }
  });

it will crash and you can't do anything on the page.

7086cmd avatar Sep 02 '24 07:09 7086cmd

Seem to be a problem when the format sets to be true.

7086cmd avatar Sep 02 '24 07:09 7086cmd

Another formatter problem... Not sure how to fix🤔

kermanx avatar Sep 02 '24 13:09 kermanx

Just decreased the maximum formattable code length as a workaround 🫠

kermanx avatar Sep 02 '24 13:09 kermanx