camc314 authored and Cameron Clark committed 2026-01-25 15:08:46 -05:00
1 parent 34c3ec30d3
commit 866b6b3edd
4 files changed
+318 -318

No files matched your search

+1 -1
View File
@@ -794,7 +794,7 @@ pub fn rest_element_property_name(span: Span) -> OxcDiagnostic {
#[cold]
pub fn a_rest_element_cannot_have_an_initializer(span: Span) -> OxcDiagnostic {
OxcDiagnostic::error("A rest element cannot have an initializer.").with_label(span)
ts_error("1048", "A rest element cannot have an initializer.").with_label(span)
}
#[cold]
+4 -4
View File
@@ -4148,7 +4148,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ────
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[babel/packages/babel-parser/test/fixtures/es2015/uncategorised/278/input.js:1:18]
1 │ function f(a, ...b = 0)
· ─────
@@ -5663,7 +5663,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ─────
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/22/input.js:1:9]
1 │ var {...x = 1} = {}
· ─────
@@ -5676,7 +5676,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
╰────
help: Expected identifier in rest element
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/23/input.js:1:19]
1 │ function test({...x = 1}) {}
· ─────
@@ -11877,7 +11877,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ────
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[babel/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0260/input.js:1:15]
1 │ function x(...a = 1){}
· ─────
File diff suppressed because it is too large. Load diff
@@ -10144,7 +10144,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Remove this `?`. The default value is an empty array
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[typescript/tests/cases/compiler/restParamAsOptional.ts:2:16]
1 │ function f(...x?) { }
2 │ function f2(...x = []) { }
@@ -10175,7 +10175,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
· ────
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[typescript/tests/cases/compiler/restParameterWithBindingPattern3.ts:3:19]
2 │
3 │ function b(...[...foo = []]: string[]) { }
@@ -16142,7 +16142,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Remove this `?`. The default value is an empty array
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[typescript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts:15:16]
14 │ function a3(...b?) { } // Error, can't be optional
15 │ function a4(...b = [1,2,3]) { } // Error, can't have initializer
@@ -16490,7 +16490,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
· ─────
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[typescript/tests/cases/conformance/es6/destructuring/restElementWithInitializer1.ts:2:9]
1 │ declare var a: number[];
2 │ var [...x = a] = a; // Error, rest element cannot have initializer
@@ -22715,7 +22715,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
3 │ }
╰────
× A rest element cannot have an initializer.
× TS(1048): A rest element cannot have an initializer.
╭─[typescript/tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList10.ts:2:11]
1 │ class C {
2 │ foo(...bar = 0) { }