mirror of
https://github.com/servo/servo
synced 2026-04-28 10:27:40 +02:00
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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user