-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(ext/webstorage): use object wrap for Storage
#26931
base: main
Are you sure you want to change the base?
Conversation
Storage
Storage
Storage
#[method] | ||
#[serde] | ||
fn iterate_keys( | ||
&self, | ||
state: &mut OpState, | ||
) -> Result<Vec<String>, WebStorageError> { | ||
let conn = get_webstorage(state, self.persistent)?; | ||
|
||
let mut stmt = conn.prepare_cached("SELECT key FROM data")?; | ||
let keys = stmt | ||
.query_map(params![], |row| row.get::<_, String>(0))? | ||
.map(|r| r.unwrap()) | ||
.collect(); | ||
|
||
Ok(keys) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: make this private or keep it as a normal op
@@ -9789,7 +9789,7 @@ | |||
"event_constructor.window.html": false, | |||
"event_initstorageevent.window.html": false, | |||
"missing_arguments.window.html": true, | |||
"storage_builtins.window.html": true, | |||
"storage_builtins.window.html": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test checks if
Storage.prototype.setItem == localStorage.setItem
but our Proxy needs to create a new instance via .bind
because receiver holds cppgc object.
Depends on:
#[required(<count>)]
deno_core#976String(V)
for non-strings deno_core#980