Skip to content

Commit

Permalink
Copy instead of reference for CodeBlockFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
RageKnify committed Dec 7, 2023
1 parent a7da92a commit 11fc090
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/engine/src/vm/code_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,27 @@ bitflags! {
impl CodeBlockFlags {
/// Check if the function is traced.
#[cfg(feature = "trace")]
pub(crate) fn traceable(&self) -> bool {
pub(crate) fn traceable(self) -> bool {
self.contains(CodeBlockFlags::TRACEABLE)
}
/// Check if the function is a class constructor.
pub(crate) fn is_class_constructor(&self) -> bool {
pub(crate) fn is_class_constructor(self) -> bool {
self.contains(CodeBlockFlags::IS_CLASS_CONSTRUCTOR)
}
/// Check if the function is in strict mode.
pub(crate) fn strict(&self) -> bool {
pub(crate) fn strict(self) -> bool {
self.contains(CodeBlockFlags::STRICT)
}
/// Indicates if the function is an expression and has a binding identifier.
pub(crate) fn has_binding_identifier(&self) -> bool {
pub(crate) fn has_binding_identifier(self) -> bool {
self.contains(CodeBlockFlags::HAS_BINDING_IDENTIFIER)
}
/// Does this function have the `[[ClassFieldInitializerName]]` internal slot set to non-empty value.
pub(crate) fn in_class_field_initializer(&self) -> bool {
pub(crate) fn in_class_field_initializer(self) -> bool {
self.contains(CodeBlockFlags::IN_CLASS_FIELD_INITIALIZER)
}
/// Returns true if this function is a derived constructor.
pub(crate) fn is_derived_constructor(&self) -> bool {
pub(crate) fn is_derived_constructor(self) -> bool {
self.contains(CodeBlockFlags::IS_DERIVED_CONSTRUCTOR)
}
/// Returns true if this function an async function.
Expand Down

0 comments on commit 11fc090

Please sign in to comment.