Skip to content

Instantly share code, notes, and snippets.

View hipitihop's full-sized avatar
🇦🇺

hipitihop

🇦🇺
  • Queensland,Australia
  • 23:18 (UTC +10:00)
View GitHub Profile
@hipitihop
hipitihop / transform-as-hasOwnProperty
Last active January 3, 2016 15:19
In Actionscript you can test for the existence of a property in an object by using the syntax someObject.hasOwnProperty("somePropertyName"); However the preferred syntax is "somePropertyName" in someObject. This regular expression/replacement can be used in your favourite editor/ide which supports regular expressions for search/replace like Inte…
search: /(\w*)\.hasOwnProperty\((['|"]\w*['|"])\)/
replace: $2 in $1
You can verify and test the regular expression here:
http://regex101.com/r/pL3iV5/#debugger