Skip to content

Commit

Permalink
Merge pull request #144 from ConsenSys/writer.literal.nit
Browse files Browse the repository at this point in the history
Normalize value in string literals to null when undefined
  • Loading branch information
cd1m0 authored Aug 10, 2022
2 parents 1cfbd1f + f726a46 commit c0cd987
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 184 deletions.
2 changes: 1 addition & 1 deletion src/ast/modern/literal_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ModernLiteralProcessor extends ModernExpressionProcessor<Literal> {

const kind: LiteralKind = raw.kind;
const hexValue: string = raw.hexValue;
const value: string = raw.value;
const value: string = raw.value === undefined ? null : raw.value;
const subdenomination: TimeUnit | EtherUnit | undefined = raw.subdenomination
? raw.subdenomination
: undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/compile/latest_08.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ for (const compilerKind of PossibleCompilerKinds) {
// console.log(sourceUnit.getChildren().length);

expect(sourceUnit.id).toEqual(738);
expect(sourceUnit.src).toEqual("0:8593:0");
expect(sourceUnit.src).toEqual("0:8621:0");
expect(sourceUnit.absolutePath).toEqual(mainSample);
expect(sourceUnit.children.length).toEqual(30);
expect(sourceUnit.getChildren().length).toEqual(731);
Expand Down
Loading

0 comments on commit c0cd987

Please sign in to comment.