Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
9e81c8f2
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9e81c8f2
编写于
10月 01, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "debt - remove declaration for WinJS.Promise#any"
This reverts commit
61a2faf7
.
上级
706ada46
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
8 addition
and
8 deletion
+8
-8
src/vs/base/common/winjs.base.d.ts
src/vs/base/common/winjs.base.d.ts
+2
-0
src/vs/base/common/winjs.polyfill.promise.ts
src/vs/base/common/winjs.polyfill.promise.ts
+1
-5
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+2
-0
src/vs/platform/launch/electron-main/launchService.ts
src/vs/platform/launch/electron-main/launchService.ts
+1
-1
src/vs/workbench/api/node/extHostQuickOpen.ts
src/vs/workbench/api/node/extHostQuickOpen.ts
+2
-2
未找到文件。
src/vs/base/common/winjs.base.d.ts
浏览文件 @
9e81c8f2
...
...
@@ -23,6 +23,8 @@ export class Promise<T = any> {
public
static
join
<
T1
,
T2
>
(
promises
:
[
T1
|
PromiseLike
<
T1
>
,
T2
|
PromiseLike
<
T2
>
]):
Promise
<
[
T1
,
T2
]
>
;
public
static
join
<
T
>
(
promises
:
(
T
|
PromiseLike
<
T
>
)[]):
Promise
<
T
[]
>
;
public
static
any
<
T
>
(
promises
:
(
T
|
PromiseLike
<
T
>
)[]):
Promise
<
{
key
:
string
;
value
:
Promise
<
T
>
;
}
>
;
public
static
wrap
<
T
>
(
value
:
T
|
PromiseLike
<
T
>
):
Promise
<
T
>
;
public
static
wrapError
<
T
=
never
>
(
error
:
Error
):
Promise
<
T
>
;
...
...
src/vs/base/common/winjs.polyfill.promise.ts
浏览文件 @
9e81c8f2
...
...
@@ -11,10 +11,6 @@ function isWinJSPromise(candidate: any): candidate is WinJSPromise {
return
isThenable
(
candidate
)
&&
typeof
(
candidate
as
any
).
done
===
'
function
'
;
}
declare
class
WinJSPromiseRemovals
{
any
<
T
=
any
>
(
promises
:
(
T
|
PromiseLike
<
T
>
)[]):
WinJSPromise
<
{
key
:
string
;
value
:
WinJSPromise
<
T
>
;
}
>
;
}
/**
* A polyfill for the native promises. The implementation is based on
* WinJS promises but tries to gap differences between winjs promises
...
...
@@ -37,7 +33,7 @@ export class PolyfillPromise<T = any> implements Promise<T> {
static
race
(
thenables
:
Thenable
<
any
>
[]):
PolyfillPromise
{
// WinJSPromise returns `{ key: <index/key>, value: <promise> }`
// from the `any` call and Promise.race just wants the value
return
new
PolyfillPromise
(
(
WinJSPromise
as
any
as
WinJSPromiseRemovals
)
.
any
(
thenables
).
then
(
entry
=>
entry
.
value
,
err
=>
err
.
value
));
return
new
PolyfillPromise
(
WinJSPromise
.
any
(
thenables
).
then
(
entry
=>
entry
.
value
,
err
=>
err
.
value
));
}
static
resolve
(
value
):
PolyfillPromise
{
...
...
src/vs/monaco.d.ts
浏览文件 @
9e81c8f2
...
...
@@ -55,6 +55,8 @@ declare namespace monaco {
public
static
join
<
T1
,
T2
>
(
promises
:
[
T1
|
PromiseLike
<
T1
>
,
T2
|
PromiseLike
<
T2
>
]):
Promise
<
[
T1
,
T2
]
>
;
public
static
join
<
T
>
(
promises
:
(
T
|
PromiseLike
<
T
>
)[]):
Promise
<
T
[]
>
;
public
static
any
<
T
>
(
promises
:
(
T
|
PromiseLike
<
T
>
)[]):
Promise
<
{
key
:
string
;
value
:
Promise
<
T
>
;
}
>
;
public
static
wrap
<
T
>
(
value
:
T
|
PromiseLike
<
T
>
):
Promise
<
T
>
;
public
static
wrapError
<
T
=
never
>
(
error
:
Error
):
Promise
<
T
>
;
...
...
src/vs/platform/launch/electron-main/launchService.ts
浏览文件 @
9e81c8f2
...
...
@@ -234,7 +234,7 @@ export class LaunchService implements ILaunchService {
// is being used and only then resolve the startup promise which will kill this second instance.
// In addition, we poll for the wait marker file to be deleted to return.
if
(
args
.
wait
&&
usedWindows
.
length
===
1
&&
usedWindows
[
0
])
{
return
Promise
.
race
([
return
TPromise
.
any
([
this
.
windowsMainService
.
waitForWindowCloseOrLoad
(
usedWindows
[
0
].
id
),
whenDeleted
(
args
.
waitMarkerFilePath
)
]).
then
(()
=>
void
0
,
()
=>
void
0
);
...
...
src/vs/workbench/api/node/extHostQuickOpen.ts
浏览文件 @
9e81c8f2
...
...
@@ -54,8 +54,8 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
canPickMany
:
options
&&
options
.
canPickMany
},
token
);
return
Promise
.
race
(
<
Thenable
<
false
|
Item
[]
>
[]
>
[
quickPickWidget
.
then
(()
=>
false
),
itemsPromise
]).
then
(
value
=>
{
if
(
value
===
false
)
{
return
TPromise
.
any
(
<
TPromise
<
number
|
Item
[]
>
[]
>
[
quickPickWidget
,
itemsPromise
]).
then
(
values
=>
{
if
(
value
s
.
key
===
'
0
'
)
{
return
undefined
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录