Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Commit 730521e

Browse files
author
Alan Jeffrey
committed
Allowed rooting test to run in stable rust
1 parent 352604a commit 730521e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/rooting.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
#![feature(const_fn)]
6-
#![feature(const_ptr_null)]
75
#![cfg(feature = "debugmozjs")]
86

97
#[macro_use]
@@ -57,32 +55,26 @@ unsafe extern "C" fn generic_method(_: *mut JSContext, _: u32, _: *mut Value) ->
5755
const METHODS: &'static [JSFunctionSpec] = &[
5856
JSFunctionSpec {
5957
name: b"addEventListener\0" as *const u8 as *const libc::c_char,
60-
call: JSNativeWrapper { op: Some(generic_method), info: ptr::null() },
58+
call: JSNativeWrapper { op: Some(generic_method), info: 0 as *const _ },
6159
nargs: 2,
6260
flags: JSPROP_ENUMERATE as u16,
6361
selfHostedName: 0 as *const libc::c_char
6462
},
6563
JSFunctionSpec {
6664
name: b"removeEventListener\0" as *const u8 as *const libc::c_char,
67-
call: JSNativeWrapper { op: Some(generic_method), info: ptr::null() },
65+
call: JSNativeWrapper { op: Some(generic_method), info: 0 as *const _ },
6866
nargs: 2,
6967
flags: JSPROP_ENUMERATE as u16,
7068
selfHostedName: 0 as *const libc::c_char
7169
},
7270
JSFunctionSpec {
7371
name: b"dispatchEvent\0" as *const u8 as *const libc::c_char,
74-
call: JSNativeWrapper { op: Some(generic_method), info: ptr::null() },
72+
call: JSNativeWrapper { op: Some(generic_method), info: 0 as *const _ },
7573
nargs: 1,
7674
flags: JSPROP_ENUMERATE as u16,
7775
selfHostedName: 0 as *const libc::c_char
7876
},
79-
JSFunctionSpec {
80-
name: ptr::null(),
81-
call: JSNativeWrapper { op: None, info: ptr::null() },
82-
nargs: 0,
83-
flags: 0,
84-
selfHostedName: ptr::null()
85-
}
77+
JSFunctionSpec::ZERO,
8678
];
8779

8880
static CLASS: JSClass = JSClass {

0 commit comments

Comments
 (0)