You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return value of JS_GetPropertyById is not checked, so an object with a getter that fails does not propagate the error. This may also be the case for other calls into SpiderMonkey, but I haven't checked for more.
For context, this is the WPT test that fails as a result of this:
test(()=>{assert_throws_js(()=>newTextDecoderStream('utf-8',{getfatal(){thrownewError();}}),'the constructor should throw');},'a throwing fatal member should cause the constructor to throw');
Note, the TextDecoderStream implementation is local to WinterJS and I put the test here just to illustrate the problem.
The text was updated successfully, but these errors were encountered:
@Redfire75369 the current implementation of get_as after fixing this issue causes conversion of null to Option<*mut JSObject> to fail. This is probably the correct implementation:
/// Gets the value at the given key of the [Object]. as a Rust type.
/// Returns [None] if the object does not contain the key or conversion to the Rust type fails.
pub fn get_as<'cx, K: ToPropertyKey<'cx>, T: FromValue<'cx>>(
&self, cx: &'cx Context, key: K, strict: bool, config: T::Config,
) -> Result<Option<T>> {
Ok(self.get(cx, key)?.and_then(|val| T::from_value(cx, &val, strict, config).ok()))
}
In the implementation of
ion::Object::get
:spiderfire/ion/src/object/object.rs
Lines 83 to 99 in 74a68bb
The return value of
JS_GetPropertyById
is not checked, so an object with a getter that fails does not propagate the error. This may also be the case for other calls into SpiderMonkey, but I haven't checked for more.For context, this is the WPT test that fails as a result of this:
Note, the
TextDecoderStream
implementation is local to WinterJS and I put the test here just to illustrate the problem.The text was updated successfully, but these errors were encountered: