| 100 | } |
| 101 | |
| 102 | bool evaluateCompiledTest( |
| 103 | std::string& module, bool isStrict, bool isModule, std::string& error_type, std::string& error_description) { |
| 104 | if (_context == nullptr) { |
| 105 | return true; |
| 106 | } |
| 107 | |
| 108 | // TODO(rjaber): Add support for module/global loading, as well as isStrict enable/disable |
| 109 | auto val = tsn_load_module(_context, module.c_str()); |
| 110 | if (tsn_is_exception(_context, val) != 0) { |
| 111 | decodeException(_context, error_type, error_description); |
| 112 | return false; |
| 113 | } |
| 114 | auto loadedModule = tsn_call(_context, val, tsn_undefined(_context), 0, NULL); |
| 115 | if (tsn_is_exception(_context, val) != 0) { |
| 116 | decodeException(_context, error_type, error_description); |
| 117 | return false; |
| 118 | } |
| 119 | |
| 120 | tsn_release(_context, loadedModule); |
| 121 | tsn_release(_context, val); |
| 122 | return true; |
| 123 | } |
| 124 | |
| 125 | ~realm() { |
| 126 | if (_context == nullptr) { |
no test coverage detected