Repository navigation
Rerun LKG to remove 'awaited' type - #37616
Merged
Merged
Conversation
Ron Buckton (rbuckton)
requested review from
Andrew Branch (andrewbranch) and
Wesley Wigham (weswigham)
March 26, 2020 03:16
Wesley Wigham (weswigham)
approved these changes
Mar 27, 2020
|
This commit removes the |
|
It seem that this was introduced in microsoft/TypeScript-DOM-lib-generator#831 |
|
This commit breaks the generateKey overloads in SubtleCrypto... I have no idea how to fix this... interface SubtleCrypto {
// AlgorithmIdentifier is too generic and masks other overloads. This definition should come last.
// Previous definition had only 'string' which was more specific and prevented other definitions from
// being hidden.
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
}This breaks compilation for this perfectly correct code: export const encAlgo: AesKeyGenParams = {
name: 'AES-CBC',
length: 128,
}
crypto.subtle
.generateKey(encAlgo, true, ['decrypt', 'encrypt']) // ==> THIS USES THE GENERIC OVERLOAD
// Symetric crypto: should see a CryptoKey
.then(cryptoKey => { // SEES cryptoKey as CryptoKey | CryptoKeyPair
crypto.subtle
.exportKey('raw', cryptoKey) // FAILS NOW
.then(keyBuffer => {
// ...
}, reject)
}, reject) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This regenerates the LKG in master now that we've reverted 'awaited'.