cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 160 forks source link

Single argument insertBefore is invalid #676

Open rendaw opened 3 years ago

rendaw commented 3 years ago

For example

public class ThingA {
  public static void m() {
    HTMLDivElement e = null;
    e.insertBefore(null);
  }
}

produces the error expected 2 arguments, but got 1

lgrignon commented 3 years ago

FYI core API is also fully open source and you can PR an improvment anytime of those definitions: https://github.com/cincheo/jsweet/blob/develop/core-lib/es6/src/main/java/def/dom/Node.java#L26

It seems indeed that this insertBefore method definition could benefit an overload.

Please feel free to PR, I will review/merge it in no time