mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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!")
|
||||
set += ("if RUST_JSID_IS_STRING(id) {\n" +
|
||||
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() +
|
||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
||||
" return true;\n" +
|
||||
" return (*opresult).succeed();\n" +
|
||||
"} else {\n" +
|
||||
" return false;\n" +
|
||||
"}\n")
|
||||
|
@ -4587,11 +4586,9 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
|||
" //return js::IsInNonStrictPropertySet(cx)\n" +
|
||||
" // ? opresult.succeed()\n" +
|
||||
" // : ThrowErrorMessage(cx, MSG_NO_NAMED_SETTER, \"${name}\");\n" +
|
||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
||||
" return true;\n" +
|
||||
" return (*opresult).succeed();\n" +
|
||||
" }\n" +
|
||||
" (*opresult).code_ = 0; /* SpecialCodes::OkCode */\n" +
|
||||
" return true;\n"
|
||||
" return (*opresult).succeed();\n"
|
||||
"}\n") % (self.descriptor.name, self.descriptor.name)
|
||||
set += "return proxyhandler::define_property(%s);" % ", ".join(a.name for a in self.args)
|
||||
return set
|
||||
|
@ -4753,9 +4750,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
|||
return indexed + """\
|
||||
let expando = RootedObject::new(cx, get_expando_object(proxy));
|
||||
if !expando.ptr.is_null() {
|
||||
let mut b = true;
|
||||
let ok = JS_HasPropertyById(cx, expando.handle(), id, &mut b);
|
||||
*bp = b;
|
||||
let ok = JS_HasPropertyById(cx, expando.handle(), id, bp);
|
||||
if !ok || *bp {
|
||||
return ok;
|
||||
}
|
||||
|
|
3
components/servo/Cargo.lock
generated
3
components/servo/Cargo.lock
generated
|
@ -1074,7 +1074,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "js"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#28f9fb0625a798ad53abf7edeb3e8b7bc0007dc3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#707bfb4ff4fe2c0abde1cc2bb87ac35ff8f40aaa"
|
||||
dependencies = [
|
||||
"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)",
|
||||
|
@ -1082,7 +1082,6 @@ dependencies = [
|
|||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"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)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
3
ports/cef/Cargo.lock
generated
3
ports/cef/Cargo.lock
generated
|
@ -983,7 +983,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "js"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#28f9fb0625a798ad53abf7edeb3e8b7bc0007dc3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#707bfb4ff4fe2c0abde1cc2bb87ac35ff8f40aaa"
|
||||
dependencies = [
|
||||
"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)",
|
||||
|
@ -991,7 +991,6 @@ dependencies = [
|
|||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"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)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue