Angular: Support computed optional member expression (#14658)
This commit is contained in:
1 parent
20320a56e4
commit
02a50e5bb9
7 files changed
+184
-96
No files matched your search
@@ -334,10 +334,10 @@ printWidth: 80
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -354,6 +354,8 @@ printWidth: 80
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -366,6 +368,8 @@ printWidth: 80
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -410,14 +414,14 @@ printWidth: 80
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
@@ -466,6 +470,8 @@ printWidth: 80
|
||||
[target]="a"
|
||||
[target]="a // hello"
|
||||
[target]="a.b"
|
||||
[target]="a?.b"
|
||||
[target]="a?.[b]"
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]="a?.b()"
|
||||
[target]="a?.b"
|
||||
@@ -478,6 +484,8 @@ printWidth: 80
|
||||
(target)="(a); (b)"
|
||||
(event)="(0)"
|
||||
(event)="(a.b)"
|
||||
(event)="(a?.b)"
|
||||
(event)="(a?.[b])"
|
||||
(event)="(hello)"
|
||||
(event)="hello()"
|
||||
(event)="(a && b)"
|
||||
@@ -545,14 +553,14 @@ printWidth: 80
|
||||
test="{{ 'test' | translate }}"
|
||||
test="foo {{ invalid invalid }} bar {{ valid }} baz"
|
||||
test="foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz"
|
||||
i18n="Normal i18n text"
|
||||
i18n="
|
||||
@@ -605,10 +613,10 @@ printWidth: 80
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -625,6 +633,8 @@ printWidth: 80
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -637,6 +647,8 @@ printWidth: 80
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -681,14 +693,14 @@ printWidth: 80
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
@@ -737,6 +749,8 @@ printWidth: 80
|
||||
[target]="a"
|
||||
[target]="a // hello"
|
||||
[target]="a.b"
|
||||
[target]="a?.b"
|
||||
[target]="a?.[b]"
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]="a?.b()"
|
||||
[target]="a?.b"
|
||||
@@ -749,6 +763,8 @@ printWidth: 80
|
||||
(target)="(a); (b)"
|
||||
(event)="(0)"
|
||||
(event)="(a.b)"
|
||||
(event)="(a?.b)"
|
||||
(event)="(a?.[b])"
|
||||
(event)="(hello)"
|
||||
(event)="hello()"
|
||||
(event)="(a && b)"
|
||||
@@ -816,14 +832,14 @@ printWidth: 80
|
||||
test="{{ 'test' | translate }}"
|
||||
test="foo {{ invalid invalid }} bar {{ valid }} baz"
|
||||
test="foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz"
|
||||
i18n="Normal i18n text"
|
||||
i18n="
|
||||
@@ -875,10 +891,10 @@ printWidth: 1
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -895,6 +911,8 @@ printWidth: 1
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -907,6 +925,8 @@ printWidth: 1
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -951,14 +971,14 @@ printWidth: 1
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
@@ -1088,6 +1108,14 @@ printWidth: 1
|
||||
[target]="
|
||||
a.b
|
||||
"
|
||||
[target]="
|
||||
a?.b
|
||||
"
|
||||
[target]="
|
||||
a?.[
|
||||
b
|
||||
]
|
||||
"
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]="
|
||||
a?.b()
|
||||
@@ -1126,6 +1154,14 @@ printWidth: 1
|
||||
(event)="
|
||||
(a.b)
|
||||
"
|
||||
(event)="
|
||||
(a?.b)
|
||||
"
|
||||
(event)="
|
||||
(a?.[
|
||||
b
|
||||
])
|
||||
"
|
||||
(event)="
|
||||
(hello)
|
||||
"
|
||||
@@ -1323,16 +1359,16 @@ printWidth: 1
|
||||
valid
|
||||
}} baz"
|
||||
test="foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{
|
||||
valid
|
||||
}}
|
||||
|
||||
}}
|
||||
|
||||
baz"
|
||||
i18n="
|
||||
Normal
|
||||
@@ -1474,10 +1510,10 @@ trailingComma: "es5"
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -1494,6 +1530,8 @@ trailingComma: "es5"
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -1506,6 +1544,8 @@ trailingComma: "es5"
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -1550,14 +1590,14 @@ trailingComma: "es5"
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
@@ -1606,6 +1646,8 @@ trailingComma: "es5"
|
||||
[target]="a"
|
||||
[target]="a // hello"
|
||||
[target]="a.b"
|
||||
[target]="a?.b"
|
||||
[target]="a?.[b]"
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]="a?.b()"
|
||||
[target]="a?.b"
|
||||
@@ -1618,6 +1660,8 @@ trailingComma: "es5"
|
||||
(target)="(a); (b)"
|
||||
(event)="(0)"
|
||||
(event)="(a.b)"
|
||||
(event)="(a?.b)"
|
||||
(event)="(a?.[b])"
|
||||
(event)="(hello)"
|
||||
(event)="hello()"
|
||||
(event)="(a && b)"
|
||||
@@ -1685,14 +1729,14 @@ trailingComma: "es5"
|
||||
test="{{ 'test' | translate }}"
|
||||
test="foo {{ invalid invalid }} bar {{ valid }} baz"
|
||||
test="foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz"
|
||||
i18n="Normal i18n text"
|
||||
i18n="
|
||||
@@ -1745,10 +1789,10 @@ trailingComma: "none"
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -1765,6 +1809,8 @@ trailingComma: "none"
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -1777,6 +1823,8 @@ trailingComma: "none"
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -1821,14 +1869,14 @@ trailingComma: "none"
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
@@ -1877,6 +1925,8 @@ trailingComma: "none"
|
||||
[target]="a"
|
||||
[target]="a // hello"
|
||||
[target]="a.b"
|
||||
[target]="a?.b"
|
||||
[target]="a?.[b]"
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]="a?.b()"
|
||||
[target]="a?.b"
|
||||
@@ -1889,6 +1939,8 @@ trailingComma: "none"
|
||||
(target)="(a); (b)"
|
||||
(event)="(0)"
|
||||
(event)="(a.b)"
|
||||
(event)="(a?.b)"
|
||||
(event)="(a?.[b])"
|
||||
(event)="(hello)"
|
||||
(event)="hello()"
|
||||
(event)="(a && b)"
|
||||
@@ -1956,14 +2008,14 @@ trailingComma: "none"
|
||||
test="{{ 'test' | translate }}"
|
||||
test="foo {{ invalid invalid }} bar {{ valid }} baz"
|
||||
test="foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz"
|
||||
i18n="Normal i18n text"
|
||||
i18n="
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
[target]=" [ 1 ] "
|
||||
[target]=" { 'a' : 1 } "
|
||||
[target]=" { a : 1 } "
|
||||
[target]=" {
|
||||
[target]=" {
|
||||
trailingComma : 'notAllowed'
|
||||
}"
|
||||
[target]=" [
|
||||
[target]=" [
|
||||
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
|
||||
]"
|
||||
[target]=" true "
|
||||
@@ -33,6 +33,8 @@
|
||||
[target]=" a "
|
||||
[target]=" a // hello "
|
||||
[target]=" a . b "
|
||||
[target]=" a ?. b "
|
||||
[target]=" a ?. [b] "
|
||||
[target]=" javascript : 'hello world' "
|
||||
[target]=" a ?. b ( ) "
|
||||
[target]=" a ?. b "
|
||||
@@ -45,6 +47,8 @@
|
||||
(target)=" a ; b "
|
||||
(event)=" 0 "
|
||||
(event)=" a.b "
|
||||
(event)=" a ?.b "
|
||||
(event)=" a?.[ b] "
|
||||
(event)=" hello "
|
||||
(event)=" hello() "
|
||||
(event)=" a && b "
|
||||
@@ -89,14 +93,14 @@
|
||||
test='{{ "test" | translate }}'
|
||||
test='foo {{ invalid invalid }} bar {{ valid }} baz'
|
||||
test='foo
|
||||
|
||||
|
||||
{{ invalid
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
invalid }}
|
||||
|
||||
bar
|
||||
|
||||
{{ valid }}
|
||||
|
||||
baz'
|
||||
i18n="Normal i18n text"
|
||||
i18n="This is a very long internationalization description text, exceeding the configured print width, but could easily be formatted"
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`computed-optional-member-expression.ng - {"trailingComma":"none"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["__ng_interpolation"]
|
||||
printWidth: 80
|
||||
trailingComma: "none"
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
[
|
||||
a?.[0]
|
||||
]
|
||||
|
||||
=====================================output=====================================
|
||||
[a?.[0]]
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`logical-expression.ng - {"trailingComma":"none"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["__ng_interpolation"]
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[
|
||||
a?.[0]
|
||||
]
|
||||
Reference in new issue
Block a user