From 4af3e9028d28a5d47d9738afc70804665fd6075a Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 15 May 2016 01:19:52 +0200 Subject: Use JS_NewStringCopyN for the representation of interface objects This removes the need for the final null byte and we can make NonCallbackInterfaceObjectClass::new safe again I guess. --- components/script/dom/bindings/codegen/CodegenRust.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'components/script/dom/bindings/codegen') diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 1e26bc68c2f..2b169ba7f8c 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1993,17 +1993,16 @@ class CGInterfaceObjectJSClass(CGThing): args = { "constructorBehavior": constructorBehavior, "id": name, - "representation": str_to_const_array("function %s() {\\n [native code]\\n}" % name), + "representation": 'b"function %s() {\\n [native code]\\n}"' % name, "depth": self.descriptor.prototypeDepth } return """\ -static InterfaceObjectClass: NonCallbackInterfaceObjectClass = unsafe { +static InterfaceObjectClass: NonCallbackInterfaceObjectClass = NonCallbackInterfaceObjectClass::new( %(constructorBehavior)s, %(representation)s, PrototypeList::ID::%(id)s, - %(depth)s) -}; + %(depth)s); """ % args -- cgit v1.2.3