quickjs-jit-stdlib 0.14.0

LLRT's standard modules for quickjs-jit, vendored into one crate
Documentation
// Vendored from LLRT d9fd873e793c (libs/llrt_utils/src/ctx.rs); module paths and
// feature names adapted by scripts/import-stdlib.py.
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use rquickjs::{Ctx, Result};

pub trait CtxExt {
    fn get_script_or_module_name(&self) -> Result<String>;
}

impl CtxExt for Ctx<'_> {
    fn get_script_or_module_name(&self) -> Result<String> {
        if let Some(name) = self.script_or_module_name(0) {
            name.to_string()
        } else {
            Ok(String::from("."))
        }
    }
}