diff --git a/boa_engine/src/bytecompiler.rs b/boa_engine/src/bytecompiler.rs index 0dcac043eb1..c3c5a41337e 100644 --- a/boa_engine/src/bytecompiler.rs +++ b/boa_engine/src/bytecompiler.rs @@ -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![])); diff --git a/boa_engine/src/vm/opcode.rs b/boa_engine/src/vm/opcode.rs index 019c216bd47..4bce1bc3431 100644 --- a/boa_engine/src/vm/opcode.rs +++ b/boa_engine/src/vm/opcode.rs @@ -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: ///