Function quickjs_runtime::quickjs_utils::maps::new_map_q
source · pub fn new_map_q(
q_ctx: &QuickJsRealmAdapter,
) -> Result<QuickJsValueAdapter, JsError>
Expand description
create new instance of Map
§Example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::quickjs_utils::maps::new_map_q;
use quickjs_runtime::quickjsvalueadapter::QuickJsValueAdapter;
let rt = QuickJsRuntimeBuilder::new().build();
rt.exe_rt_task_in_event_loop(|q_js_rt| {
let q_ctx = q_js_rt.get_main_realm();
let my_map: QuickJsValueAdapter = new_map_q(q_ctx).ok().unwrap();
});