Skip to content

Commit 9b884ef

Browse files
committed
Identify massive deopt
1 parent e87c74c commit 9b884ef

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/language/printer.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ const printDocASTReducer: ASTReducer<string> = {
137137
SchemaDefinition: {
138138
leave: ({ description, directives, operationTypes }) =>
139139
wrap('', description, '\n') +
140-
maybeJoin(
141-
['schema', maybeJoin(directives, ' '), block(operationTypes)],
142-
' ',
143-
),
140+
maybeJoin(['schema', join(directives, ' '), block(operationTypes)], ' '),
144141
},
145142

146143
OperationTypeDefinition: {
@@ -320,13 +317,9 @@ const printDocASTReducer: ASTReducer<string> = {
320317
* print all items together separated by separator if provided
321318
*/
322319
function maybeJoin(
323-
maybeArray: Maybe<ReadonlyArray<string | undefined>>,
320+
maybeArray: ReadonlyArray<string | undefined>,
324321
separator = '',
325322
): string {
326-
if (!maybeArray) {
327-
return '';
328-
}
329-
330323
const list = maybeArray.filter((x) => x);
331324
const listLength = list.length;
332325
let result = '';

src/language/visitor.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,7 @@ export function visit(
224224
}
225225
}
226226
} else {
227-
node = Object.defineProperties(
228-
{},
229-
Object.getOwnPropertyDescriptors(node),
230-
);
227+
node = { ...node };
231228
for (const [editKey, editValue] of edits) {
232229
node[editKey] = editValue;
233230
}

0 commit comments

Comments
 (0)