Browse Source

Copy instead of reference for CodeBlockFlags

tco
RageKnify 12 months ago
parent
commit
11fc090881
No known key found for this signature in database
  1. 12
      core/engine/src/vm/code_block.rs

12
core/engine/src/vm/code_block.rs

@ -79,27 +79,27 @@ bitflags! {
impl CodeBlockFlags { impl CodeBlockFlags {
/// Check if the function is traced. /// Check if the function is traced.
#[cfg(feature = "trace")] #[cfg(feature = "trace")]
pub(crate) fn traceable(&self) -> bool { pub(crate) fn traceable(self) -> bool {
self.contains(CodeBlockFlags::TRACEABLE) self.contains(CodeBlockFlags::TRACEABLE)
} }
/// Check if the function is a class constructor. /// 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) self.contains(CodeBlockFlags::IS_CLASS_CONSTRUCTOR)
} }
/// Check if the function is in strict mode. /// Check if the function is in strict mode.
pub(crate) fn strict(&self) -> bool { pub(crate) fn strict(self) -> bool {
self.contains(CodeBlockFlags::STRICT) self.contains(CodeBlockFlags::STRICT)
} }
/// Indicates if the function is an expression and has a binding identifier. /// 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) self.contains(CodeBlockFlags::HAS_BINDING_IDENTIFIER)
} }
/// Does this function have the `[[ClassFieldInitializerName]]` internal slot set to non-empty value. /// 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) self.contains(CodeBlockFlags::IN_CLASS_FIELD_INITIALIZER)
} }
/// Returns true if this function is a derived constructor. /// 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) self.contains(CodeBlockFlags::IS_DERIVED_CONSTRUCTOR)
} }
/// Returns true if this function an async function. /// Returns true if this function an async function.

Loading…
Cancel
Save