forked from mirrors/gecko-dev
		
	 02dda268a6
			
		
	
	
		02dda268a6
		
	
	
	
	
		
			
			There's a lot of history in this area that mostly explains why this has not been supported in the past, leading to several awkward workarounds in tests. But it doesn't appear that there's any reason to prevent tests from creating actual command lines, so that's what we allow here. I've elected to flesh out `Cu.createCommandLine` rather than expose `.init(..._)` directly since `Cu.createCommandLine` is already used in the relevant tests and is only used in tests. And I've made the arguments required, rather than optional, so that consumers think about the arguments, in particular `state`. Differential Revision: https://phabricator.services.mozilla.com/D132089
		
			
				
	
	
		
			10 lines
		
	
	
	
		
			194 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
	
		
			194 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| function run_test() {
 | |
|   var cmdLine = Cu.createCommandLine(
 | |
|     [],
 | |
|     null,
 | |
|     Ci.nsICommandLine.STATE_INITIAL_LAUNCH
 | |
|   );
 | |
|   try {
 | |
|     cmdLine.getArgument(cmdLine.length);
 | |
|   } catch (e) {}
 | |
| }
 |