mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00: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:
parent
2c674d0397
commit
4af3e9028d
2 changed files with 12 additions and 13 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue