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
element.firstElementChild() doesn't cause an error #112
Comments
Actually, it looks like this is a global problem. I just picked EdgeData (because it's a simple class) and added |
Confirmed that them Royale compiler does not produce a compile-time error when attempting to call a getter or setter as a function. The Flex SDK produces the following compiler error:
|
…etter as a function and produces the same error as attempting to call a variable (references #112) Similar to the variable, this currently applies to primitive types only (like Number, Boolean, int, uint, and String).
Update. I've determined that there are actually two issues here.
The Flex SDK produces a compiler error in both cases. |
The commit looked like it was only for case 1 (getter/setter)? |
Correct. Another commit is on the way soon. |
It may be too early in the morning for me, but are you sure that the error shouldn't also be added for type Class? And what about XML and instances of classes? Bonus if you can output a warning for type Object and type * |
I checked the Flex SDK, and it does not output any errors or warnings when calling a variable of type If the variable has any other type, there's an error (at least for the types that I tested, which included XML and custom classes) |
I've determined that the Royale compiler used to be as strict as the Flex SDK compiler. However, it was made more lenient in commit 1152253. It seems that we needed a hack to allow jquery's $ to expose its own methods and also be called as a function. |
Well, if you have time, you are welcome to restore the old code and come up with a different solution for the JQuery issue. One possibility is that we should create a way to mark a typedef as "dynamic" (if there isn't already a way I didn't know about) which I think JQuery is. |
firstElementChild
is of type Element and I'd expect trying to call it as a function would cause a compiler errorcall to type is not a function.
but it compiles with no error.This is the full statement which doesn't get an error:
element.insertBefore(indicator.element,element.firstElementChild());
element
andindicator.element
are both of typeorg.apache.royale.core.WrappedHTMLElement
The text was updated successfully, but these errors were encountered: