Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the build warning-free. #244

Merged
merged 4 commits into from Mar 7, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Replace deprecated utf16_units method.

  • Loading branch information
Ms2ger committed Mar 7, 2016
commit 40e5734e95391fd407b2a8430284f4b2c8949ab2
@@ -402,7 +402,7 @@ pub unsafe fn latin1_to_string(cx: *mut JSContext, s: *mut JSString) -> String {
impl ToJSValConvertible for str {
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
let mut string_utf16: Vec<u16> = Vec::with_capacity(self.len());
string_utf16.extend(self.utf16_units());
string_utf16.extend(self.encode_utf16());
let jsstr = JS_NewUCStringCopyN(cx,
string_utf16.as_ptr(),
string_utf16.len() as libc::size_t);
@@ -7,7 +7,6 @@

#![feature(core_intrinsics)]
#![feature(link_args)]
#![feature(str_utf16)]
#![feature(unsafe_no_drop_flag)]
#![feature(const_fn)]

@@ -124,7 +124,7 @@ impl Runtime {

pub fn evaluate_script(&self, glob: HandleObject, script: String, filename: String, line_num: u32)
-> Result<(),()> {
let script_utf16: Vec<u16> = script.utf16_units().collect();
let script_utf16: Vec<u16> = script.encode_utf16().collect();
let filename_cstr = ffi::CString::new(filename.as_bytes()).unwrap();
debug!("Evaluating script from {} with content {}", filename, script);
// SpiderMonkey does not approve of null pointers.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.