Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

make javascript code generation faster by skipping grapheme counting in docs

author
Giacomo Cavalieri
committer
Louis Pilfold
date (Jul 15, 2026, 5:34 PM +0100) commit b435df86 parent 1b62fdf3 change-id qxqllqwp
+7 -1
+7 -1
compiler-core/src/javascript.rs
··· 1303 1303 documentation 1304 1304 .trim_end() 1305 1305 .split('\n') 1306 - .map(|line| eco_format!(" *{}", line.replace("*/", "*\\/")).to_doc(arena)), 1306 + // Each comment line is turned into a zero width string. 1307 + // We actually don't need to know how long a comment string is 1308 + // because comments will never be split anyway. 1309 + // So this saves us a lot of useless grapheme counting that would 1310 + // otherwise have to happen if we just turned the string into a 1311 + // regular document. 1312 + .map(|line| arena.zero_width_string(eco_format!(" *{}", line.replace("*/", "*\\/")))), 1307 1313 LINE_DOCUMENT, 1308 1314 ); 1309 1315