Auto merge of #6834 - jdm:named-constructor-prototype, r=Ms2ger

Use an actual byte string when defining the prototype of named constr…

…uctors. Fixes #6730.

r? @Ms2ger

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6834)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-29 22:07:35 -06:00
commit 3a112bc07f
2 changed files with 1 additions and 7 deletions

View file

@ -233,7 +233,7 @@ pub fn do_create_interface_objects(cx: *mut JSContext,
let constructor = RootedObject::new(cx, create_constructor(cx, cnative, cnargs, cs.as_ptr()));
assert!(!constructor.ptr.is_null());
unsafe {
assert!(JS_DefineProperty1(cx, constructor.handle(), "prototype".as_ptr() as *const libc::c_char,
assert!(JS_DefineProperty1(cx, constructor.handle(), b"prototype\0".as_ptr() as *const libc::c_char,
rval.handle(),
JSPROP_PERMANENT | JSPROP_READONLY,
None, None) != 0);