From 11fc090881e6f4ccb122f16f39b1b158b69a1f54 Mon Sep 17 00:00:00 2001 From: RageKnify Date: Thu, 7 Dec 2023 00:04:16 +0000 Subject: [PATCH] Copy instead of reference for CodeBlockFlags --- core/engine/src/vm/code_block.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/engine/src/vm/code_block.rs b/core/engine/src/vm/code_block.rs index f236fc988d..b7b4ef7225 100644 --- a/core/engine/src/vm/code_block.rs +++ b/core/engine/src/vm/code_block.rs @@ -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.