Skip to content

Commit 5bd9908

Browse files
authored
avoid the deprecated and removed Pointer_stringify (#1906)
1 parent 66dc267 commit 5bd9908

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/js/binaryen.js-post.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ function wrapModule(module, self) {
19091909
buffer.set(HEAPU8.subarray(binaryPtr, binaryPtr + binaryBytes));
19101910
return typeof sourceMapUrl === 'undefined'
19111911
? buffer
1912-
: { 'binary': buffer, 'sourceMap': Pointer_stringify(sourceMapPtr) };
1912+
: { 'binary': buffer, 'sourceMap': UTF8ToString(sourceMapPtr) };
19131913
} finally {
19141914
_free(binaryPtr);
19151915
if (sourceMapPtr) _free(sourceMapPtr);
@@ -1925,7 +1925,7 @@ function wrapModule(module, self) {
19251925
});
19261926
};
19271927
self['getDebugInfoFileName'] = function(index) {
1928-
return Pointer_stringify(Module['_BinaryenModuleGetDebugInfoFileName'](module, index));
1928+
return UTF8ToString(Module['_BinaryenModuleGetDebugInfoFileName'](module, index));
19291929
};
19301930
self['setDebugLocation'] = function(func, expr, fileIndex, lineNumber, columnNumber) {
19311931
return Module['_BinaryenFunctionSetDebugLocation'](func, expr, fileIndex, lineNumber, columnNumber);
@@ -1986,7 +1986,7 @@ Module['getExpressionInfo'] = function(expr) {
19861986
return {
19871987
'id': id,
19881988
'type': type,
1989-
'name': Pointer_stringify(Module['_BinaryenBlockGetName'](expr)),
1989+
'name': UTF8ToString(Module['_BinaryenBlockGetName'](expr)),
19901990
'children': getAllNested(expr, Module['_BinaryenBlockGetNumChildren'], Module['_BinaryenBlockGetChild'])
19911991
};
19921992
case Module['IfId']:
@@ -2001,14 +2001,14 @@ Module['getExpressionInfo'] = function(expr) {
20012001
return {
20022002
'id': id,
20032003
'type': type,
2004-
'name': Pointer_stringify(Module['_BinaryenLoopGetName'](expr)),
2004+
'name': UTF8ToString(Module['_BinaryenLoopGetName'](expr)),
20052005
'body': Module['_BinaryenLoopGetBody'](expr)
20062006
};
20072007
case Module['BreakId']:
20082008
return {
20092009
'id': id,
20102010
'type': type,
2011-
'name': Pointer_stringify(Module['_BinaryenBreakGetName'](expr)),
2011+
'name': UTF8ToString(Module['_BinaryenBreakGetName'](expr)),
20122012
'condition': Module['_BinaryenBreakGetCondition'](expr),
20132013
'value': Module['_BinaryenBreakGetValue'](expr)
20142014
};
@@ -2017,15 +2017,15 @@ Module['getExpressionInfo'] = function(expr) {
20172017
'id': id,
20182018
'type': type,
20192019
'names': getAllNested(expr, Module['_BinaryenSwitchGetNumNames'], Module['_BinaryenSwitchGetName']).map(Pointer_stringify),
2020-
'defaultName': Pointer_stringify(Module['_BinaryenSwitchGetDefaultName'](expr)),
2020+
'defaultName': UTF8ToString(Module['_BinaryenSwitchGetDefaultName'](expr)),
20212021
'condition': Module['_BinaryenSwitchGetCondition'](expr),
20222022
'value': Module['_BinaryenSwitchGetValue'](expr)
20232023
};
20242024
case Module['CallId']:
20252025
return {
20262026
'id': id,
20272027
'type': type,
2028-
'target': Pointer_stringify(Module['_BinaryenCallGetTarget'](expr)),
2028+
'target': UTF8ToString(Module['_BinaryenCallGetTarget'](expr)),
20292029
'operands': getAllNested(expr, Module[ '_BinaryenCallGetNumOperands'], Module['_BinaryenCallGetOperand'])
20302030
};
20312031
case Module['CallIndirectId']:
@@ -2053,13 +2053,13 @@ Module['getExpressionInfo'] = function(expr) {
20532053
return {
20542054
'id': id,
20552055
'type': type,
2056-
'name': Pointer_stringify(Module['_BinaryenGetGlobalGetName'](expr))
2056+
'name': UTF8ToString(Module['_BinaryenGetGlobalGetName'](expr))
20572057
};
20582058
case Module['SetGlobalId']:
20592059
return {
20602060
'id': id,
20612061
'type': type,
2062-
'name': Pointer_stringify(Module['_BinaryenSetGlobalGetName'](expr)),
2062+
'name': UTF8ToString(Module['_BinaryenSetGlobalGetName'](expr)),
20632063
'value': Module['_BinaryenSetGlobalGetValue'](expr)
20642064
};
20652065
case Module['LoadId']:
@@ -2145,7 +2145,7 @@ Module['getExpressionInfo'] = function(expr) {
21452145
'id': id,
21462146
'type': type,
21472147
'op': Module['_BinaryenHostGetOp'](expr),
2148-
'nameOperand': Pointer_stringify(Module['_BinaryenHostGetNameOperand'](expr)),
2148+
'nameOperand': UTF8ToString(Module['_BinaryenHostGetNameOperand'](expr)),
21492149
'operands': getAllNested(expr, Module['_BinaryenHostGetNumOperands'], Module['_BinaryenHostGetOperand'])
21502150
};
21512151
case Module['AtomicRMWId']:
@@ -2269,7 +2269,7 @@ Module['getExpressionInfo'] = function(expr) {
22692269
// Obtains information about a 'FunctionType'
22702270
Module['getFunctionTypeInfo'] = function(func) {
22712271
return {
2272-
'name': Pointer_stringify(Module['_BinaryenFunctionTypeGetName'](func)),
2272+
'name': UTF8ToString(Module['_BinaryenFunctionTypeGetName'](func)),
22732273
'params': getAllNested(func, Module['_BinaryenFunctionTypeGetNumParams'], Module['_BinaryenFunctionTypeGetParam']),
22742274
'result': Module['_BinaryenFunctionTypeGetResult'](func)
22752275
};
@@ -2278,10 +2278,10 @@ Module['getFunctionTypeInfo'] = function(func) {
22782278
// Obtains information about a 'Function'
22792279
Module['getFunctionInfo'] = function(func) {
22802280
return {
2281-
'name': Pointer_stringify(Module['_BinaryenFunctionGetName'](func)),
2282-
'module': Pointer_stringify(Module['_BinaryenFunctionImportGetModule'](func)),
2283-
'base': Pointer_stringify(Module['_BinaryenFunctionImportGetBase'](func)),
2284-
'type': Pointer_stringify(Module['_BinaryenFunctionGetType'](func)),
2281+
'name': UTF8ToString(Module['_BinaryenFunctionGetName'](func)),
2282+
'module': UTF8ToString(Module['_BinaryenFunctionImportGetModule'](func)),
2283+
'base': UTF8ToString(Module['_BinaryenFunctionImportGetBase'](func)),
2284+
'type': UTF8ToString(Module['_BinaryenFunctionGetType'](func)),
22852285
'params': getAllNested(func, Module['_BinaryenFunctionGetNumParams'], Module['_BinaryenFunctionGetParam']),
22862286
'result': Module['_BinaryenFunctionGetResult'](func),
22872287
'vars': getAllNested(func, Module['_BinaryenFunctionGetNumVars'], Module['_BinaryenFunctionGetVar']),
@@ -2292,19 +2292,19 @@ Module['getFunctionInfo'] = function(func) {
22922292
// Obtains information about a 'Global'
22932293
Module['getGlobalInfo'] = function(func) {
22942294
return {
2295-
'name': Pointer_stringify(Module['_BinaryenGlobalGetName'](func)),
2296-
'module': Pointer_stringify(Module['_BinaryenGlobalImportGetModule'](func)),
2297-
'base': Pointer_stringify(Module['_BinaryenGlobalImportGetBase'](func)),
2298-
'type': Pointer_stringify(Module['_BinaryenGlobalGetType'](func))
2295+
'name': UTF8ToString(Module['_BinaryenGlobalGetName'](func)),
2296+
'module': UTF8ToString(Module['_BinaryenGlobalImportGetModule'](func)),
2297+
'base': UTF8ToString(Module['_BinaryenGlobalImportGetBase'](func)),
2298+
'type': UTF8ToString(Module['_BinaryenGlobalGetType'](func))
22992299
};
23002300
};
23012301

23022302
// Obtains information about an 'Export'
23032303
Module['getExportInfo'] = function(export_) {
23042304
return {
23052305
'kind': Module['_BinaryenExportGetKind'](export_),
2306-
'name': Pointer_stringify(Module['_BinaryenExportGetName'](export_)),
2307-
'value': Pointer_stringify(Module['_BinaryenExportGetValue'](export_))
2306+
'name': UTF8ToString(Module['_BinaryenExportGetName'](export_)),
2307+
'value': UTF8ToString(Module['_BinaryenExportGetValue'](export_))
23082308
};
23092309
};
23102310

0 commit comments

Comments
 (0)