|
23 | 23 | #include "js/Principals.h" |
24 | 24 | #include "js/Promise.h" |
25 | 25 | #include "js/Proxy.h" |
| 26 | +#include "js/RegExp.h" |
26 | 27 | #include "js/ScalarType.h" |
27 | 28 | #include "js/Stream.h" |
28 | 29 | #include "js/StructuredClone.h" |
@@ -985,13 +986,12 @@ bool WriteBytesToJSStructuredCloneData(const uint8_t* src, size_t len, |
985 | 986 | return dest->AppendBytes(reinterpret_cast<const char*>(src), len); |
986 | 987 | } |
987 | 988 |
|
988 | | -// MSVC uses a different calling conventions for functions |
| 989 | +// MSVC uses a different calling convention for functions |
989 | 990 | // that return non-POD values. Unfortunately, this includes anything |
990 | | -// with a constructor, such as JS::Value, so we can't call these |
991 | | -// from Rust. These wrapper functions are only here to |
992 | | -// ensure the calling convention is right. |
993 | | -// https://docs.microsoft.com/en-us/cpp/build/return-values-cpp |
994 | | -// https://mozilla.logbot.info/jsapi/20180622#c14918658 |
| 991 | +// with a constructor, such as JS::Value and JS::RegExpFlags, so we |
| 992 | +// can't call these from Rust. These wrapper functions are only here |
| 993 | +// to ensure the calling convention is right. |
| 994 | +// https://web.archive.org/web/20180929193700/https://mozilla.logbot.info/jsapi/20180622#c14918658 |
995 | 995 |
|
996 | 996 | void JS_GetPromiseResult(JS::HandleObject promise, |
997 | 997 | JS::MutableHandleValue dest) { |
@@ -1020,6 +1020,10 @@ void JS_GetReservedSlot(JSObject* obj, uint32_t index, JS::Value* dest) { |
1020 | 1020 | *dest = JS::GetReservedSlot(obj, index); |
1021 | 1021 | } |
1022 | 1022 |
|
| 1023 | +void JS_GetRegExpFlags(JSContext* cx, JS::HandleObject obj, JS::RegExpFlags* flags) { |
| 1024 | + *flags = JS::GetRegExpFlags(cx, obj); |
| 1025 | +} |
| 1026 | + |
1023 | 1027 | // keep this in sync with EncodedStringCallback in glue.rs |
1024 | 1028 | typedef void (*EncodedStringCallback)(const char*); |
1025 | 1029 |
|
|
0 commit comments