jmerle / competitive-companion

Browser extension which parses competitive programming problems
https://chromewebstore.google.com/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl
MIT License
938 stars 116 forks source link

Custom rules for UOJProblemParser does not work #427

Closed 52871299hzy closed 7 months ago

52871299hzy commented 7 months ago

When using the custom rules for a UOJ-based OJ problem I get this console log:

TypeError: Cannot read properties of undefined (reading 'parse')
    at parse (content.js:49:6070)
    at handleMessage (content.js:49:7106)

image

It seems that getParserByName('UOJProblemParser') returns undefined because the UOJProblemParser instance in parsers has .constructor.name === '_UOJProblemParser', which doesn't match the given parser name. image

jmerle commented 7 months ago

ESBuild appears to prefix classes with static members with an underscore. Fixed in 5458859e64208e80d0c1d5907356834702ee76fb, will be released soon. Thanks for reporting the issue!