mirror of
https://github.com/servo/servo.git
synced 2025-06-13 19:04:30 +00:00
parent
8397c5b0a2
commit
f5d16fc069
2 changed files with 11 additions and 67 deletions
|
@ -4750,7 +4750,7 @@ class CGProxyNamedOperation(CGProxySpecialOperation):
|
||||||
def define(self):
|
def define(self):
|
||||||
# Our first argument is the id we're getting.
|
# Our first argument is the id we're getting.
|
||||||
argName = self.arguments[0].identifier.name
|
argName = self.arguments[0].identifier.name
|
||||||
return ("let %s = string_jsid_to_string(cx, id);\n"
|
return ("let %s = jsid_to_string(cx, id).expect(\"Not a string-convertible JSID?\");\n"
|
||||||
"let this = UnwrapProxy(proxy);\n"
|
"let this = UnwrapProxy(proxy);\n"
|
||||||
"let this = &*this;\n" % argName +
|
"let this = &*this;\n" % argName +
|
||||||
CGProxySpecialOperation.define(self))
|
CGProxySpecialOperation.define(self))
|
||||||
|
@ -4868,7 +4868,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
||||||
# properties that shadow prototype properties.
|
# properties that shadow prototype properties.
|
||||||
namedGet = """
|
namedGet = """
|
||||||
if RUST_JSID_IS_STRING(id) {
|
if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {
|
||||||
let mut has_on_proto = false;
|
let mut has_on_proto = false;
|
||||||
if !has_property_on_prototype(cx, proxy, id, &mut has_on_proto) {
|
if !has_property_on_prototype(cx, proxy, id, &mut has_on_proto) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -4935,12 +4935,12 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
||||||
if self.descriptor.hasUnforgeableMembers:
|
if self.descriptor.hasUnforgeableMembers:
|
||||||
raise TypeError("Can't handle a named setter on an interface that has "
|
raise TypeError("Can't handle a named setter on an interface that has "
|
||||||
"unforgeables. Figure out how that should work!")
|
"unforgeables. Figure out how that should work!")
|
||||||
set += ("if RUST_JSID_IS_STRING(id) {\n" +
|
set += ("if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {\n" +
|
||||||
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() +
|
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() +
|
||||||
" return (*opresult).succeed();\n" +
|
" return (*opresult).succeed();\n" +
|
||||||
"}\n")
|
"}\n")
|
||||||
else:
|
else:
|
||||||
set += ("if RUST_JSID_IS_STRING(id) {\n" +
|
set += ("if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {\n" +
|
||||||
CGIndenter(CGProxyNamedGetter(self.descriptor)).define() +
|
CGIndenter(CGProxyNamedGetter(self.descriptor)).define() +
|
||||||
" if result.is_some() {\n"
|
" if result.is_some() {\n"
|
||||||
" return (*opresult).failNoNamedSetter();\n"
|
" return (*opresult).failNoNamedSetter();\n"
|
||||||
|
@ -5095,7 +5095,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
named = """\
|
named = """\
|
||||||
if RUST_JSID_IS_STRING(id) {
|
if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {
|
||||||
let mut has_on_proto = false;
|
let mut has_on_proto = false;
|
||||||
if !has_property_on_prototype(cx, proxy, id, &mut has_on_proto) {
|
if !has_property_on_prototype(cx, proxy, id, &mut has_on_proto) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5175,7 +5175,7 @@ if !expando.is_null() {
|
||||||
|
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
getNamed = ("if RUST_JSID_IS_STRING(id) {\n" +
|
getNamed = ("if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {\n" +
|
||||||
CGIndenter(CGProxyNamedGetter(self.descriptor, templateValues)).define() +
|
CGIndenter(CGProxyNamedGetter(self.descriptor, templateValues)).define() +
|
||||||
"}\n")
|
"}\n")
|
||||||
else:
|
else:
|
||||||
|
@ -5633,6 +5633,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::glue::GetProxyPrivate',
|
'js::glue::GetProxyPrivate',
|
||||||
'js::glue::NewProxyObject',
|
'js::glue::NewProxyObject',
|
||||||
'js::glue::ProxyTraps',
|
'js::glue::ProxyTraps',
|
||||||
|
'js::glue::RUST_JSID_IS_INT',
|
||||||
'js::glue::RUST_JSID_IS_STRING',
|
'js::glue::RUST_JSID_IS_STRING',
|
||||||
'js::glue::RUST_SYMBOL_TO_JSID',
|
'js::glue::RUST_SYMBOL_TO_JSID',
|
||||||
'js::glue::int_to_jsid',
|
'js::glue::int_to_jsid',
|
||||||
|
@ -5720,6 +5721,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'dom::bindings::conversions::root_from_handlevalue',
|
'dom::bindings::conversions::root_from_handlevalue',
|
||||||
'dom::bindings::conversions::root_from_object',
|
'dom::bindings::conversions::root_from_object',
|
||||||
'dom::bindings::conversions::string_jsid_to_string',
|
'dom::bindings::conversions::string_jsid_to_string',
|
||||||
|
'dom::bindings::conversions::jsid_to_string',
|
||||||
'dom::bindings::codegen::PrototypeList',
|
'dom::bindings::codegen::PrototypeList',
|
||||||
'dom::bindings::codegen::RegisterBindings',
|
'dom::bindings::codegen::RegisterBindings',
|
||||||
'dom::bindings::codegen::UnionTypes',
|
'dom::bindings::codegen::UnionTypes',
|
||||||
|
|
|
@ -12,73 +12,15 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
bug: https://github.com/servo/servo/issues/6564
|
bug: https://github.com/servo/servo/issues/6564
|
||||||
|
|
||||||
[localStorage["0"\]]
|
|
||||||
expected: FAIL
|
|
||||||
bug: https://github.com/servo/servo/issues/10686
|
|
||||||
|
|
||||||
[localStorage["1"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["2"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["3"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["4"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["5"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["6"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["7"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["8"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[localStorage["9"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage[\] = "<22>"]
|
[sessionStorage[\] = "<22>"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
bug: https://github.com/servo/servo/issues/6564
|
||||||
|
|
||||||
[sessionStorage[\] = "<22>a"]
|
[sessionStorage[\] = "<22>a"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
bug: https://github.com/servo/servo/issues/6564
|
||||||
|
|
||||||
[sessionStorage[\] = "a<>"]
|
[sessionStorage[\] = "a<>"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
bug: https://github.com/servo/servo/issues/6564
|
||||||
[sessionStorage["0"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["1"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["2"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["3"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["4"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["5"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["6"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["7"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["8"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sessionStorage["9"\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue