Skip to content

Commit

Permalink
Revert added try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Jan 8, 2025
1 parent ed59ac4 commit 8441988
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1237,31 +1237,27 @@ public boolean visit(ReferenceExpression x, BlockScope blockScope) {

@Override
public boolean visit(LambdaExpression x, BlockScope blockScope) {
try {
// Fetch the variables 'captured' by this lambda
SyntheticArgumentBinding[] synthArgs = x.outerLocalVariables;
// Get the parameter names, captured locals + lambda arguments
String paramNames[] = computeCombinedParamNames(x, synthArgs);
SourceInfo info = makeSourceInfo(x);
// JDT synthesizes a method lambda$n(capture1, capture2, ..., lambda_arg1, lambda_arg2, ...)
// Here we create a JMethod from this
JMethod lambdaMethod = createMethodFromBinding(info, x.binding, paramNames);
// Because the lambda implementations is synthesized as a static method in the
// enclosing class, it needs to be adjusted if that class happens to be a JsType.
lambdaMethod.setJsMemberInfo(JsMemberType.NONE, null, null, false);
if (curClass.type.isJsNative()) {
lambdaMethod.setJsOverlay();
}
JMethodBody methodBody = new JMethodBody(info);
lambdaMethod.setBody(methodBody);
// We need to push this method on the stack as it introduces a scope, and
// expressions in the body need to lookup variable refs like parameters from it
pushMethodInfo(new MethodInfo(lambdaMethod, methodBody, x.scope));
pushLambdaExpressionLocalsIntoMethodScope(x, synthArgs, lambdaMethod);
// now the body of the lambda is processed
} catch (Throwable e) {
throw translateException(x, e);
}
// Fetch the variables 'captured' by this lambda
SyntheticArgumentBinding[] synthArgs = x.outerLocalVariables;
// Get the parameter names, captured locals + lambda arguments
String paramNames[] = computeCombinedParamNames(x, synthArgs);
SourceInfo info = makeSourceInfo(x);
// JDT synthesizes a method lambda$n(capture1, capture2, ..., lambda_arg1, lambda_arg2, ...)
// Here we create a JMethod from this
JMethod lambdaMethod = createMethodFromBinding(info, x.binding, paramNames);
// Because the lambda implementations is synthesized as a static method in the
// enclosing class, it needs to be adjusted if that class happens to be a JsType.
lambdaMethod.setJsMemberInfo(HasJsInfo.JsMemberType.NONE, null, null, false);
if (curClass.type.isJsNative()) {
lambdaMethod.setJsOverlay();
}
JMethodBody methodBody = new JMethodBody(info);
lambdaMethod.setBody(methodBody);
// We need to push this method on the stack as it introduces a scope, and
// expressions in the body need to lookup variable refs like parameters from it
pushMethodInfo(new MethodInfo(lambdaMethod, methodBody, x.scope));
pushLambdaExpressionLocalsIntoMethodScope(x, synthArgs, lambdaMethod);
// now the body of the lambda is processed
return true;
}

Expand Down

0 comments on commit 8441988

Please sign in to comment.