From 93e2bfe22e5cc782e7d502616dad1fd70d26ae37 Mon Sep 17 00:00:00 2001 From: danielwippermann Date: Mon, 17 Aug 2020 23:48:15 +0200 Subject: fix(std/encoding/toml): Stop TOML parser from detecting numbers in strings. (#7064) Before this patch the TOML parser would incorrect treat the string "base64data0xdamaged" in a declaration as a hex number because the corresponding check triggers even when the "0x" is inside a double quoted string literal as long as it is followed by at least one hex character. --- std/encoding/toml_test.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'std/encoding/toml_test.ts') diff --git a/std/encoding/toml_test.ts b/std/encoding/toml_test.ts index cc3d190b0..565fe1eeb 100644 --- a/std/encoding/toml_test.ts +++ b/std/encoding/toml_test.ts @@ -29,6 +29,8 @@ Deno.test({ "whitespace\n is preserved.", withApostrophe: "What if it's not?", withSemicolon: `const message = 'hello world';`, + withHexNumberLiteral: + "Prevent bug from stripping string here ->0xabcdef", }, }; const actual = parseFile(path.join(testFilesDir, "string.toml")); -- cgit v1.2.3