Skip to content

Commit e81319b

Browse files
committed
Use Object.create(null) instead of {}
Avoids any weird issues if variables have strange IDs like "toString"
1 parent 4a8a5ad commit e81319b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/iroptimizer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const {
1717
class TypeState {
1818
constructor () {
1919
/** @type {Object.<string, InputType | 0>}*/
20-
this.variables = {};
20+
this.variables = Object.create(null);
2121
}
2222

2323
/**
@@ -31,7 +31,7 @@ class TypeState {
3131
break;
3232
}
3333
}
34-
this.variables = {};
34+
this.variables = Object.create(null);
3535
return modified;
3636
}
3737

0 commit comments

Comments
 (0)