Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lib.d.ts: Change the type of uriComponent (passed to encodeURIComponent) from string to string | number | boolean #31103

Merged
merged 1 commit into from Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/es5.d.ts
Expand Up @@ -60,7 +60,7 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
declare function encodeURIComponent(uriComponent: string | number | boolean): string;

/**
* Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/1.0lib-noErrors.js
Expand Up @@ -78,7 +78,7 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
declare function encodeURIComponent(uriComponent: string | number | boolean): string;

interface PropertyDescriptor {
configurable?: boolean;
Expand Down Expand Up @@ -1141,7 +1141,7 @@ declare var Array: {
<T>(...items: T[]): T[];
isArray(arg: any): boolean;
prototype: Array<any>;
}
}

//// [1.0lib-noErrors.js]
/* *****************************************************************************
Expand Down
11 changes: 6 additions & 5 deletions tests/baselines/reference/1.0lib-noErrors.symbols
Expand Up @@ -98,12 +98,12 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
>encodeURIComponent : Symbol(encodeURIComponent, Decl(1.0lib-noErrors.ts, 73, 48))
>uriComponent : Symbol(uriComponent, Decl(1.0lib-noErrors.ts, 79, 36))

interface PropertyDescriptor {
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 66))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 85))

configurable?: boolean;
>configurable : Symbol(PropertyDescriptor.configurable, Decl(1.0lib-noErrors.ts, 81, 30))
Expand All @@ -130,7 +130,7 @@ interface PropertyDescriptorMap {

[s: string]: PropertyDescriptor;
>s : Symbol(s, Decl(1.0lib-noErrors.ts, 91, 5))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 66))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 85))
}

interface Object {
Expand Down Expand Up @@ -217,7 +217,7 @@ declare var Object: {
>getOwnPropertyDescriptor : Symbol(getOwnPropertyDescriptor, Decl(1.0lib-noErrors.ts, 141, 32))
>o : Symbol(o, Decl(1.0lib-noErrors.ts, 149, 29))
>p : Symbol(p, Decl(1.0lib-noErrors.ts, 149, 36))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 66))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 85))

/**
* Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
Expand Down Expand Up @@ -250,7 +250,7 @@ declare var Object: {
>o : Symbol(o, Decl(1.0lib-noErrors.ts, 171, 19))
>p : Symbol(p, Decl(1.0lib-noErrors.ts, 171, 26))
>attributes : Symbol(attributes, Decl(1.0lib-noErrors.ts, 171, 37))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 66))
>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(1.0lib-noErrors.ts, 79, 85))

/**
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
Expand Down Expand Up @@ -2084,3 +2084,4 @@ declare var Array: {
>prototype : Symbol(prototype, Decl(1.0lib-noErrors.ts, 1140, 31))
>Array : Symbol(Array, Decl(1.0lib-noErrors.ts, 973, 23), Decl(1.0lib-noErrors.ts, 1133, 11))
}

7 changes: 4 additions & 3 deletions tests/baselines/reference/1.0lib-noErrors.types
Expand Up @@ -98,9 +98,9 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
>encodeURIComponent : (uriComponent: string) => string
>uriComponent : string
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
>encodeURIComponent : (uriComponent: string | number | boolean) => string
>uriComponent : string | number | boolean

interface PropertyDescriptor {
configurable?: boolean;
Expand Down Expand Up @@ -1911,3 +1911,4 @@ declare var Array: {
prototype: Array<any>;
>prototype : any[]
}

2 changes: 1 addition & 1 deletion tests/baselines/reference/parserRegularExpression4.types
Expand Up @@ -61,7 +61,7 @@ if (Ca.test(c.href) || Ba.test(c.href) && /(\\?|&)adurl=/.test(c.href) && !/(\\?
>"&q=" + encodeURIComponent(W("q") || W("as_q") || A) : string
>"&q=" : "&q="
>encodeURIComponent(W("q") || W("as_q") || A) : string
>encodeURIComponent : (uriComponent: string) => string
>encodeURIComponent : (uriComponent: string | number | boolean) => string
>W("q") || W("as_q") || A : any
>W("q") || W("as_q") : any
>W("q") : any
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/conformance/decorators/1.0lib-noErrors.ts
Expand Up @@ -78,7 +78,7 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
declare function encodeURIComponent(uriComponent: string | number | boolean): string;

interface PropertyDescriptor {
configurable?: boolean;
Expand Down Expand Up @@ -1141,4 +1141,4 @@ declare var Array: {
<T>(...items: T[]): T[];
isArray(arg: any): boolean;
prototype: Array<any>;
}
}
2 changes: 1 addition & 1 deletion tests/lib/lib.d.ts
Expand Up @@ -77,7 +77,7 @@ declare function encodeURI(uri: string): string;
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
*/
declare function encodeURIComponent(uriComponent: string): string;
declare function encodeURIComponent(uriComponent: string | number | boolean): string;

/**
* Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
Expand Down