Skip to content

Commit 3145656

Browse files
Orta Theroxorta
authored andcommitted
Merge branch 'master' of https://github.com/microsoft/typescript into 30246
2 parents f1a0a7f + 36aa101 commit 3145656

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

src/lib/es2015.core.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ interface RegExp {
373373
}
374374

375375
interface RegExpConstructor {
376-
new (pattern: RegExp, flags?: string): RegExp;
377-
(pattern: RegExp, flags?: string): RegExp;
376+
new (pattern: RegExp | string, flags?: string): RegExp;
377+
(pattern: RegExp | string, flags?: string): RegExp;
378378
}
379379

380380
interface String {

src/services/goToDefinition.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace ts.GoToDefinition {
2626
if (!symbol) {
2727
return getDefinitionInfoForIndexSignatures(node, typeChecker);
2828
}
29-
29+
3030
const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node);
3131
// Don't go to the component constructor definition for a JSX element, just go to the component definition.
3232
if (calledDeclaration && !(isJsxOpeningLikeElement(node.parent) && isConstructorLike(calledDeclaration))) {
@@ -235,8 +235,7 @@ namespace ts.GoToDefinition {
235235
function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node): DefinitionInfo[] | undefined {
236236
// There are cases when you extend a function by adding properties to it afterwards,
237237
// we want to strip those extra properties
238-
const filteredDeclarations = symbol.declarations.filter(d => !ts.isAssignmentDeclaration(d) || d === symbol.valueDeclaration)
239-
238+
const filteredDeclarations = filter(symbol.declarations, d => !isAssignmentDeclaration(d) || d === symbol.valueDeclaration) || undefined;
240239
return getConstructSignatureDefinition() || getCallSignatureDefinition() || map(filteredDeclarations, declaration => createDefinitionInfo(declaration, typeChecker, symbol, node));
241240

242241
function getConstructSignatureDefinition(): DefinitionInfo[] | undefined {

tests/baselines/reference/user/TypeScript-React-Native-Starter.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Standard output:
33
node_modules/@types/react-native/index.d.ts(3425,42): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.
44
node_modules/@types/react-native/index.d.ts(3438,42): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.
55
node_modules/@types/react-native/index.d.ts(8745,18): error TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.
6-
node_modules/@types/react/index.d.ts(378,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.
6+
node_modules/@types/react/index.d.ts(377,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.
77

88

99

tests/baselines/reference/user/uglify-js.log

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ node_modules/uglify-js/lib/compress.js(4229,45): error TS2554: Expected 0 argume
4545
node_modules/uglify-js/lib/compress.js(4340,33): error TS2554: Expected 0 arguments, but got 1.
4646
node_modules/uglify-js/lib/compress.js(4638,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'.
4747
node_modules/uglify-js/lib/compress.js(4722,37): error TS2554: Expected 0 arguments, but got 1.
48-
node_modules/uglify-js/lib/compress.js(4930,57): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[RegExp, (string | undefined)?]'.
49-
Property '0' is missing in type 'any[]' but required in type '[RegExp, (string | undefined)?]'.
48+
node_modules/uglify-js/lib/compress.js(4930,57): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[string | RegExp, (string | undefined)?]'.
49+
Property '0' is missing in type 'any[]' but required in type '[string | RegExp, (string | undefined)?]'.
5050
node_modules/uglify-js/lib/compress.js(5094,45): error TS2554: Expected 0 arguments, but got 1.
5151
node_modules/uglify-js/lib/compress.js(5101,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'code' must be of type 'string', but here has type '{ get: () => string; toString: () => string; indent: () => void; indentation: () => number; current_width: () => number; should_break: () => boolean; has_parens: () => boolean; newline: () => void; print: (str: any) => void; ... 24 more ...; parent: (n: any) => any; }'.
5252
node_modules/uglify-js/lib/compress.js(5105,36): error TS2532: Object is possibly 'undefined'.

tests/cases/fourslash/goToDefinitionPropertyAssignment.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@
88
//// Component.[|/*PropertyClick*/displayName|]
99

1010
verify.goToDefinition("FunctionClick", "FunctionResult")
11-
1211
verify.goToDefinition("PropertyClick", "PropertyResult")
13-
14-
// export const Component = () => { return "OK"}
15-
// Component.displayName = 'Component'
16-

0 commit comments

Comments
 (0)