Skip to content

Commit

Permalink
fixed is_satisfied condition
Browse files Browse the repository at this point in the history
  • Loading branch information
shnmorimoto committed Mar 29, 2020
1 parent fa8afbb commit d8c1dc6
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2976,22 +2976,24 @@ def definition_body(self):
ret_conditions = 'vec![' + ",".join(conditions) + "]"
ret += fill(
"""
let incumbent_global = GlobalScope::incumbent().expect("no incumbent global");
let global = incumbent_global.reflector().get_jsobject();
let conditions = ${conditions};
if !conditions.iter().any(|c|
let is_satisfied = conditions.iter().any(|c|
c.is_satisfied(
SafeJSContext::from_ptr(cx),
HandleObject::from_raw(obj),
HandleObject::from_raw(obj))) {
return false;
}
rooted!(in(cx) let mut temp = UndefinedValue());
if !get_${name}(cx, obj, this, JSJitGetterCallArgs { _base: temp.handle_mut().into() }) {
return false;
}
if !JS_DefineProperty(cx, result.handle().into(),
${nameAsArray} as *const u8 as *const libc::c_char,
temp.handle(), JSPROP_ENUMERATE as u32) {
return false;
global));
if is_satisfied {
rooted!(in(cx) let mut temp = UndefinedValue());
if !get_${name}(cx, obj, this, JSJitGetterCallArgs { _base: temp.handle_mut().into() }) {
return false;
}
if !JS_DefineProperty(cx, result.handle().into(),
${nameAsArray} as *const u8 as *const libc::c_char,
temp.handle(), JSPROP_ENUMERATE as u32) {
return false;
}
}
""",
name=name, nameAsArray=str_to_const_array(name), conditions=ret_conditions)
Expand Down

0 comments on commit d8c1dc6

Please sign in to comment.