Skip to content

Commit

Permalink
chore: fix lint and format
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyboyQCD committed Nov 6, 2024
1 parent d287dc6 commit a84e045
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
1 change: 0 additions & 1 deletion core/engine/src/builtins/builder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use crate::{
js_string,
native_function::{NativeFunctionObject, NativeFunctionPointer},
Expand Down
9 changes: 8 additions & 1 deletion core/engine/src/builtins/iterable/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
//! Boa's implementation of ECMAScript's `IteratorRecord` and iterator prototype objects.

use crate::{
builtins::{BuiltInBuilder, IntrinsicObject}, context::intrinsics::Intrinsics, error::JsNativeError, js_string, object::JsObject, realm::Realm, symbol::JsSymbol, Context, JsResult, JsValue
builtins::{BuiltInBuilder, IntrinsicObject},
context::intrinsics::Intrinsics,
error::JsNativeError,
js_string,
object::JsObject,
realm::Realm,
symbol::JsSymbol,
Context, JsResult, JsValue,
};
use boa_gc::{Finalize, Trace};
use boa_profiler::Profiler;
Expand Down
20 changes: 15 additions & 5 deletions core/engine/src/builtins/regexp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,9 @@ impl RegExp {
// 3. If matchStr is the empty String, then
if match_str.is_empty() {
// a. Let thisIndex be ℝ(? ToLength(? Get(rx, "lastIndex"))).
let this_index = rx.get(js_string!("lastIndex"), context)?.to_length(context)?;
let this_index = rx
.get(js_string!("lastIndex"), context)?
.to_length(context)?;

// b. Let nextIndex be AdvanceStringIndex(S, thisIndex, fullUnicode).
let next_index = advance_string_index(&arg_str, this_index, full_unicode);
Expand Down Expand Up @@ -1313,10 +1315,14 @@ impl RegExp {
})?;

// 3. Let pattern be ? ToString(? Get(R, "source")).
let pattern = regexp.get(js_string!("source"), context)?.to_string(context)?;
let pattern = regexp
.get(js_string!("source"), context)?
.to_string(context)?;

// 4. Let flags be ? ToString(? Get(R, "flags")).
let flags = regexp.get(js_string!("flags"), context)?.to_string(context)?;
let flags = regexp
.get(js_string!("flags"), context)?
.to_string(context)?;

// 5. Let result be the string-concatenation of "/", pattern, "/", and flags.
// 6. Return result.
Expand Down Expand Up @@ -1352,7 +1358,9 @@ impl RegExp {
let c = regexp.species_constructor(StandardConstructors::regexp, context)?;

// 5. Let flags be ? ToString(? Get(R, "flags")).
let flags = regexp.get(js_string!("flags"), context)?.to_string(context)?;
let flags = regexp
.get(js_string!("flags"), context)?
.to_string(context)?;

// 6. Let matcher be ? Construct(C, « R, flags »).
let matcher = c.construct(&[this.clone(), flags.clone().into()], Some(&c), context)?;
Expand Down Expand Up @@ -1487,7 +1495,9 @@ impl RegExp {
// 2. If matchStr is the empty String, then
if match_str.is_empty() {
// a. Let thisIndex be ℝ(? ToLength(? Get(rx, "lastIndex"))).
let this_index = rx.get(js_string!("lastIndex"), context)?.to_length(context)?;
let this_index = rx
.get(js_string!("lastIndex"), context)?
.to_length(context)?;

// b. Let nextIndex be AdvanceStringIndex(S, thisIndex, fullUnicode).
let next_index = advance_string_index(&s, this_index, full_unicode);
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/object/builtins/jsmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl JsMap {
/// ```
/// # use boa_engine::{
/// # object::builtins::JsMap,
/// # Context, JsValue, JsResult, js_str
/// # Context, JsValue, JsResult, js_string
/// # };
/// # fn main() -> JsResult<()> {
/// # let context = &mut Context::default();
Expand Down
7 changes: 6 additions & 1 deletion core/engine/src/object/builtins/jsproxy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
//! A Rust API wrapper for the `Proxy` Builtin ECMAScript Object
use super::JsFunction;
use crate::{
builtins::Proxy, js_string, native_function::{NativeFunction, NativeFunctionPointer}, object::{FunctionObjectBuilder, JsObject}, value::TryFromJs, Context, JsNativeError, JsResult, JsValue
builtins::Proxy,
js_string,
native_function::{NativeFunction, NativeFunctionPointer},
object::{FunctionObjectBuilder, JsObject},
value::TryFromJs,
Context, JsNativeError, JsResult, JsValue,
};
use boa_gc::{Finalize, Trace};

Expand Down
5 changes: 4 additions & 1 deletion core/engine/src/value/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use crate::{
builtins::{
error::ErrorObject, map::ordered_map::OrderedMap, promise::PromiseState,
set::ordered_set::OrderedSet, Array, Promise,
}, js_string, property::PropertyDescriptor, JsError, JsString
},
js_string,
property::PropertyDescriptor,
JsError, JsString,
};
use std::borrow::Cow;

Expand Down

0 comments on commit a84e045

Please sign in to comment.