Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6607a81c
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,发现更多精彩内容 >>
提交
6607a81c
编写于
8月 22, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - do not use deprecated Buffer() ctor
上级
0bae8679
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
8 addition
and
8 deletion
+8
-8
build/gulpfile.editor.js
build/gulpfile.editor.js
+1
-1
src/vs/base/node/zip.ts
src/vs/base/node/zip.ts
+1
-1
src/vs/base/parts/ipc/node/ipc.ts
src/vs/base/parts/ipc/node/ipc.ts
+2
-2
src/vs/base/parts/ipc/test/node/ipc.net.test.ts
src/vs/base/parts/ipc/test/node/ipc.net.test.ts
+1
-1
src/vs/workbench/common/extensionHostProtocol.ts
src/vs/workbench/common/extensionHostProtocol.ts
+1
-1
src/vs/workbench/services/extensions/node/rpcProtocol.ts
src/vs/workbench/services/extensions/node/rpcProtocol.ts
+1
-1
test/smoke/src/main.ts
test/smoke/src/main.ts
+1
-1
未找到文件。
build/gulpfile.editor.js
浏览文件 @
6607a81c
...
...
@@ -202,7 +202,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
this
.
emit
(
'
data
'
,
new
File
({
path
:
data
.
path
.
replace
(
/monaco
\.
d
\.
ts/
,
'
editor.api.d.ts
'
),
base
:
data
.
base
,
contents
:
new
Buffer
(
toExternalDTS
(
data
.
contents
.
toString
()))
contents
:
Buffer
.
from
(
toExternalDTS
(
data
.
contents
.
toString
()))
}));
}))
.
pipe
(
gulp
.
dest
(
'
out-monaco-editor-core/esm/vs/editor
'
)),
...
...
src/vs/base/node/zip.ts
浏览文件 @
6607a81c
...
...
@@ -177,7 +177,7 @@ export interface IFile {
export
function
zip
(
zipPath
:
string
,
files
:
IFile
[]):
TPromise
<
string
>
{
return
new
TPromise
<
string
>
((
c
,
e
)
=>
{
const
zip
=
new
yazl
.
ZipFile
();
files
.
forEach
(
f
=>
f
.
contents
?
zip
.
addBuffer
(
typeof
f
.
contents
===
'
string
'
?
new
Buffer
(
f
.
contents
,
'
utf8
'
)
:
f
.
contents
,
f
.
path
)
:
zip
.
addFile
(
f
.
localPath
,
f
.
path
));
files
.
forEach
(
f
=>
f
.
contents
?
zip
.
addBuffer
(
typeof
f
.
contents
===
'
string
'
?
Buffer
.
from
(
f
.
contents
,
'
utf8
'
)
:
f
.
contents
,
f
.
path
)
:
zip
.
addFile
(
f
.
localPath
,
f
.
path
));
zip
.
end
();
const
zipStream
=
createWriteStream
(
zipPath
);
...
...
src/vs/base/parts/ipc/node/ipc.ts
浏览文件 @
6607a81c
...
...
@@ -111,7 +111,7 @@ enum BodyType {
Object
}
const
empty
=
new
Buffer
(
0
);
const
empty
=
Buffer
.
allocUnsafe
(
0
);
function
serializeBody
(
body
:
any
):
{
buffer
:
Buffer
,
type
:
BodyType
}
{
if
(
typeof
body
===
'
undefined
'
)
{
...
...
@@ -126,7 +126,7 @@ function serializeBody(body: any): { buffer: Buffer, type: BodyType } {
}
function
serialize
(
header
:
any
,
body
:
any
=
undefined
):
Buffer
{
const
headerSizeBuffer
=
new
Buffer
(
4
);
const
headerSizeBuffer
=
Buffer
.
allocUnsafe
(
4
);
const
{
buffer
:
bodyBuffer
,
type
:
bodyType
}
=
serializeBody
(
body
);
const
headerBuffer
=
Buffer
.
from
(
JSON
.
stringify
([
header
,
bodyType
]));
headerSizeBuffer
.
writeUInt32BE
(
headerBuffer
.
byteLength
,
0
);
...
...
src/vs/base/parts/ipc/test/node/ipc.net.test.ts
浏览文件 @
6607a81c
...
...
@@ -60,7 +60,7 @@ suite('IPC, Socket Protocol', () => {
assert
.
equal
(
data
.
readInt8
(
0
),
123
);
resolve
(
null
);
});
const
buffer
=
new
Buffer
(
1
);
const
buffer
=
Buffer
.
allocUnsafe
(
1
);
buffer
.
writeInt8
(
123
,
0
);
a
.
send
(
buffer
);
});
...
...
src/vs/workbench/common/extensionHostProtocol.ts
浏览文件 @
6607a81c
...
...
@@ -12,7 +12,7 @@ export enum MessageType {
}
export
function
createMessageOfType
(
type
:
MessageType
):
Buffer
{
const
result
=
new
Buffer
(
1
);
const
result
=
Buffer
.
allocUnsafe
(
1
);
switch
(
type
)
{
case
MessageType
.
Initialized
:
result
.
writeUInt8
(
1
,
0
);
break
;
...
...
src/vs/workbench/services/extensions/node/rpcProtocol.ts
浏览文件 @
6607a81c
...
...
@@ -311,7 +311,7 @@ class RPCMultiplexer {
private
_sendAccumulated
():
void
{
const
size
=
this
.
_messagesToSend
.
reduce
((
r
,
b
)
=>
r
+
4
+
b
.
byteLength
,
0
);
const
buffer
=
new
Buffer
(
size
);
const
buffer
=
Buffer
.
allocUnsafe
(
size
);
let
i
=
0
;
for
(
const
msg
of
this
.
_messagesToSend
)
{
...
...
test/smoke/src/main.ts
浏览文件 @
6607a81c
...
...
@@ -273,7 +273,7 @@ describe('Test', () => {
const
app
=
this
.
app
as
Application
;
const
raw
=
await
app
.
capturePage
();
const
buffer
=
new
Buffer
(
raw
,
'
base64
'
);
const
buffer
=
Buffer
.
from
(
raw
,
'
base64
'
);
const
name
=
this
.
currentTest
.
fullTitle
().
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
);
const
screenshotPath
=
path
.
join
(
screenshotsPath
,
`
${
name
}
.png`
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录