(const)
| 161 | |
| 162 | |
| 163 | def 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 | |
| 178 | def IsValidJSAction(action): |
no test coverage detected