MCPcopy Create free account
hub / github.com/Snapchat/Valdi / tsn_do_set_class_method

Function tsn_do_set_class_method

tsn/src/tsn/tsn.cpp:2183–2192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2181}
2182
2183static tsn_result tsn_do_set_class_method(tsn_vm* ctx, tsn_value proto, tsn_atom name, tsn_value method) {
2184 if (tsn_set_home_object(ctx, proto, method) != tsn_result_success) {
2185 return tsn_result_failure;
2186 }
2187
2188 return tsn_process_result(
2189 ctx,
2190 JS_DefinePropertyValue(
2191 ctx, proto, name, JS_DupValue(ctx, method), JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_THROW));
2192}
2193
2194static tsn_result tsn_do_set_class_property(
2195 tsn_vm* ctx, tsn_value proto, tsn_atom name, const tsn_value* getter, const tsn_value* setter) {

Callers 2

tsn_set_class_methodFunction · 0.85

Calls 2

tsn_set_home_objectFunction · 0.85
JS_DupValueFunction · 0.85

Tested by

no test coverage detected