Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tunz committed Feb 18, 2023
1 parent 7913263 commit 45e1e12
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions boa_engine/src/object/internal_methods/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ pub(crate) fn array_exotic_define_own_property(
context: &mut Context<'_>,
) -> JsResult<bool> {
// 1. Assert: IsPropertyKey(P) is true.
match key {
match *key {
// 2. If P is "length", then
&PropertyKey::String(ref s) if s == utf16!("length") => {
PropertyKey::String(ref s) if s == utf16!("length") => {
// a. Return ? ArraySetLength(A, Desc).

array_set_length(obj, desc, context)
}
// 3. Else if P is an array index, then
&PropertyKey::Index(index) if index < u32::MAX => {
PropertyKey::Index(index) if index < u32::MAX => {
// a. Let oldLenDesc be OrdinaryGetOwnProperty(A, "length").
let old_len_desc =
super::ordinary_get_own_property(obj, &utf16!("length").into(), context)?
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/object/internal_methods/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ pub(crate) fn global_define_own_property(
) -> JsResult<bool> {
let _timer = Profiler::global().start_event("Object::global_define_own_property", "object");
// 1. Let current be ? O.[[GetOwnProperty]](P).
let current = global_get_own_property(obj, &key, context)?;
let current = global_get_own_property(obj, key, context)?;

// 2. Let extensible be ? IsExtensible(O).
let extensible = obj.__is_extensible__(context)?;

// 3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current).
Ok(validate_and_apply_property_descriptor(
&key, extensible, desc, current, context,
key, extensible, desc, current, context,
))
}

Expand Down
6 changes: 3 additions & 3 deletions boa_engine/src/object/internal_methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ pub(crate) fn ordinary_define_own_property(
) -> JsResult<bool> {
let _timer = Profiler::global().start_event("Object::ordinary_define_own_property", "object");
// 1. Let current be ? O.[[GetOwnProperty]](P).
let current = obj.__get_own_property__(&key, context)?;
let current = obj.__get_own_property__(key, context)?;

// 2. Let extensible be ? IsExtensible(O).
let extensible = obj.__is_extensible__(context)?;
Expand Down Expand Up @@ -782,7 +782,7 @@ pub(crate) fn validate_and_apply_property_descriptor(

if let Some((obj, key)) = obj_and_key {
obj.borrow_mut().properties.insert(
&key,
key,
// c. If IsGenericDescriptor(Desc) is true or IsDataDescriptor(Desc) is true, then
if desc.is_generic_descriptor() || desc.is_data_descriptor() {
// i. If O is not undefined, create an own data property named P of
Expand Down Expand Up @@ -899,7 +899,7 @@ pub(crate) fn validate_and_apply_property_descriptor(
// a. For each field of Desc that is present, set the corresponding attribute of the
// property named P of object O to the value of the field.
current.fill_with(&desc);
obj.borrow_mut().properties.insert(&key, current);
obj.borrow_mut().properties.insert(key, current);
}

// 10. Return true.
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/object/internal_methods/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ pub(crate) fn proxy_exotic_define_own_property(
}

// 10. Let targetDesc be ? target.[[GetOwnProperty]](P).
let target_desc = target.__get_own_property__(&key, context)?;
let target_desc = target.__get_own_property__(key, context)?;

// 11. Let extensibleTarget be ? IsExtensible(target).
let extensible_target = target.is_extensible(context)?;
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/object/internal_methods/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub(crate) fn string_exotic_define_own_property(
) -> JsResult<bool> {
// 1. Assert: IsPropertyKey(P) is true.
// 2. Let stringDesc be ! StringGetOwnProperty(S, P).
let string_desc = string_get_own_property(obj, &key);
let string_desc = string_get_own_property(obj, key);

// 3. If stringDesc is not undefined, then
if let Some(string_desc) = string_desc {
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ pub(crate) trait JsObjectType:
}

/// Const `constructor`, usually set on prototypes as a key to point to their respective constructor object.
pub const CONSTRUCTOR: &'static [u16] = utf16!("constructor");
pub const CONSTRUCTOR: &[u16] = utf16!("constructor");

/// Const `prototype`, usually set on constructors as a key to point to their respective prototype object.
pub const PROTOTYPE: &'static [u16] = utf16!("prototype");
pub const PROTOTYPE: &[u16] = utf16!("prototype");

/// Common field names.
Expand Down

0 comments on commit 45e1e12

Please sign in to comment.