mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #11883 - Ms2ger:bindings-refactor, r=jdm
Some bindings improvements. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11883) <!-- Reviewable:end -->
This commit is contained in:
commit
00af25b685
3 changed files with 6 additions and 13 deletions
|
@ -4574,8 +4574,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
||||||
"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) {\n" +
|
||||||
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() +
|
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() +
|
||||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
" return (*opresult).succeed();\n" +
|
||||||
" return true;\n" +
|
|
||||||
"} else {\n" +
|
"} else {\n" +
|
||||||
" return false;\n" +
|
" return false;\n" +
|
||||||
"}\n")
|
"}\n")
|
||||||
|
@ -4587,11 +4586,9 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
||||||
" //return js::IsInNonStrictPropertySet(cx)\n" +
|
" //return js::IsInNonStrictPropertySet(cx)\n" +
|
||||||
" // ? opresult.succeed()\n" +
|
" // ? opresult.succeed()\n" +
|
||||||
" // : ThrowErrorMessage(cx, MSG_NO_NAMED_SETTER, \"${name}\");\n" +
|
" // : ThrowErrorMessage(cx, MSG_NO_NAMED_SETTER, \"${name}\");\n" +
|
||||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
" return (*opresult).succeed();\n" +
|
||||||
" return true;\n" +
|
|
||||||
" }\n" +
|
" }\n" +
|
||||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
" return (*opresult).succeed();\n"
|
||||||
" return true;\n"
|
|
||||||
"}\n") % (self.descriptor.name, self.descriptor.name)
|
"}\n") % (self.descriptor.name, self.descriptor.name)
|
||||||
set += "return proxyhandler::define_property(%s);" % ", ".join(a.name for a in self.args)
|
set += "return proxyhandler::define_property(%s);" % ", ".join(a.name for a in self.args)
|
||||||
return set
|
return set
|
||||||
|
@ -4753,9 +4750,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
||||||
return indexed + """\
|
return indexed + """\
|
||||||
let expando = RootedObject::new(cx, get_expando_object(proxy));
|
let expando = RootedObject::new(cx, get_expando_object(proxy));
|
||||||
if !expando.ptr.is_null() {
|
if !expando.ptr.is_null() {
|
||||||
let mut b = true;
|
let ok = JS_HasPropertyById(cx, expando.handle(), id, bp);
|
||||||
let ok = JS_HasPropertyById(cx, expando.handle(), id, &mut b);
|
|
||||||
*bp = b;
|
|
||||||
if !ok || *bp {
|
if !ok || *bp {
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
3
components/servo/Cargo.lock
generated
3
components/servo/Cargo.lock
generated
|
@ -1074,7 +1074,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#28f9fb0625a798ad53abf7edeb3e8b7bc0007dc3"
|
source = "git+https://github.com/servo/rust-mozjs#707bfb4ff4fe2c0abde1cc2bb87ac35ff8f40aaa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1082,7 +1082,6 @@ dependencies = [
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
|
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
|
||||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
3
ports/cef/Cargo.lock
generated
3
ports/cef/Cargo.lock
generated
|
@ -983,7 +983,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#28f9fb0625a798ad53abf7edeb3e8b7bc0007dc3"
|
source = "git+https://github.com/servo/rust-mozjs#707bfb4ff4fe2c0abde1cc2bb87ac35ff8f40aaa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -991,7 +991,6 @@ dependencies = [
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
|
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
|
||||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue