New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Methods for ObjectOpResult #337
Conversation
mozjs/src/jsimpls.rs
Outdated
assert_ne!(self.code_, JS::ObjectOpResult_SpecialCodes::OkCode as usize); | ||
self.code_ = code as usize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does something different than the C++ API which asserts that the argument isn't JS::ObjectOpResult_SpecialCodes::OkCode
. Here you are asserting that the existing code isn't that.
From https://searchfox.org/mozilla-central/source/js/public/Class.h#123:
bool fail(uint32_t msg) {
MOZ_ASSERT(msg != OkCode);
code_ = msg;
return true;
}
mozjs/src/jsimpls.rs
Outdated
#[allow(non_snake_case)] | ||
pub fn failNoNamedSetter(&mut self) -> bool { | ||
assert!(self.code_ != JS::ObjectOpResult_SpecialCodes::OkCode as usize); | ||
assert_ne!(self.code_, ObjectOpResult_SpecialCodes::OkCode as usize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's the same issue here. This function can just be:
#[deprecated]
#[allow(non_snake_case)]
pub fn failNoNamedSetter(&mut self) -> bool {
self.fail_no_named_setter()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates.
Mapped ObjectOpResult::failNoNamedSetter to ObjectOpResult::fail_no_named_setter
bb676ed
to
60d1805
Compare
Is this normal to be merged without https://github.com/servo/mozjs/actions/runs/5890501581 finished and with PR checks failing? |
Methods are implemented according to https://searchfox.org/mozilla-central/source/js/public/Class.h#79-155 and https://searchfox.org/mozilla-central/source/js/src/jsapi.cpp#212-282.