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.
This commit is contained in:
Anthony Ramine 2016-05-15 01:19:52 +02:00
parent 2c674d0397
commit 4af3e9028d
2 changed files with 12 additions and 13 deletions

View file

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