* @brief Implement the `internalBinding(namespace)` function */
| 34 | * @brief Implement the `internalBinding(namespace)` function |
| 35 | */ |
| 36 | static bool internalBindingFn(JSContext *cx, unsigned argc, JS::Value *vp) { |
| 37 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); |
| 38 | |
| 39 | // Get the `namespace` argument as string |
| 40 | JS::HandleValue namespaceStrArg = args.get(0); |
| 41 | JSLinearString *namespaceStr = JS_EnsureLinearString(cx, namespaceStrArg.toString()); |
| 42 | |
| 43 | args.rval().setObjectOrNull(getInternalBindingsByNamespace(cx, namespaceStr)); |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @brief Create the JS `internalBinding` function |
nothing calls this directly
no test coverage detected