Skip to content

Commit

Permalink
avm2: Reword some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Feb 21, 2025
1 parent f4a5512 commit dbcb435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions core/src/avm2/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,9 @@ pub fn load_player_globals<'gc>(
// everything has to circularly reference everything else:
//
// - Object is an instance of itself, as well as its prototype
// - All other types are instances of Class, which is an instance of
// itself
// - All types are instances of Class, which is an instance of itself
// - Object has prototype methods, but creating them requires the Function
// class, and creating the Function class requires the Object class to exist
//
// Hence, this ridiculously complicated dance of classdef, type allocation,
// and partial initialization.
Expand Down
6 changes: 3 additions & 3 deletions core/src/avm2/globals/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use crate::avm2::value::Value;
use crate::avm2::{Error, Multiname, QName};
use crate::string::AvmString;

/// Implements `Object`'s instance initializer. This method is unreachable because
/// `Object` has a custom constructor (`object_constructor`).
/// Implements `Object`'s instance initializer.
fn instance_init<'gc>(
_activation: &mut Activation<'_, 'gc>,
_this: Value<'gc>,
Expand All @@ -20,7 +19,8 @@ fn instance_init<'gc>(
Ok(Value::Undefined)
}

/// Implements `Object`'s custom constructor.
/// Implements `Object`'s custom constructor, called when ActionScript code runs
/// `new Object(...)` directly.
fn object_constructor<'gc>(
activation: &mut Activation<'_, 'gc>,
args: &[Value<'gc>],
Expand Down

0 comments on commit dbcb435

Please sign in to comment.