Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm2: Implement Date using ActionScript #17727

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

evilpie
Copy link
Collaborator

@evilpie evilpie commented Sep 1, 2024

No description provided.


public static native function parse(param1:*):Number;

public static native function UTC(param1:*, param2:*, param3:* = 1, param4:* = 0, param5:* = 0, param6:* = 0, param7:* = 0, ... rest):Number;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually try to keep the naming from docs/playerglobal. These names do show up in exception messages (though currently not sure if this can happen in Ruffle, better have correct names just in case)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the name in the playerglobal.

core/src/avm2/globals/Date.as Show resolved Hide resolved
}
prototype.toString = function():String {
var d:Date = this;
return d.AS3::toString();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make sure that this generates proper bytecode? (I think it should, given globals.as, but let's make sure just in case)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't open this class in JPEXS. I did test that Date.prototype.toString.call() works. (But somehow it doesn't in Flash, which I don't understand)

@evilpie evilpie force-pushed the date-as branch 3 times, most recently from d2e825a to 25af1d6 Compare September 5, 2024 21:08
@evilpie evilpie marked this pull request as ready for review September 5, 2024 21:08
Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I don't think we need to worry about the weirdness with calling the prototype methods indirectly.

@evilpie evilpie enabled auto-merge (rebase) September 6, 2024 15:20
@evilpie evilpie merged commit 9fb669a into ruffle-rs:master Sep 6, 2024
16 of 17 checks passed
@Lord-McSweeney Lord-McSweeney added the A-avm2 Area: AVM2 (ActionScript 3) label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants