Skip to content

Commit dbcb435

Browse files
Lord-McSweeneyLord-McSweeney
Lord-McSweeney
authored andcommitted
avm2: Reword some comments
1 parent f4a5512 commit dbcb435

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

core/src/avm2/globals.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ pub fn load_player_globals<'gc>(
441441
// everything has to circularly reference everything else:
442442
//
443443
// - Object is an instance of itself, as well as its prototype
444-
// - All other types are instances of Class, which is an instance of
445-
// itself
444+
// - All types are instances of Class, which is an instance of itself
445+
// - Object has prototype methods, but creating them requires the Function
446+
// class, and creating the Function class requires the Object class to exist
446447
//
447448
// Hence, this ridiculously complicated dance of classdef, type allocation,
448449
// and partial initialization.

core/src/avm2/globals/object.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use crate::avm2::value::Value;
1010
use crate::avm2::{Error, Multiname, QName};
1111
use crate::string::AvmString;
1212

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

23-
/// Implements `Object`'s custom constructor.
22+
/// Implements `Object`'s custom constructor, called when ActionScript code runs
23+
/// `new Object(...)` directly.
2424
fn object_constructor<'gc>(
2525
activation: &mut Activation<'_, 'gc>,
2626
args: &[Value<'gc>],

0 commit comments

Comments
 (0)