Skip to content

Commit be03816

Browse files
Jake ChampionJakeChampion
authored andcommitted
allow use of GetErrorMessage from other files by adding it to the header file
we plan to move the built-ins into their own files and they will require access to our custom error messages
1 parent 890b517 commit be03816

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

c-dependencies/js-compute-runtime/js-compute-builtins.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,6 @@ using JS::MutableHandleValue;
5555

5656
using JS::PersistentRooted;
5757

58-
struct JSErrorFormatString;
59-
60-
enum JSErrNum {
61-
#define MSG_DEF(name, count, exception, format) name,
62-
#include "./error-numbers.msg"
63-
#undef MSG_DEF
64-
JSErrNum_Limit
65-
};
66-
67-
const JSErrorFormatString js_ErrorFormatString[JSErrNum_Limit] = {
68-
#define MSG_DEF(name, count, exception, format) {#name, format, count, exception},
69-
#include "./error-numbers.msg"
70-
#undef MSG_DEF
71-
};
72-
7358
const JSErrorFormatString *GetErrorMessage(void *userRef, unsigned errorNumber) {
7459
if (errorNumber > 0 && errorNumber < JSErrNum_Limit) {
7560
return &js_ErrorFormatString[errorNumber];

c-dependencies/js-compute-runtime/js-compute-builtins.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@
1717
#include "rust-url/rust-url.h"
1818
#include "xqd.h"
1919

20+
struct JSErrorFormatString;
21+
22+
enum JSErrNum {
23+
#define MSG_DEF(name, count, exception, format) name,
24+
#include "./error-numbers.msg"
25+
#undef MSG_DEF
26+
JSErrNum_Limit
27+
};
28+
29+
const JSErrorFormatString js_ErrorFormatString[JSErrNum_Limit] = {
30+
#define MSG_DEF(name, count, exception, format) {#name, format, count, exception},
31+
#include "./error-numbers.msg"
32+
#undef MSG_DEF
33+
};
34+
35+
const JSErrorFormatString *GetErrorMessage(void *userRef, unsigned errorNumber);
2036
bool hasWizeningFinished();
2137
bool isWizening();
2238
void markWizeningAsFinished();

0 commit comments

Comments
 (0)