Created
November 20, 2017 22:18
-
-
Save Xanewok/cd65f70bde06c4bc2a43948f2ea224ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[test] | |
| fn sequence_rooter() { | |
| let rt = Runtime_::new().unwrap(); | |
| let cx = rt.cx(); | |
| JS_SetGCZeal(rt, 2, 1); | |
| unsafe { | |
| rooted!(in(cx) let global = | |
| JS_NewGlobalObject(cx, &SIMPLE_GLOBAL_CLASS, ptr::null_mut(), | |
| OnNewGlobalHookOption::FireOnNewGlobalHook, | |
| &CompartmentOptions::default()) | |
| ); | |
| { | |
| let mut rval = UndefinedValue(); | |
| let handle = unsafe { | |
| MutableHandle::from_marked_location(&mut rval) | |
| }; | |
| //rooted!(in(cx) let mut rval = UndefinedValue()); | |
| assert!(rt.evaluate_script(global.handle(), "new Uint8Array([0, 2, 4])", | |
| "test", 1, handle).is_ok()); | |
| ::std::thread::sleep_ms(15000) ; | |
| assert!(!rval.is_undefined()); | |
| assert!(rval.is_object()); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment