we (web engine): Experimental web browser project to understand the limits of Claude
2
fork

Configure Feed

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

Review fixes: remove redundant constant, fix UTF-8 boundary panic

- Remove duplicate TEST_TIMEOUT_INSTRUCTIONS constant (identical to
INSTRUCTION_LIMIT), use INSTRUCTION_LIMIT everywhere
- Fix potential panic when truncating failure messages containing
multi-byte UTF-8 characters by using floor_char_boundary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+3 -6
+3 -6
crates/browser/tests/wpt.rs
··· 17 17 /// Maximum instructions per test (prevents infinite loops). 18 18 const INSTRUCTION_LIMIT: u64 = 2_000_000; 19 19 20 - /// Timeout for individual test files (in instruction count). 21 - /// Tests exceeding this are marked as timeout. 22 - const TEST_TIMEOUT_INSTRUCTIONS: u64 = 2_000_000; 23 - 24 20 /// Minimal testharness.js shim that implements the WPT test API. 25 21 /// 26 22 /// This provides `test()`, `async_test()`, `promise_test()`, `assert_*()`, ··· 513 509 vm.attach_document(doc); 514 510 515 511 // Set instruction limit. 516 - vm.set_instruction_limit(TEST_TIMEOUT_INSTRUCTIONS); 512 + vm.set_instruction_limit(INSTRUCTION_LIMIT); 517 513 518 514 // Execute testharness.js preamble. 519 515 let preamble_ast = match we_js::parser::Parser::parse(TESTHARNESS_PREAMBLE) { ··· 814 810 break; 815 811 } 816 812 let short_msg = if msg.len() > 100 { 817 - format!("{}...", &msg[..100]) 813 + let end = msg.floor_char_boundary(100); 814 + format!("{}...", &msg[..end]) 818 815 } else { 819 816 msg.clone() 820 817 };