Fix panic in webstorage/symbol-props.window.js (#33108)

Issue: https://github.com/servo/servo/issues/32987

Signed-off-by: Akash Pateria <pateria.akash77@gmail.com>
This commit is contained in:
Akash Pateria 2024-10-01 17:34:35 -07:00 committed by GitHub
parent f3e6188502
commit c76524e63b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -5563,6 +5563,22 @@ class CGProxyNamedDeleter(CGProxyNamedOperation):
def __init__(self, descriptor):
CGProxySpecialOperation.__init__(self, descriptor, 'NamedDeleter')
def define(self):
# Our first argument is the id we're getting.
argName = self.arguments[0].identifier.name
return ("if !id.is_symbol() {\n"
f' let {argName} = match jsid_to_string(*cx, Handle::from_raw(id)) {{\n'
" Some(val) => val,\n"
" None => {\n"
" throw_type_error(*cx, \"Not a string-convertible JSID\");\n"
" return false;\n"
" }\n"
" };\n"
" let this = UnwrapProxy(proxy);\n"
" let this = &*this;\n"
f" {CGProxySpecialOperation.define(self)}"
"}\n")
class CGProxyUnwrap(CGAbstractMethod):
def __init__(self, descriptor):

View file

@ -1,2 +1,6 @@
[symbol-props.window.html]
expected: CRASH
[localStorage: defineProperty not configurable]
expected: FAIL
[sessionStorage: defineProperty not configurable]
expected: FAIL