joshtynjala commented on issue #203:
URL: https://github.com/apache/royale-compiler/issues/203#issuecomment-998991552
> toString and indexOf:
I'll look into these.
> I don't think hasOwnProperty ever needs to be quoted. Here value is an
array of objects, but value in this case is actually types as an Object instead
of an Array. I don't know if that makes a difference.
Usually, when [] square bracket syntax is used, the returned value is
considered to be of type `*` by the AS3 compiler. This applies to using square
brackets with both arrays and objects. I think that `Vector` is the one
exception when the type should be known at compile time when using square
brackets. So technically, the compiler is behaving as expected here.
Assigning to a variable of type `Object` should be enough to let the
compiler know that `hasOwnProperty()` and other `Object` methods are available:
```
var currentValue:Object = value[i];
if(currentValue.hasOwnProperty("selected")){
```
I'm wary to upgrade `*` to `Object` automatically when resolving
dynamic-access-unknown-members. It should be safe most of the time, but there
may be edge cases that I haven't remembered yet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]