diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-05-15 01:19:52 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-05-16 15:22:07 +0200 |
commit | 4af3e9028d28a5d47d9738afc70804665fd6075a (patch) | |
tree | 9de9e10f467e281eb0b0b7284a2f5bf14d3d1162 /components/script/dom/bindings/codegen | |
parent | 2c674d0397927ef6563feb70e54f46815af55600 (diff) | |
download | servo-4af3e9028d28a5d47d9738afc70804665fd6075a.tar.gz servo-4af3e9028d28a5d47d9738afc70804665fd6075a.zip |
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.
Diffstat (limited to 'components/script/dom/bindings/codegen')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 7 |
1 files changed, 3 insertions, 4 deletions
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 |