-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I'm including a generated parser.js as part of a large web project. Webpack with the Terser plugin is configured to minify all of the javascript. The default (I believe) behavior is to rename all non-top-level classes to one or two-letter names.
But serialized data, like this:
0: {
name: 'NUMBER',
pattern: {
value:
'(?:(?:(?:[0-9])+(?:e|E)(?:(?:\\+|\\-))?(?:[0-9])+|(?:(?:[0-9])+\\.(?:(?:[0-9])+)?|\\.(?:[0-9])+)(?:(?:e|E)(?:(?:\\+|\\-))?(?:[0-9])+)?)|(?:[0-9])+)',
flags: [],
_width: [1, 4294967295],
__type__: 'PatternRE',
},
priority: 0,
__type__: 'TerminalDef',
},
includes names of classes as string literals.
When the classes are renamed, the data can no longer be deserialized and an exception is thrown.
Can a dictionary be built that maps the serialized type names to classes without relying on the class names themselves?
Metadata
Metadata
Assignees
Labels
No labels