Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
deno
提交
c307e3e4
D
deno
项目概览
张重言
/
deno
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
deno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
c307e3e4
编写于
9月 17, 2020
作者:
B
Bartek Iwańczuk
提交者:
GitHub
9月 17, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: use Symbol.for instead of Symbol in cli/rt/ (#7537)
上级
bda93793
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
12 deletion
+22
-12
cli/rt/02_console.js
cli/rt/02_console.js
+13
-0
cli/rt/11_streams.js
cli/rt/11_streams.js
+3
-4
cli/rt/11_url.js
cli/rt/11_url.js
+1
-2
cli/rt/20_headers.js
cli/rt/20_headers.js
+1
-2
cli/rt/20_streams_queuing_strategy.js
cli/rt/20_streams_queuing_strategy.js
+1
-1
cli/rt/40_performance.js
cli/rt/40_performance.js
+3
-3
未找到文件。
cli/rt/02_console.js
浏览文件 @
c307e3e4
...
...
@@ -764,6 +764,19 @@
return
String
(
value
[
customInspect
]());
}
catch
{}
}
// This non-unique symbol is used to support op_crates, ie.
// in op_crates/web we don't want to depend on unique "Deno.customInspect"
// symbol defined in the public API. Internal only, shouldn't be used
// by users.
const
nonUniqueCustomInspect
=
Symbol
.
for
(
"
Deno.customInspect
"
);
if
(
nonUniqueCustomInspect
in
value
&&
typeof
value
[
nonUniqueCustomInspect
]
===
"
function
"
)
{
try
{
return
String
(
value
[
nonUniqueCustomInspect
]());
}
catch
{}
}
if
(
value
instanceof
Error
)
{
return
String
(
value
.
stack
);
}
else
if
(
Array
.
isArray
(
value
))
{
...
...
cli/rt/11_streams.js
浏览文件 @
c307e3e4
...
...
@@ -11,7 +11,8 @@
const
{
cloneValue
,
setFunctionName
}
=
window
.
__bootstrap
.
webUtil
;
const
{
assert
,
AssertionError
}
=
window
.
__bootstrap
.
util
;
const
{
customInspect
,
inspect
}
=
window
.
__bootstrap
.
console
;
const
customInspect
=
Symbol
.
for
(
"
Deno.customInspect
"
);
const
sym
=
{
abortAlgorithm
:
Symbol
(
"
abortAlgorithm
"
),
...
...
@@ -636,9 +637,7 @@
}
[
customInspect
]()
{
return
`
${
this
.
constructor
.
name
}
{\n readable:
${
inspect
(
this
.
readable
)
}
\n writable:
${
inspect
(
this
.
writable
)}
\n}`
;
return
this
.
constructor
.
name
;
}
}
...
...
cli/rt/11_url.js
浏览文件 @
c307e3e4
...
...
@@ -2,7 +2,6 @@
((
window
)
=>
{
const
core
=
window
.
Deno
.
core
;
const
{
customInspect
}
=
window
.
__bootstrap
.
console
;
const
{
isIterable
,
requiredArguments
}
=
window
.
__bootstrap
.
webUtil
;
/** https://url.spec.whatwg.org/#idna */
...
...
@@ -492,7 +491,7 @@
class
URL
{
#
searchParams
=
null
;
[
customInspect
]()
{
[
Symbol
.
for
(
"
Deno.customInspect
"
)
]()
{
const
keys
=
[
"
href
"
,
"
origin
"
,
...
...
cli/rt/20_headers.js
浏览文件 @
c307e3e4
...
...
@@ -3,7 +3,6 @@
((
window
)
=>
{
const
{
DomIterableMixin
}
=
window
.
__bootstrap
.
domIterable
;
const
{
requiredArguments
}
=
window
.
__bootstrap
.
webUtil
;
const
{
customInspect
}
=
window
.
__bootstrap
.
console
;
// From node-fetch
// Copyright (c) 2016 David Frank. MIT License.
...
...
@@ -194,7 +193,7 @@
}
}
[
customInspect
]()
{
[
Symbol
.
for
(
"
Deno.customInspect
"
)
]()
{
let
length
=
this
[
headersData
].
length
;
let
output
=
""
;
for
(
const
[
key
,
value
]
of
this
[
headersData
])
{
...
...
cli/rt/20_streams_queuing_strategy.js
浏览文件 @
c307e3e4
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
((
window
)
=>
{
const
{
customInspect
}
=
window
.
__bootstrap
.
console
;
const
customInspect
=
Symbol
.
for
(
"
Deno.customInspect
"
)
;
class
CountQueuingStrategy
{
constructor
({
highWaterMark
})
{
...
...
cli/rt/40_performance.js
浏览文件 @
c307e3e4
...
...
@@ -2,9 +2,9 @@
((
window
)
=>
{
const
{
opNow
}
=
window
.
__bootstrap
.
timers
;
const
{
customInspect
,
inspect
}
=
window
.
__bootstrap
.
console
;
const
{
cloneValue
}
=
window
.
__bootstrap
.
webUtil
;
const
customInspect
=
Symbol
.
for
(
"
Deno.customInspect
"
);
let
performanceEntries
=
[];
function
findMostRecent
(
...
...
@@ -130,7 +130,7 @@
[
customInspect
]()
{
return
this
.
detail
?
`
${
this
.
constructor
.
name
}
{\n detail:
${
inspect
(
this
.
detail
,
{
depth
:
3
}
)
JSON
.
stringify
(
this
.
detail
,
null
,
2
)
}
,\n name: "
${
this
.
name
}
",\n entryType: "
${
this
.
entryType
}
",\n startTime:
${
this
.
startTime
}
,\n duration:
${
this
.
duration
}
\n}`
:
`
${
this
.
constructor
.
name
}
{ detail:
${
this
.
detail
}
, name: "
${
this
.
name
}
", entryType: "
${
this
.
entryType
}
", startTime:
${
this
.
startTime
}
, duration:
${
this
.
duration
}
}`
;
}
...
...
@@ -170,7 +170,7 @@
[
customInspect
]()
{
return
this
.
detail
?
`
${
this
.
constructor
.
name
}
{\n detail:
${
inspect
(
this
.
detail
,
{
depth
:
3
}
)
JSON
.
stringify
(
this
.
detail
,
null
,
2
)
}
,\n name: "
${
this
.
name
}
",\n entryType: "
${
this
.
entryType
}
",\n startTime:
${
this
.
startTime
}
,\n duration:
${
this
.
duration
}
\n}`
:
`
${
this
.
constructor
.
name
}
{ detail:
${
this
.
detail
}
, name: "
${
this
.
name
}
", entryType: "
${
this
.
entryType
}
", startTime:
${
this
.
startTime
}
, duration:
${
this
.
duration
}
}`
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录