Skip to content

Commit

Permalink
Prevent bad Interface clone when using two different versions of v6 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 1, 2024
1 parent 45b9b9c commit 4d2d90f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src.ts/abi/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,12 @@ export class Interface {
// JSON
if (typeof(value) === "string") { return new Interface(JSON.parse(value)); }

// Maybe an interface from an older version, or from a symlinked copy
// An Interface; possibly from another v6 instance
if (typeof((<any>value).formatJson) === "function") {
return new Interface((<any>value).formatJson());
}

// A legacy Interface; from an older version
if (typeof((<any>value).format) === "function") {
return new Interface((<any>value).format("json"));
}
Expand Down

0 comments on commit 4d2d90f

Please sign in to comment.