Skip to content

Commit 6640811

Browse files
Jake ChampionJakeChampion
authored andcommitted
allow use of ReturnPromiseRejectedWithPendingError and PromiseRejectedWithPendingError from other files by adding them to the header file
we plan to move the built-ins into their own files and they will require access to these functions
1 parent be03816 commit 6640811

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,6 @@ JSObject *PromiseRejectedWithPendingError(JSContext *cx) {
206206
return promise;
207207
}
208208

209-
inline bool ReturnPromiseRejectedWithPendingError(JSContext *cx, const JS::CallArgs &args) {
210-
JSObject *promise = PromiseRejectedWithPendingError(cx);
211-
if (!promise) {
212-
return false;
213-
}
214-
215-
args.rval().setObject(*promise);
216-
return true;
217-
}
218-
219209
#define HANDLE_READ_CHUNK_SIZE 8192
220210

221211
template <auto op, class HandleType>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ const JSErrorFormatString js_ErrorFormatString[JSErrNum_Limit] = {
3333
};
3434

3535
const JSErrorFormatString *GetErrorMessage(void *userRef, unsigned errorNumber);
36+
37+
JSObject *PromiseRejectedWithPendingError(JSContext *cx);
38+
inline bool ReturnPromiseRejectedWithPendingError(JSContext *cx, const JS::CallArgs &args) {
39+
JSObject *promise = PromiseRejectedWithPendingError(cx);
40+
if (!promise) {
41+
return false;
42+
}
43+
44+
args.rval().setObject(*promise);
45+
return true;
46+
}
47+
3648
bool hasWizeningFinished();
3749
bool isWizening();
3850
void markWizeningAsFinished();

0 commit comments

Comments
 (0)