Skip to content

Commit b3bfe35

Browse files
thisalihassanaduh95
authored andcommitted
inspector: coerce key and value to string in webstorage events
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com> PR-URL: #62616 Backport-PR-URL: #63176 Refs: #62145 Refs: #62162 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 3dc3fb6 commit b3bfe35

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎lib/internal/inspector/webstorage.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const { getOptionValue } = require('internal/options');
77

88
classInspectorLocalStorageextendsStorage{
99
setItem(key,value){
10+
key=`${key}`;
11+
value=`${value}`;
1012
constoldValue=this.getItem(key);
1113
super.setItem(key,value);
1214
if(oldValue==null){
@@ -17,6 +19,7 @@ class InspectorLocalStorage extends Storage {
1719
}
1820

1921
removeItem(key){
22+
key=`${key}`;
2023
super.removeItem(key);
2124
itemRemoved(key,true);
2225
}
@@ -29,6 +32,8 @@ class InspectorLocalStorage extends Storage {
2932

3033
constInspectorSessionStorage=classextendsStorage{
3134
setItem(key,value){
35+
key=`${key}`;
36+
value=`${value}`;
3237
constoldValue=this.getItem(key);
3338
super.setItem(key,value);
3439
if(oldValue==null){
@@ -39,6 +44,7 @@ const InspectorSessionStorage = class extends Storage {
3944
}
4045

4146
removeItem(key){
47+
key=`${key}`;
4248
super.removeItem(key);
4349
itemRemoved(key,false);
4450
}

0 commit comments

Comments
 (0)