Skip to content

Commit

Permalink
Apply review pt. 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Oct 2, 2022
1 parent 2e2d218 commit 682a72b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion boa_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
clippy::needless_pass_by_value,
clippy::match_wildcard_for_single_variants,
clippy::map_unwrap_or,
clippy::missing_inline_in_public_items,
unused_qualifications,
unused_import_braces,
unused_lifetimes,
Expand All @@ -61,7 +62,6 @@
clippy::missing_panics_doc,
clippy::too_many_lines,
clippy::unreadable_literal,
clippy::missing_inline_in_public_items,
clippy::cognitive_complexity,
clippy::must_use_candidate,
clippy::missing_errors_doc,
Expand Down
4 changes: 4 additions & 0 deletions boa_engine/src/syntax/ast/expression/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub struct PrivatePropertyAccess {

impl PrivatePropertyAccess {
/// Creates a `GetPrivateField` AST Expression.
#[inline]
pub fn new(value: Expression, field: Sym) -> Self {
Self {
target: value.into(),
Expand All @@ -142,14 +143,17 @@ impl PrivatePropertyAccess {
}

/// Gets the original object from where to get the field from.
#[inline]
pub fn target(&self) -> &Expression {
&self.target
}

/// Gets the name of the field to retrieve.
#[inline]
pub fn field(&self) -> Sym {
self.field
}

#[inline]
pub(crate) fn contains_arguments(&self) -> bool {
self.target.contains_arguments()
Expand Down
1 change: 1 addition & 0 deletions boa_engine/src/syntax/ast/expression/await.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct Await {

impl Await {
/// Return the expression that should be awaited.
#[inline]
pub(crate) fn expr(&self) -> &Expression {
&self.expr
}
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/syntax/ast/expression/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Call {

impl Call {
/// Creates a new `Call` AST Expression.
#[inline]
pub fn new(target: Expression, args: Box<[Expression]>) -> Self {
Self {
target: target.into(),
Expand All @@ -34,11 +35,13 @@ impl Call {
}

/// Gets the name of the function call.
#[inline]
pub fn expr(&self) -> &Expression {
&self.target
}

/// Retrieves the arguments passed to the function.
#[inline]
pub fn args(&self) -> &[Expression] {
&self.args
}
Expand Down
13 changes: 7 additions & 6 deletions boa_engine/src/syntax/ast/expression/literal/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#[cfg(test)]
mod tests;

use crate::syntax::ast::expression::Expression;
use crate::syntax::ast::ContainsSymbol;

use crate::syntax::ast::property::MethodDefinition;
use crate::syntax::ast::property::PropertyDefinition;
use crate::syntax::ast::{block_to_string, join_nodes};
use crate::syntax::ast::{
block_to_string,
expression::Expression,
join_nodes,
property::{MethodDefinition, PropertyDefinition},
ContainsSymbol,
};
use boa_interner::{Interner, ToInternedString};

/// Objects in JavaScript may be defined as an unordered collection of related data, of
Expand Down

0 comments on commit 682a72b

Please sign in to comment.