Print empty member lookup (#1506)
I have no idea if it's even valid but it threw on 8 typescript tests, now it doesn't. ```js TypeError: Cannot read property 'type' of null at printMemberLookup (prettier/src/printer.js:3062:16) ```master
parent
1fca1eeddf
commit
1a1e6fc1dd
|
@ -3063,6 +3063,7 @@ function printMemberLookup(path, options, print) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
!n.property ||
|
||||||
(n.property.type === "Literal" && typeof n.property.value === "number") ||
|
(n.property.type === "Literal" && typeof n.property.value === "number") ||
|
||||||
n.property.type === "NumericLiteral"
|
n.property.type === "NumericLiteral"
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`badArrayIndex.ts 1`] = `
|
||||||
|
var results = number[];
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
var results = number[];
|
||||||
|
|
||||||
|
`;
|
|
@ -0,0 +1 @@
|
||||||
|
var results = number[];
|
|
@ -0,0 +1 @@
|
||||||
|
run_spec(__dirname, { parser: "typescript" });
|
Loading…
Reference in New Issue