mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
script: Make set_dictionary_property a safe function (#39191)
Makes `set_dictionary_property` safe. Testing: Changes are internal, this shouldn't affect behavior. Fixes: #39128 Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This commit is contained in:
parent
af8723c0b1
commit
088d16d634
4 changed files with 13 additions and 20 deletions
|
@ -7545,7 +7545,7 @@ impl{self.generic} Clone for {self.makeClassName(self.dictionary)}{self.genericS
|
|||
insertion = (
|
||||
f"rooted!(in(cx) let mut {varName}_js = UndefinedValue());\n"
|
||||
f"{varName}.to_jsval(cx, {varName}_js.handle_mut());\n"
|
||||
f'set_dictionary_property(cx, obj.handle(), "{dictionaryName}", {varName}_js.handle()).unwrap();')
|
||||
f'set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "{dictionaryName}", {varName}_js.handle()).unwrap();')
|
||||
return CGGeneric(insertion)
|
||||
|
||||
def memberInsert(memberInfo: tuple[IDLArgument, JSToNativeConversionInfo]) -> CGThing:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue