0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-24 15:19:31 -05:00

fix: mispelling in C binding (#1439)

Fixing a mistake I made in #1428.

Added some tests as well.
This commit is contained in:
Bartek Iwańczuk 2024-03-16 03:32:28 +00:00 committed by GitHub
parent 66bb1716a8
commit 91bec8216a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -203,7 +203,7 @@ extern "C" {
context: *const Context,
key: *const Name,
) -> *const Value;
fn v8__Object__GetRealNamedPropertyAttribute(
fn v8__Object__GetRealNamedPropertyAttributes(
this: *const Object,
context: *const Context,
key: *const Name,
@ -870,7 +870,7 @@ impl Object {
) -> Option<PropertyAttribute> {
let mut out = Maybe::<PropertyAttribute>::default();
unsafe {
v8__Object__GetRealNamedPropertyAttribute(
v8__Object__GetRealNamedPropertyAttributes(
self,
&*scope.get_current_context(),
&*key,

View file

@ -6966,6 +6966,15 @@ fn get_property_attributes() {
assert!(!attrs.is_dont_enum());
assert!(!attrs.is_dont_delete());
assert!(attrs.is_none());
let real_prop = obj.get_real_named_property(scope, key.into()).unwrap();
assert!(real_prop.is_number());
let real_prop_attrs = obj
.get_real_named_property_attributes(scope, key.into())
.unwrap();
assert!(!real_prop_attrs.is_read_only());
assert!(!real_prop_attrs.is_dont_enum());
assert!(!real_prop_attrs.is_dont_delete());
assert!(real_prop_attrs.is_none());
// doesn't exist
let key = v8::String::new(scope, "b").unwrap();