mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Fixed compile error in generated code, when webidl constructors have same number of args
Edited test webidl to show issue, and fix
This commit is contained in:
parent
875f1e92cc
commit
3e78b54d46
4 changed files with 25 additions and 5 deletions
|
@ -47,7 +47,7 @@ use js::jsapi::{HandleId, HandleObject, HandleValue, JS_GetClass};
|
|||
use js::jsapi::{JSClass, JSContext, JSObject, MutableHandleValue};
|
||||
use js::jsapi::{JS_GetLatin1StringCharsAndLength, JS_GetReservedSlot};
|
||||
use js::jsapi::{JS_GetObjectAsArrayBufferView, JS_GetArrayBufferViewType};
|
||||
use js::jsapi::{JS_GetTwoByteStringCharsAndLength, JS_NewStringCopyN};
|
||||
use js::jsapi::{JS_GetTwoByteStringCharsAndLength, JS_IsArrayObject, JS_NewStringCopyN};
|
||||
use js::jsapi::{JS_StringHasLatin1Chars, JS_WrapValue};
|
||||
use js::jsapi::{Type};
|
||||
use js::jsval::{ObjectValue, StringValue};
|
||||
|
@ -458,3 +458,10 @@ pub fn array_buffer_view_to_vec_checked<T: ArrayBufferViewContents>(abv: *mut JS
|
|||
array_buffer_view_data_checked(abv).map(|data| data.to_vec())
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether `value` is an array-like object.
|
||||
/// Note: Currently only Arrays are supported.
|
||||
/// TODO: Expand this to support sequences and other array-like objects
|
||||
pub unsafe fn is_array_like(cx: *mut JSContext, value: HandleValue) -> bool {
|
||||
JS_IsArrayObject(cx, value)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue