File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -285,18 +285,15 @@ class CoreTypesUtil {
285285 /// Cast the [invocation] if needed to conform to the expected [returnType] .
286286 Expression castInvocationForReturn (
287287 Expression invocation, DartType returnType) {
288- if (returnType is VoidType ) {
288+ Expression expression;
289+ if (returnType is VoidType || isJSValueType (returnType)) {
289290 // Technically a `void` return value can still be used, by casting the
290291 // return type to `dynamic` or `Object?`. However this case should be
291292 // extremely rare, and `dartifyRaw` overhead for return values that will
292293 // never be used in practice is too much, so we avoid `dartifyRaw` on
293294 // `void` returns. We still box the `externref` as the value can be passed
294295 // around as a Dart object.
295- return StaticInvocation (jsValueBoxTarget, Arguments ([invocation]));
296- }
297296
298- Expression expression;
299- if (isJSValueType (returnType)) {
300297 // TODO(joshualitt): Expose boxed `JSNull` and `JSUndefined` to Dart
301298 // code after migrating existing users of js interop on Dart2Wasm.
302299 // expression = _createJSValue(invocation);
You can’t perform that action at this time.
0 commit comments