We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 861c091 commit f9e8942Copy full SHA for f9e8942
mozjs-sys/src/jsid.rs
@@ -44,6 +44,14 @@ pub fn SymbolId(symbol: *mut Symbol) -> jsid {
44
AsPropertyKey((symbol as usize) | (PropertyKeyTag::Symbol as usize))
45
}
46
47
+#[inline(always)]
48
+/// <https://searchfox.org/mozilla-central/rev/1f65969e57c757146e3e548614b49d3a4168eeb8/js/public/Id.h#183>
49
+pub fn StringId(s: *mut JSString) -> jsid {
50
+ assert!(!s.is_null());
51
+ assert_eq!((s as usize) & JSID_TYPE_MASK, 0);
52
+ AsPropertyKey((s as usize) | (PropertyKeyTag::String as usize))
53
+}
54
+
55
impl jsid {
56
#[inline(always)]
57
fn asBits(&self) -> usize {
0 commit comments