Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱黑铅笔的猫
minigame-unity-webgl-transform
提交
01a44dbb
M
minigame-unity-webgl-transform
项目概览
爱黑铅笔的猫
/
minigame-unity-webgl-transform
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minigame-unity-webgl-transform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
01a44dbb
编写于
12月 27, 2021
作者:
S
skyler
提交者:
GitHub
12月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #34 from wechat-miniprogram/feat-skyler-update-rewrite-symbol-tool
update for new text and json symbols
上级
865fe207
1a8014bd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
9 deletion
+28
-9
tools/rewrite_exception_symbol.js
tools/rewrite_exception_symbol.js
+28
-9
未找到文件。
tools/rewrite_exception_symbol.js
浏览文件 @
01a44dbb
...
...
@@ -201,6 +201,14 @@ var symbolText = fs.readFileSync(process.argv[3], { encoding: "utf8" });
function
parseSymbol
(
symbolText
)
{
var
symbolMap
=
new
Map
();
try
{
var
symbols
=
JSON
.
parse
(
symbolText
);
console
.
log
(
"
json symbols
"
);
Object
.
entries
(
symbols
).
forEach
(
function
(
value
)
{
symbolMap
.
set
(
value
[
0
],
value
[
1
]);
});
return
symbolMap
;
}
catch
(
e
)
{}
var
startLine
=
"
var debugSymbols = {
"
;
var
start
=
symbolText
.
indexOf
(
startLine
);
start
+=
startLine
.
length
;
...
...
@@ -240,14 +248,16 @@ function replaceWithSymbol(src, symbolMap, regex) {
// console.log("to replace symbol:", src, regex);
var
output
=
""
;
var
start
=
0
;
var
matched
=
false
;
for
(;;)
{
var
d
=
res
.
next
();
if
(
d
.
value
)
{
matched
=
true
;
var
s
=
symbolMap
.
get
(
d
.
value
[
1
]);
// console.log("to replace:", d.value, s, start);
if
(
s
)
{
output
+=
src
.
substr
(
start
,
d
.
value
.
index
-
start
);
output
+=
s
+
"
:
wasm-function[
"
+
d
.
value
[
1
]
+
"
]
"
;
output
+=
s
+
"
wasm-function[
"
+
d
.
value
[
1
]
+
"
]
"
;
}
else
{
output
+=
src
.
substr
(
start
,
d
.
value
.
index
-
start
);
output
+=
d
.
value
[
0
];
...
...
@@ -259,17 +269,26 @@ function replaceWithSymbol(src, symbolMap, regex) {
break
;
}
}
return
output
;
return
{
output
:
output
,
matched
:
matched
}
;
}
var
output
=
replaceWithSymbol
(
var
res
=
replaceWithSymbol
(
exceptionText
,
symbolMap
,
/j
(\d
+
)
:wasm-function
\[\d
+]/g
);
output
=
replaceWithSymbol
(
output
,
symbolMap
,
/<anonymous>:wasm-function
\[(\d
+
)\]
/g
);
console
.
log
(
output
);
if
(
!
res
.
matched
)
{
res
=
replaceWithSymbol
(
exceptionText
,
symbolMap
,
/j
(\d
+
)
\(
wasm-function
\[\d
+]/g
);
}
if
(
!
res
.
matched
)
{
res
=
replaceWithSymbol
(
exceptionText
,
symbolMap
,
/<anonymous>:wasm-function
\[(\d
+
)\]
/g
);
}
console
.
log
(
res
.
output
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录