ITADN

Define a JS-API implementation limit for name lengths

#1574Openeqrion 创建于 2025-10-02
E
eqrioncommented
The core spec allows for an implementation limit on the length of `name`s (i.e. strings). The JS-API does not define one and the engines have inconsistent limits. SpiderMonkey has a limit of 100_000 bytes. I'm told JSC has the same, and V8 has no limit. This is normally not a big issue, but with js-string-builtins and string constants imports the names can get really big. One option would be to not have a limit on name length, but I'd prefer to have a limit even if it's really large. How would folks feel about a limit of ~10 MiB? I would hope the would be large enough for 99% of string constants, and the pathological ones could use some other mechanism that's better designed for bulk data. cc @mkustermann @jakobkummerow @kmiller68
3 条评论