MCPcopy 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
153def 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
163def IsValidJSConstant(const):

Callers 1

_ActionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected