Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3081,6 +3081,7 @@ function isReorderableExpression(
return true;
}
}
case 'TSInstantiationExpression':
Comment thread
zekariasasaminew marked this conversation as resolved.
Outdated
case 'RegExpLiteral':
case 'StringLiteral':
case 'NumericLiteral':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

## Input

```javascript
declare function id<T>(x: T): T;

export function test<T = string>(value = id<string>('hi')) {
return value;
}

export const FIXTURE_ENTRYPOINT = {
fn: test,
params: [],
isComponent: false,
};

```

## Code

```javascript
import { c as _c } from "react/compiler-runtime";
declare function id<T>(x: T): T;

export function test(t0) {
const $ = _c(2);
let t1;
if ($[0] !== t0) {
t1 = t0 === undefined ? id("hi") : t0;
$[0] = t0;
$[1] = t1;
} else {
t1 = $[1];
}
const value = t1;
return value;
}

export const FIXTURE_ENTRYPOINT = {
fn: test,
params: [],
isComponent: false,
};

```

### Eval output
(kind: exception) id is not defined
Comment thread
zekariasasaminew marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
declare function id<T>(x: T): T;

export function test<T = string>(value = id<string>('hi')) {
Comment thread
zekariasasaminew marked this conversation as resolved.
Outdated
return value;
}

export const FIXTURE_ENTRYPOINT = {
fn: test,
params: [],
isComponent: false,
};