Simplify _obj_toString by using JS_NewStringCopyN.

This commit is contained in:
Ms2ger 2014-12-20 16:40:20 +01:00
parent 8a4eea0032
commit ef3901fceb
2 changed files with 11 additions and 24 deletions

View file

@ -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())