mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Address review comments. Fix union conversion result mistakes introduced in refactoring.
This commit is contained in:
parent
02d2ec5ccd
commit
232ca59708
5 changed files with 45 additions and 40 deletions
|
@ -879,6 +879,15 @@ pub fn throw_method_failed_with_details<T>(cx: *JSContext,
|
|||
return 0;
|
||||
}
|
||||
|
||||
pub fn throw_not_in_union(cx: *JSContext, names: &'static str) -> JSBool {
|
||||
assert!(unsafe { JS_IsExceptionPending(cx) } == 0);
|
||||
let message = format!("argument could not be converted to any of: {}", names);
|
||||
message.with_c_str(|string| {
|
||||
unsafe { ReportError(cx, string) };
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Execute arbitrary code with the JS GC enabled, then disable it afterwards.
|
||||
pub fn with_gc_enabled<R>(cx: *JSContext, f: || -> R) -> R {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue