Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -89,7 +89,7 @@ impl ConstEval for Argument<'_> {

impl ConstEval for NewExpression<'_> {
fn const_eval(&self) -> ValueHint {
if is_new_array(self) || is_new_typed_array(self) {
if is_new_array(self) {
ValueHint::NewArray
} else if is_new_map_or_set(self) {
ValueHint::NewIterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ fn test() {
"[...arr.reduce((set, b) => set.add(b), new Set(iter))]",
// NOTE: we may want to consider this a violation in the future
"[...(foo ? new Set() : [])]",
// Issue: <https://github.com/oxc-project/oxc/issues/7936>
"[ ...Uint8Array([ 1, 2, 3 ]) ].map(byte => byte.toString())",
"[ ...new Uint8Array([ 1, 2, 3 ]) ].map(byte => byte.toString())",
];

let fail = vec![
Expand Down