Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c788fcca
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c788fcca
编写于
3月 02, 2020
作者:
J
Johannes Rieken
提交者:
GitHub
3月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #91896 from microsoft/joh/no-polyfill-promise
remove polyfill promise
上级
2a12c9a4
02f23e56
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
1 addition
and
333 deletion
+1
-333
.eslintignore
.eslintignore
+0
-1
build/gulpfile.editor.js
build/gulpfile.editor.js
+1
-1
build/gulpfile.hygiene.js
build/gulpfile.hygiene.js
+0
-1
src/vs/editor/common/standalone/promise-polyfill/cgmanifest.json
...editor/common/standalone/promise-polyfill/cgmanifest.json
+0
-17
src/vs/editor/common/standalone/promise-polyfill/polyfill.js
src/vs/editor/common/standalone/promise-polyfill/polyfill.js
+0
-291
src/vs/editor/common/standalone/promise-polyfill/polyfill.license.txt
...r/common/standalone/promise-polyfill/polyfill.license.txt
+0
-20
src/vs/editor/common/standalone/standaloneBase.ts
src/vs/editor/common/standalone/standaloneBase.ts
+0
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+0
-1
未找到文件。
.eslintignore
浏览文件 @
c788fcca
...
...
@@ -3,7 +3,6 @@
**/vs/css.build.js
**/vs/css.js
**/vs/loader.js
**/promise-polyfill/**
**/insane/**
**/marked/**
**/test/**/*.js
...
...
build/gulpfile.editor.js
浏览文件 @
c788fcca
...
...
@@ -73,7 +73,7 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
extrausages
],
shakeLevel
:
2
,
// 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern
:
/
(
^vs
\/
css!
)
|
(
promise-polyfill
\/
polyfill
)
/
,
importIgnorePattern
:
/
(
^vs
\/
css!
)
/
,
destRoot
:
path
.
join
(
root
,
'
out-editor-src
'
),
redirects
:
[]
});
...
...
build/gulpfile.hygiene.js
浏览文件 @
c788fcca
...
...
@@ -114,7 +114,6 @@ const copyrightFilter = [
'
!**/*.disabled
'
,
'
!**/*.code-workspace
'
,
'
!**/*.js.map
'
,
'
!**/promise-polyfill/polyfill.js
'
,
'
!build/**/*.init
'
,
'
!resources/linux/snap/snapcraft.yaml
'
,
'
!resources/linux/snap/electron-launch
'
,
...
...
src/vs/editor/common/standalone/promise-polyfill/cgmanifest.json
已删除
100644 → 0
浏览文件 @
2a12c9a4
{
"registrations"
:
[
{
"component"
:
{
"type"
:
"git"
,
"git"
:
{
"name"
:
"promise-polyfill"
,
"repositoryUrl"
:
"https://github.com/taylorhakes/promise-polyfill"
,
"commitHash"
:
"efe662be6ea569c439ec92a4f8662c0a7faf0b96"
}
},
"license"
:
"MIT"
,
"version"
:
"8.0.0"
}
],
"version"
:
1
}
src/vs/editor/common/standalone/promise-polyfill/polyfill.js
已删除
100644 → 0
浏览文件 @
2a12c9a4
/*!
Copyright (c) 2014 Taylor Hakes
Copyright (c) 2014 Forbes Lindesay
*/
(
function
(
global
,
factory
)
{
typeof
exports
===
'
object
'
&&
typeof
module
!==
'
undefined
'
?
factory
()
:
typeof
define
===
'
function
'
&&
define
.
amd
?
define
(
factory
)
:
(
factory
());
}(
this
,
(
function
()
{
'
use strict
'
;
/**
* @this {Promise}
*/
function
finallyConstructor
(
callback
)
{
var
constructor
=
this
.
constructor
;
return
this
.
then
(
function
(
value
)
{
return
constructor
.
resolve
(
callback
()).
then
(
function
()
{
return
value
;
});
},
function
(
reason
)
{
return
constructor
.
resolve
(
callback
()).
then
(
function
()
{
return
constructor
.
reject
(
reason
);
});
}
);
}
// Store setTimeout reference so promise-polyfill will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var
setTimeoutFunc
=
setTimeout
;
function
noop
()
{
}
// Polyfill for Function.prototype.bind
function
bind
(
fn
,
thisArg
)
{
return
function
()
{
fn
.
apply
(
thisArg
,
arguments
);
};
}
/**
* @constructor
* @param {Function} fn
*/
function
Promise
(
fn
)
{
if
(
!
(
this
instanceof
Promise
))
throw
new
TypeError
(
'
Promises must be constructed via new
'
);
if
(
typeof
fn
!==
'
function
'
)
throw
new
TypeError
(
'
not a function
'
);
/** @type {!number} */
this
.
_state
=
0
;
/** @type {!boolean} */
this
.
_handled
=
false
;
/** @type {Promise|undefined} */
this
.
_value
=
undefined
;
/** @type {!Array<!Function>} */
this
.
_deferreds
=
[];
doResolve
(
fn
,
this
);
}
function
handle
(
self
,
deferred
)
{
while
(
self
.
_state
===
3
)
{
self
=
self
.
_value
;
}
if
(
self
.
_state
===
0
)
{
self
.
_deferreds
.
push
(
deferred
);
return
;
}
self
.
_handled
=
true
;
Promise
.
_immediateFn
(
function
()
{
var
cb
=
self
.
_state
===
1
?
deferred
.
onFulfilled
:
deferred
.
onRejected
;
if
(
cb
===
null
)
{
(
self
.
_state
===
1
?
resolve
:
reject
)(
deferred
.
promise
,
self
.
_value
);
return
;
}
var
ret
;
try
{
ret
=
cb
(
self
.
_value
);
}
catch
(
e
)
{
reject
(
deferred
.
promise
,
e
);
return
;
}
resolve
(
deferred
.
promise
,
ret
);
});
}
function
resolve
(
self
,
newValue
)
{
try
{
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if
(
newValue
===
self
)
throw
new
TypeError
(
'
A promise cannot be resolved with itself.
'
);
if
(
newValue
&&
(
typeof
newValue
===
'
object
'
||
typeof
newValue
===
'
function
'
)
)
{
var
then
=
newValue
.
then
;
if
(
newValue
instanceof
Promise
)
{
self
.
_state
=
3
;
self
.
_value
=
newValue
;
finale
(
self
);
return
;
}
else
if
(
typeof
then
===
'
function
'
)
{
doResolve
(
bind
(
then
,
newValue
),
self
);
return
;
}
}
self
.
_state
=
1
;
self
.
_value
=
newValue
;
finale
(
self
);
}
catch
(
e
)
{
reject
(
self
,
e
);
}
}
function
reject
(
self
,
newValue
)
{
self
.
_state
=
2
;
self
.
_value
=
newValue
;
finale
(
self
);
}
function
finale
(
self
)
{
if
(
self
.
_state
===
2
&&
self
.
_deferreds
.
length
===
0
)
{
Promise
.
_immediateFn
(
function
()
{
if
(
!
self
.
_handled
)
{
Promise
.
_unhandledRejectionFn
(
self
.
_value
);
}
});
}
for
(
var
i
=
0
,
len
=
self
.
_deferreds
.
length
;
i
<
len
;
i
++
)
{
handle
(
self
,
self
.
_deferreds
[
i
]);
}
self
.
_deferreds
=
null
;
}
/**
* @constructor
*/
function
Handler
(
onFulfilled
,
onRejected
,
promise
)
{
this
.
onFulfilled
=
typeof
onFulfilled
===
'
function
'
?
onFulfilled
:
null
;
this
.
onRejected
=
typeof
onRejected
===
'
function
'
?
onRejected
:
null
;
this
.
promise
=
promise
;
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function
doResolve
(
fn
,
self
)
{
var
done
=
false
;
try
{
fn
(
function
(
value
)
{
if
(
done
)
return
;
done
=
true
;
resolve
(
self
,
value
);
},
function
(
reason
)
{
if
(
done
)
return
;
done
=
true
;
reject
(
self
,
reason
);
}
);
}
catch
(
ex
)
{
if
(
done
)
return
;
done
=
true
;
reject
(
self
,
ex
);
}
}
Promise
.
prototype
[
'
catch
'
]
=
function
(
onRejected
)
{
return
this
.
then
(
null
,
onRejected
);
};
Promise
.
prototype
.
then
=
function
(
onFulfilled
,
onRejected
)
{
// @ts-ignore
var
prom
=
new
this
.
constructor
(
noop
);
handle
(
this
,
new
Handler
(
onFulfilled
,
onRejected
,
prom
));
return
prom
;
};
Promise
.
prototype
[
'
finally
'
]
=
finallyConstructor
;
Promise
.
all
=
function
(
arr
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
!
arr
||
typeof
arr
.
length
===
'
undefined
'
)
throw
new
TypeError
(
'
Promise.all accepts an array
'
);
var
args
=
Array
.
prototype
.
slice
.
call
(
arr
);
if
(
args
.
length
===
0
)
return
resolve
([]);
var
remaining
=
args
.
length
;
function
res
(
i
,
val
)
{
try
{
if
(
val
&&
(
typeof
val
===
'
object
'
||
typeof
val
===
'
function
'
))
{
var
then
=
val
.
then
;
if
(
typeof
then
===
'
function
'
)
{
then
.
call
(
val
,
function
(
val
)
{
res
(
i
,
val
);
},
reject
);
return
;
}
}
args
[
i
]
=
val
;
if
(
--
remaining
===
0
)
{
resolve
(
args
);
}
}
catch
(
ex
)
{
reject
(
ex
);
}
}
for
(
var
i
=
0
;
i
<
args
.
length
;
i
++
)
{
res
(
i
,
args
[
i
]);
}
});
};
Promise
.
resolve
=
function
(
value
)
{
if
(
value
&&
typeof
value
===
'
object
'
&&
value
.
constructor
===
Promise
)
{
return
value
;
}
return
new
Promise
(
function
(
resolve
)
{
resolve
(
value
);
});
};
Promise
.
reject
=
function
(
value
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
reject
(
value
);
});
};
Promise
.
race
=
function
(
values
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
for
(
var
i
=
0
,
len
=
values
.
length
;
i
<
len
;
i
++
)
{
values
[
i
].
then
(
resolve
,
reject
);
}
});
};
// Use polyfill for setImmediate for performance gains
Promise
.
_immediateFn
=
(
typeof
setImmediate
===
'
function
'
&&
function
(
fn
)
{
setImmediate
(
fn
);
})
||
function
(
fn
)
{
setTimeoutFunc
(
fn
,
0
);
};
Promise
.
_unhandledRejectionFn
=
function
_unhandledRejectionFn
(
err
)
{
if
(
typeof
console
!==
'
undefined
'
&&
console
)
{
console
.
warn
(
'
Possible Unhandled Promise Rejection:
'
,
err
);
// eslint-disable-line no-console
}
};
/** @suppress {undefinedVars} */
var
globalNS
=
(
function
()
{
// the only reliable means to get the global object is
// `Function('return this')()`
// However, this causes CSP violations in Chrome apps.
if
(
typeof
self
!==
'
undefined
'
)
{
return
self
;
}
if
(
typeof
window
!==
'
undefined
'
)
{
return
window
;
}
if
(
typeof
global
!==
'
undefined
'
)
{
return
global
;
}
throw
new
Error
(
'
unable to locate global object
'
);
})();
if
(
!
(
'
Promise
'
in
globalNS
))
{
globalNS
[
'
Promise
'
]
=
Promise
;
}
else
if
(
!
globalNS
.
Promise
.
prototype
[
'
finally
'
])
{
globalNS
.
Promise
.
prototype
[
'
finally
'
]
=
finallyConstructor
;
}
})));
src/vs/editor/common/standalone/promise-polyfill/polyfill.license.txt
已删除
100644 → 0
浏览文件 @
2a12c9a4
Copyright (c) 2014 Taylor Hakes
Copyright (c) 2014 Forbes Lindesay
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
src/vs/editor/common/standalone/standaloneBase.ts
浏览文件 @
c788fcca
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
'
vs/editor/common/standalone/promise-polyfill/polyfill
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
KeyChord
,
KeyMod
as
ConstKeyMod
}
from
'
vs/base/common/keyCodes
'
;
...
...
src/vs/monaco.d.ts
浏览文件 @
c788fcca
...
...
@@ -381,7 +381,6 @@ declare namespace monaco {
*/
MAX_VALUE
=
112
}
export
class
KeyMod
{
static
readonly
CtrlCmd
:
number
;
static
readonly
Shift
:
number
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录