Fix __filename on Windows.
This commit is contained in:
		
					parent
					
						
							
								5b12f80d01
							
						
					
				
			
			
				commit
				
					
						c04a9933cc
					
				
			
		
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -39,7 +39,11 @@ global.clearImmediate = timers.clearImmediate | ||||||
| 
 | 
 | ||||||
| # Set the __filename to the path of html file if it's file:// protocol. | # Set the __filename to the path of html file if it's file:// protocol. | ||||||
| if window.location.protocol is 'file:' | if window.location.protocol is 'file:' | ||||||
|   global.__filename = window.location.pathname |   global.__filename = | ||||||
|  |     if process.platform is 'win32' | ||||||
|  |       window.location.pathname.substr 1 | ||||||
|  |     else | ||||||
|  |       window.location.pathname | ||||||
|   global.__dirname = path.dirname global.__filename |   global.__dirname = path.dirname global.__filename | ||||||
| 
 | 
 | ||||||
|   # Also search for module under the html file. |   # Also search for module under the html file. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao