mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Don't mark new methods as unsafe in code generation
This commit is contained in:
parent
914bda9cd4
commit
8968286aa1
1 changed files with 16 additions and 14 deletions
|
@ -6355,8 +6355,9 @@ class CGDictionary(CGThing):
|
||||||
return string.Template(
|
return string.Template(
|
||||||
"impl ${selfName} {\n"
|
"impl ${selfName} {\n"
|
||||||
"${empty}\n"
|
"${empty}\n"
|
||||||
" pub unsafe fn new(cx: SafeJSContext, val: HandleValue) \n"
|
" pub fn new(cx: SafeJSContext, val: HandleValue) \n"
|
||||||
" -> Result<ConversionResult<${actualType}>, ()> {\n"
|
" -> Result<ConversionResult<${actualType}>, ()> {\n"
|
||||||
|
" unsafe {\n"
|
||||||
" let object = if val.get().is_null_or_undefined() {\n"
|
" let object = if val.get().is_null_or_undefined() {\n"
|
||||||
" ptr::null_mut()\n"
|
" ptr::null_mut()\n"
|
||||||
" } else if val.get().is_object() {\n"
|
" } else if val.get().is_object() {\n"
|
||||||
|
@ -6371,6 +6372,7 @@ class CGDictionary(CGThing):
|
||||||
"${postInitial}"
|
"${postInitial}"
|
||||||
" Ok(ConversionResult::Success(dictionary))\n"
|
" Ok(ConversionResult::Success(dictionary))\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
|
" }\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"impl FromJSValConvertible for ${actualType} {\n"
|
"impl FromJSValConvertible for ${actualType} {\n"
|
||||||
|
@ -6391,11 +6393,11 @@ class CGDictionary(CGThing):
|
||||||
"selfName": selfName,
|
"selfName": selfName,
|
||||||
"actualType": actualType,
|
"actualType": actualType,
|
||||||
"empty": CGIndenter(CGGeneric(self.makeEmpty()), indentLevel=4).define(),
|
"empty": CGIndenter(CGGeneric(self.makeEmpty()), indentLevel=4).define(),
|
||||||
"initParent": CGIndenter(CGGeneric(initParent), indentLevel=12).define(),
|
"initParent": CGIndenter(CGGeneric(initParent), indentLevel=16).define(),
|
||||||
"initMembers": CGIndenter(memberInits, indentLevel=12).define(),
|
"initMembers": CGIndenter(memberInits, indentLevel=16).define(),
|
||||||
"insertMembers": CGIndenter(memberInserts, indentLevel=8).define(),
|
"insertMembers": CGIndenter(memberInserts, indentLevel=8).define(),
|
||||||
"preInitial": CGIndenter(CGGeneric(preInitial), indentLevel=12).define(),
|
"preInitial": CGIndenter(CGGeneric(preInitial), indentLevel=16).define(),
|
||||||
"postInitial": CGIndenter(CGGeneric(postInitial), indentLevel=12).define(),
|
"postInitial": CGIndenter(CGGeneric(postInitial), indentLevel=16).define(),
|
||||||
})
|
})
|
||||||
|
|
||||||
def membersNeedTracing(self):
|
def membersNeedTracing(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue