Skip to content

Commit

Permalink
avm2: Add warning about method ordering on int and uint
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Feb 8, 2025
1 parent 6231421 commit a298358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/avm2/globals/int.as
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ package {

// These methods are unreachable. Calling a method on an Integer will
// lookup and call the method using `Number`'s vtable, not `int`'s.
// IMPORTANT: these methods must be kept in the same order as they are
// declared in Number.as. Otherwise the bytecode optimizer may emit a
// call to the wrong method when calling on an `int` or `uint`.
AS3 native function toExponential(digits:* = 0):String;

AS3 native function toFixed(digits:* = 0):String;
Expand Down
3 changes: 3 additions & 0 deletions core/src/avm2/globals/uint.as
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ package {

// These methods are unreachable. Calling a method on an Integer will
// lookup and call the method using `Number`'s vtable, not `uint`'s.
// IMPORTANT: these methods must be kept in the same order as they are
// declared in Number.as. Otherwise the bytecode optimizer may emit a
// call to the wrong method when calling on an `int` or `uint`.
AS3 native function toExponential(digits:* = 0):String;

AS3 native function toFixed(digits:* = 0):String;
Expand Down

0 comments on commit a298358

Please sign in to comment.