MCPcopy Create free account
hub / github.com/WebAssembly/wabt / IsValidJSConstant

Function IsValidJSConstant

test/gen-spec-js.py:163–175  ·  view source on GitHub ↗
(const)

Source from the content-addressed store, hash-verified

161
162
163def IsValidJSConstant(const):
164 type_ = const['type']
165 value = const['value']
166 if type_ in ('f32', 'f64') and value in ('nan:canonical', 'nan:arithmetic'):
167 return True
168 if type_ == 'i32':
169 return True
170 elif type_ == 'i64':
171 return False
172 elif type_ == 'f32':
173 return not IsNaNF32(int(value))
174 elif type_ == 'f64':
175 return not IsNaNF64(int(value))
176
177
178def IsValidJSAction(action):

Callers 3

IsValidJSActionFunction · 0.85
IsValidJSCommandFunction · 0.85
_ConstantMethod · 0.85

Calls 2

IsNaNF32Function · 0.70
IsNaNF64Function · 0.70

Tested by

no test coverage detected