Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/WebAssembly/wabt
/ EscapeJSString
Function
EscapeJSString
test/gen-spec-js.py:153–160 ·
view source on GitHub ↗
(s)
Source
from the content-addressed store, hash-verified
151
152
153
def
EscapeJSString(s):
154
result =
''
155
for
c in s:
156
if
32 <= ord(c) < 127 and c not in
'"\\'
:
157
result += c
158
else
:
159
result +=
'\\x%02x'
% ord(c)
160
return
result
161
162
163
def
IsValidJSConstant(const):
Callers
1
_Action
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected