Skip to content

Commit

Permalink
Revert "Proposed jsinterop support for records"
Browse files Browse the repository at this point in the history
This reverts commit cec646b.
  • Loading branch information
niloc132 committed Jun 1, 2024
1 parent 1ef40b2 commit 083450b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions dev/core/src/com/google/gwt/dev/javac/JsInteropUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.gwt.dev.jjs.ast.JMethod;
import com.google.gwt.dev.jjs.ast.JParameter;
import com.google.gwt.dev.jjs.ast.JPrimitiveType;
import com.google.gwt.dev.jjs.ast.JRecordType;
import com.google.gwt.thirdparty.guava.common.base.Joiner;
import com.google.gwt.thirdparty.guava.common.collect.Lists;

Expand Down Expand Up @@ -136,27 +135,12 @@ private static JsMemberType getJsMemberType(JMember member, boolean isPropertyAc
if (member instanceof JConstructor) {
return JsMemberType.CONSTRUCTOR;
}
if (isRecordAccessor((JMethod) member)) {
return JsMemberType.PROPERTY;
}
if (isPropertyAccessor) {
return getJsPropertyAccessorType((JMethod) member);
}
return JsMemberType.METHOD;
}

private static boolean isRecordAccessor(JMethod method) {
if (!method.getParams().isEmpty()) {
return false;
}
if (!(method.getEnclosingType() instanceof JRecordType)) {
return false;
}
return method.getEnclosingType().getFields().stream()
.anyMatch(f -> f.getName().equals(method.getName())
&& f.getType().equals(method.getType()));
}

private static JsMemberType getJsPropertyAccessorType(JMethod method) {
if (method.getParams().size() == 1 && method.getType() == JPrimitiveType.VOID) {
return JsMemberType.SETTER;
Expand Down

0 comments on commit 083450b

Please sign in to comment.