Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Mar 29, 2022
1 parent e9dff76 commit f163dc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions boa_engine/src/bytecompiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,11 @@ impl<'b> ByteCompiler<'b> {
Ok(has_identifier_argument)
}

/// This function compiles a class declaration or expression.
///
/// The compilation of a class declaration and expression is mostly equal.
/// A class declaration binds the resulting class object to it's identifier.
/// A class expression leaves the resulting class object on the stack for following operations.
fn class(&mut self, class: &Class, expression: bool) -> JsResult<()> {
let mut code = CodeBlock::new(class.name(), 0, true, true);
code.computed_field_names = Some(gc::GcCell::new(vec![]));
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/vm/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,14 @@ pub enum Opcode {
/// Stack: value, key, object **=>**
SetPropertyByValue,

/// Defines a class method by value.
/// Defines a own property of an object by value.
///
/// Operands:
///
/// Stack: object, key, value **=>**
DefineOwnPropertyByValue,

/// Defines a own property of an object by value.
/// Defines a class method by value.
///
/// Operands:
///
Expand Down

0 comments on commit f163dc8

Please sign in to comment.