MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / internalBindingFn

Function internalBindingFn

src/internalBinding.cc:36–45  ·  view source on GitHub ↗

* @brief Implement the `internalBinding(namespace)` function */

Source from the content-addressed store, hash-verified

34 * @brief Implement the `internalBinding(namespace)` function
35 */
36static 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

Callers

nothing calls this directly

Calls 3

getMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected