mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-12-26 00:59:28 -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:
parent
66bb1716a8
commit
91bec8216a
2 changed files with 11 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue