Skip to content

Commit c5a19b0

Browse files
committed
fix: tests for node < 16
1 parent f1d9cf4 commit c5a19b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/vm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,11 +1774,11 @@ describe('VM', () => {
17741774
try {
17751775
obj.slice(20, {showHidden: true, showProxy: true, depth: 10, stylize(a) {
17761776
// Try both objectWrapper (old vulnerability) and getObject (method that was left exposed)
1777-
if (this.seen?.[1]?.objectWrapper) {
1777+
if (this.seen && this.seen[1] && this.seen[1].objectWrapper) {
17781778
this.seen[1].objectWrapper().x = obj.slice;
17791779
escaped = true;
17801780
}
1781-
if (this.seen?.[1]?.getObject) {
1781+
if (this.seen && this.seen[1] && this.seen[1].getObject) {
17821782
this.seen[1].getObject().x = obj.slice;
17831783
escaped = true;
17841784
}

0 commit comments

Comments
 (0)