polyfills: sets Promise.prototype
This commit is contained in:
		
							parent
							
								
									fe350532ec
								
							
						
					
					
						commit
						994edfa22c
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -22,7 +22,7 @@ if (typeof Promise.withResolvers === "undefined") {
 | 
			
		|||
 | 
			
		||||
  // Promise.withResolvers is generic and works with subclasses - the typescript built-in decl
 | 
			
		||||
  // could not handle the subclassing case.
 | 
			
		||||
  Promise.withResolvers = function <T>(this: AnyPromiseConstructor<T>) {
 | 
			
		||||
  (Promise.prototype as any).withResolvers = function <T>(this: AnyPromiseConstructor<T>) {
 | 
			
		||||
    let resolve!: PromiseWithResolvers<T>["resolve"], reject!: PromiseWithResolvers<T>["reject"];
 | 
			
		||||
    // These variables are expected to be set after `new this()`
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue