forked from mirrors/gecko-dev
		
	Bug 1877940 - Enable remaining ESLint rules on dom/messagechannel. r=dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D200280
This commit is contained in:
		
							parent
							
								
									5a0f9d9b3a
								
							
						
					
					
						commit
						e610a51084
					
				
					 5 changed files with 9 additions and 10 deletions
				
			
		|  | @ -445,7 +445,6 @@ module.exports = { | |||
|         "dom/html/test/**", | ||||
|         "dom/media/webaudio/test/**", | ||||
|         "dom/media/webrtc/tests/**", | ||||
|         "dom/messagechannel/tests/**", | ||||
|         "dom/payments/test/**", | ||||
|         "dom/performance/tests/**", | ||||
|         "dom/quota/test/browser/**", | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ function ok(condition, message) { | |||
|   debug("condition: " + condition + ", " + message + "\n"); | ||||
|   if (!condition) { | ||||
|     sendAsyncMessage("mmMessagePort:fail", { message }); | ||||
|     throw "failed check: " + message; | ||||
|     throw new Error("failed check: " + message); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -59,15 +59,15 @@ function compare(a, b) { | |||
|     ok (a !== b, 'They should not match'); | ||||
| 
 | ||||
|     var aProps = []; | ||||
|     for (var p in a) aProps.push(p); | ||||
|     for (let p in a) aProps.push(p); | ||||
| 
 | ||||
|     var bProps = []; | ||||
|     for (var p in b) bProps.push(p); | ||||
|     for (let p in b) bProps.push(p); | ||||
| 
 | ||||
|     is (aProps.length, bProps.length, 'Props match'); | ||||
|     is (aProps.sort().toString(), bProps.sort().toString(), 'Prop names match'); | ||||
| 
 | ||||
|     for (var p in a) { | ||||
|     for (let p in a) { | ||||
|       compare(a[p], b[p]); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -39,13 +39,13 @@ function test_fullDeliveredMessages() { | |||
|   var mc = new MessageChannel(); | ||||
|   worker.postMessage(42, [mc.port2]); | ||||
| 
 | ||||
|   for (var i = 0; i < MAX; ++i) { | ||||
|   for (let i = 0; i < MAX; ++i) { | ||||
|     mc.port1.postMessage(i); | ||||
|   } | ||||
| 
 | ||||
|   mc.port1.close(); | ||||
| 
 | ||||
|   for (var i = 0; i < MAX * 2; ++i) { | ||||
|   for (let i = 0; i < MAX * 2; ++i) { | ||||
|     mc.port1.postMessage(i); | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -18,14 +18,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=677638 | |||
| 
 | ||||
|   var a = new MessageChannel(); | ||||
| 
 | ||||
|   var status = false; | ||||
|   var messageStatus = false; | ||||
|   try { | ||||
|     a.port1.postMessage('foobar', [a.port1]); | ||||
|   } catch(e) { | ||||
|     status =true; | ||||
|     messageStatus = true; | ||||
|   } | ||||
| 
 | ||||
|   ok(status, "Transfering the same port should throw"); | ||||
|   ok(messageStatus, "Transfering the same port should throw"); | ||||
| 
 | ||||
|   </script> | ||||
| </body> | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Mark Banner
						Mark Banner