MCPcopy Create free account
hub / github.com/facebook/react / add_native_hook

Function add_native_hook

scripts/perf-counters/src/jsc-perf.cpp:22–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using HPHP::HardwareCounter;
21
22void add_native_hook(
23 JSContextRef ctx,
24 JSObjectRef obj,
25 const char *name,
26 JSObjectCallAsFunctionCallback hook
27) {
28 JSStringRef jsName = JSStringCreateWithUTF8CString(name);
29 JSObjectSetProperty(
30 ctx,
31 obj,
32 jsName,
33 JSObjectMakeFunctionWithCallback(ctx, jsName, hook),
34 kJSPropertyAttributeNone,
35 NULL
36 );
37 JSStringRelease(jsName);
38}
39
40static void fprint_value(
41 FILE *file,

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected