mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Simplify _obj_toString by using JS_NewStringCopyN.
This commit is contained in:
parent
8a4eea0032
commit
ef3901fceb
2 changed files with 11 additions and 24 deletions
|
@ -3891,8 +3891,7 @@ class CGDOMJSProxyHandler_obj_toString(CGAbstractExternMethod):
|
|||
JSString* jsresult;
|
||||
return xpc_qsStringToJsstring(cx, result, &jsresult) ? jsresult : NULL;"""
|
||||
|
||||
return """let s = "%s".to_c_str();
|
||||
_obj_toString(cx, s.as_ptr())""" % self.descriptor.name
|
||||
return """_obj_toString(cx, "%s")""" % self.descriptor.name
|
||||
|
||||
def definition_body(self):
|
||||
return CGGeneric(self.getBody())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue