| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_WASM_RESULT_H_ | 5 #ifndef V8_WASM_RESULT_H_ |
| 6 #define V8_WASM_RESULT_H_ | 6 #define V8_WASM_RESULT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } else { | 75 } else { |
| 76 os << result.error_msg.get() << " @+" << offset; | 76 os << result.error_msg.get() << " @+" << offset; |
| 77 } | 77 } |
| 78 } else { | 78 } else { |
| 79 os << result.error_code; | 79 os << result.error_code; |
| 80 } | 80 } |
| 81 os << std::endl; | 81 os << std::endl; |
| 82 return os; | 82 return os; |
| 83 } | 83 } |
| 84 | 84 |
| 85 std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code); | 85 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
| 86 const ErrorCode& error_code); |
| 86 | 87 |
| 87 // A helper for generating error messages that bubble up to JS exceptions. | 88 // A helper for generating error messages that bubble up to JS exceptions. |
| 88 class V8_EXPORT_PRIVATE ErrorThrower { | 89 class V8_EXPORT_PRIVATE ErrorThrower { |
| 89 public: | 90 public: |
| 90 ErrorThrower(i::Isolate* isolate, const char* context) | 91 ErrorThrower(i::Isolate* isolate, const char* context) |
| 91 : isolate_(isolate), context_(context) {} | 92 : isolate_(isolate), context_(context) {} |
| 92 ~ErrorThrower(); | 93 ~ErrorThrower(); |
| 93 | 94 |
| 94 PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...); | 95 PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...); |
| 95 PRINTF_FORMAT(2, 3) void RangeError(const char* fmt, ...); | 96 PRINTF_FORMAT(2, 3) void RangeError(const char* fmt, ...); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 116 | 117 |
| 117 i::Isolate* isolate_; | 118 i::Isolate* isolate_; |
| 118 const char* context_; | 119 const char* context_; |
| 119 i::Handle<i::Object> exception_; | 120 i::Handle<i::Object> exception_; |
| 120 }; | 121 }; |
| 121 } // namespace wasm | 122 } // namespace wasm |
| 122 } // namespace internal | 123 } // namespace internal |
| 123 } // namespace v8 | 124 } // namespace v8 |
| 124 | 125 |
| 125 #endif | 126 #endif |
| OLD | NEW |