-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debt - declare more services via registerSingleton()
- Loading branch information
Showing
19 changed files
with
148 additions
and
137 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { isWindows, isMacintosh, setImmediate } from 'vs/base/common/platform'; | ||
|
||
interface IProcess { | ||
platform: string; | ||
env: object; | ||
|
||
cwd(): string; | ||
nextTick(callback: (...args: any[]) => void): number; | ||
} | ||
|
||
declare let process: IProcess; | ||
const safeProcess: IProcess = (typeof process === 'undefined') ? { | ||
cwd(): string { return '/'; }, | ||
env: Object.create(null), | ||
get platform(): string { return isWindows ? 'win32' : isMacintosh ? 'darwin' : 'linux'; }, | ||
nextTick(callback: (...args: any[]) => void): number { return setImmediate(callback); } | ||
} : process; | ||
|
||
export const cwd = safeProcess.cwd; | ||
export const env = safeProcess.env; | ||
export const platform = safeProcess.platform; | ||
export const nextTick = safeProcess.nextTick; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.