Skip to content

Commit f12e9b6

Browse files
committed
use js try for errors
1 parent 305460d commit f12e9b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/browser/html/elements.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ test "Browser.HTML.HtmlInputElement.propeties" {
12981298
try runner.testCases(&.{.{ "elem_input.maxLength", "-1" }}, .{}); // Initial value
12991299
try testProperty(arena, &runner, "elem_input.maxLength", null, &.{.{ .input = "5" }}); // Valid
13001300
try testProperty(arena, &runner, "elem_input.maxLength", "0", &.{.{ .input = "'banana'" }}); // Invalid
1301-
try testing.expectError(error.ExecutionError, runner.testCases(&.{.{ "elem_input.maxLength = -45", null }}, .{})); // Error
1301+
try runner.testCases(&.{.{ "try { elem_input.maxLength = -45 } catch(e) {e}", "Error: NegativeValueNotAllowed" }}, .{}); // Error
13021302

13031303
try runner.testCases(&.{.{ "elem_input.name", "" }}, .{}); // Initial value
13041304
try testProperty(arena, &runner, "elem_input.name", null, &str_valids); // Valid
@@ -1309,8 +1309,8 @@ test "Browser.HTML.HtmlInputElement.propeties" {
13091309
try runner.testCases(&.{.{ "elem_input.size", "20" }}, .{}); // Initial value
13101310
try testProperty(arena, &runner, "elem_input.size", null, &.{.{ .input = "5" }}); // Valid
13111311
try testProperty(arena, &runner, "elem_input.size", "20", &.{.{ .input = "-26" }}); // Invalid
1312-
try testing.expectError(error.ExecutionError, runner.testCases(&.{.{ "elem_input.size = 0", null }}, .{})); // Error
1313-
try testing.expectError(error.ExecutionError, runner.testCases(&.{.{ "elem_input.size = 'banana'", null }}, .{})); // Error
1312+
try runner.testCases(&.{.{ "try { elem_input.size = 0 } catch(e) {e}", "Error: ZeroNotAllowed" }}, .{}); // Error
1313+
try runner.testCases(&.{.{ "try { elem_input.size = 'banana' } catch(e) {e}", "Error: ZeroNotAllowed" }}, .{}); // Error
13141314

13151315
try runner.testCases(&.{.{ "elem_input.src", "" }}, .{}); // Initial value
13161316
try testProperty(arena, &runner, "elem_input.src", null, &.{

0 commit comments

Comments
 (0)