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 XML.contains #16206

Merged
merged 7 commits into from
May 6, 2024
Merged

Conversation

cy-polo
Copy link
Contributor

@cy-polo cy-polo commented May 3, 2024

XML.contains() method implemented.

Test:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" creationComplete="init()">
	<mx:Script>
		<![CDATA[			
			private function init():void {
				var xml:XML = 
					<order>
						<item>Rice</item>
						<item>Kung Pao Shrimp</item>
					</order>;
				trace(xml.item[0].contains(<item>Rice</item>)); // true
				trace(xml.item[1].contains(<item>Kung Pao Shrimp</item>)); // true
				trace(xml.item[1].contains(<item>MSG</item>)); // false
			}
		]]>
	</mx:Script>
</mx:Application>

Copy link
Member

@sleepycatcoding sleepycatcoding left a comment

Choose a reason for hiding this comment

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

Thank you and welcome! 👋

core/src/avm2/object/xml_object.rs Outdated Show resolved Hide resolved
core/src/avm2/object/xml_object.rs Outdated Show resolved Hide resolved
Copy link
Member

@sleepycatcoding sleepycatcoding left a comment

Choose a reason for hiding this comment

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

Just a few last nits, otherwise LGTM.

core/src/avm2/globals/XML.as Outdated Show resolved Hide resolved
core/src/avm2/globals/XML.as Outdated Show resolved Hide resolved
@torokati44
Copy link
Member

Can I ask for the commit history to be cleaned up a bit before merging? 😊

@sleepycatcoding
Copy link
Member

sleepycatcoding commented May 6, 2024

Can I ask for the commit history to be cleaned up a bit before merging? 😊

I had the plan to squash it 😄

@sleepycatcoding sleepycatcoding changed the title avm2: Added XML.contains() method avm2: Implement XML.contains May 6, 2024
@sleepycatcoding sleepycatcoding enabled auto-merge (squash) May 6, 2024 17:37
@sleepycatcoding sleepycatcoding merged commit 0910df8 into ruffle-rs:master May 6, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants