Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b3bfe35

Browse filesBrowse 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
Copy full SHA for b3bfe35

1 file changed

+6Lines changed: 6 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/inspector/webstorage.js‎

Copy file name to clipboardExpand all lines: lib/internal/inspector/webstorage.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const { getOptionValue } = require('internal/options');
77

88
class InspectorLocalStorage extends Storage {
99
setItem(key, value) {
10+
key = `${key}`;
11+
value = `${value}`;
1012
const oldValue = 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
const InspectorSessionStorage = class extends Storage {
3134
setItem(key, value) {
35+
key = `${key}`;
36+
value = `${value}`;
3237
const oldValue = 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.