Skip to content

Commit

Permalink
Implements compilation of string literal keys (googleprojectzero#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasWienand authored and parthdt committed Dec 14, 2024
1 parent c0513a2 commit cae29cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Fuzzilli/Compiler/Parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit cae29cc

Please sign in to comment.