MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_prop

Method get_prop

crates/wasm/src/js_module.rs:152–161  ·  view source on GitHub ↗
(&self, name: JsProperty, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

150
151 #[pymethod]
152 fn get_prop(&self, name: JsProperty, vm: &VirtualMachine) -> PyResult<PyJsValue> {
153 let name = &name.into_js_value();
154 if has_prop(&self.value, name).map_err(|err| new_js_error(vm, err))? {
155 get_prop(&self.value, name)
156 .map(PyJsValue::new)
157 .map_err(|err| new_js_error(vm, err))
158 } else {
159 Err(vm.new_attribute_error(format!("No attribute {name:?} on JS value")))
160 }
161 }
162
163 #[pymethod]
164 fn set_prop(

Callers 2

asyncweb.pyFile · 0.80
browser.pyFile · 0.80

Calls 4

new_js_errorFunction · 0.85
into_js_valueMethod · 0.80
ErrClass · 0.50
mapMethod · 0.45

Tested by

no test coverage detected