From d6f77d7b9425c21a0b36b6d2275c21cf5bba1ced Mon Sep 17 00:00:00 2001 From: TobiasWienand <104697364+TobiasWienand@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:51:21 +0100 Subject: [PATCH] Implements compilation of string literal keys (#462) --- Sources/Fuzzilli/Compiler/Parser/parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Fuzzilli/Compiler/Parser/parser.js b/Sources/Fuzzilli/Compiler/Parser/parser.js index 2ce2b9056..4fa1a0fbe 100644 --- a/Sources/Fuzzilli/Compiler/Parser/parser.js +++ b/Sources/Fuzzilli/Compiler/Parser/parser.js @@ -159,6 +159,8 @@ function parse(script, proto) { property.name = field.key.name; } else if (field.key.type === 'NumericLiteral') { property.index = field.key.value; + } else if (field.key.type === 'StringLiteral') { + property.name = field.key.value; } else { throw "Unknown property key type: " + field.key.type + " in class declaration"; } @@ -407,6 +409,8 @@ function parse(script, proto) { property.name = field.key.name; } else if (field.key.type === 'NumericLiteral') { property.index = field.key.value; + } else if (field.key.type === 'StringLiteral') { + property.name = field.key.value; } else { throw "Unknown property key type: " + field.key.type; }