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

cast is only performed as a check #46

Open
johanvos opened this issue Aug 14, 2021 · 0 comments
Open

cast is only performed as a check #46

johanvos opened this issue Aug 14, 2021 · 0 comments

Comments

@johanvos
Copy link
Contributor

This code

    public static void superProcessCSS(Node node) {
        ((ParentHelper) getHelper(node)).superProcessCSSImpl(node);
    }

get transpiled into

    m = c.superProcessCSS__VLjavafx_scene_Node_2 = function(lcA0) {
var stA0 = c.getHelper__Lcom_sun_javafx_scene_NodeHelper_2Ljavafx_scene_Node_2(lcA0);
if (stA0 !== null && !stA0['$instOf_com_sun_javafx_scene_ParentHelper']) vm.java_lang_Class(false).castEx(stA0, 'com.sun.javafx.scene.ParentHelper');
stA0.superProcessCSSImpl__VLjavafx_scene_Node_2(lcA0);
return;
};

The value of stA0 is initially (correctly) assigned to an instance of ControlHelper which extends ParentHelper. When the object is casted to a (ParentHelper), the method invocation should use the method body from the ParentHelper, and not that of the ControlHelper.

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

No branches or pull requests

1 participant