MCPcopy Create free account
hub / github.com/GNOME/gjs / resolve_impl

Method resolve_impl

gi/object.cpp:1810–1834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1808}
1809
1810bool ObjectPrototype::resolve_impl(JSContext* cx, JS::HandleObject obj,
1811 JS::HandleId id, bool* resolved) {
1812 if (m_unresolvable_cache.has(id)) {
1813 *resolved = false;
1814 return true;
1815 }
1816
1817 JS::UniqueChars prop_name;
1818 if (!gjs_get_string_id(cx, id, &prop_name))
1819 return false;
1820 if (!prop_name) {
1821 *resolved = false;
1822 return true; // not resolved, but no error
1823 }
1824
1825 if (!uncached_resolve(cx, obj, id, prop_name.get(), resolved))
1826 return false;
1827
1828 if (!*resolved && !m_unresolvable_cache.putNew(id)) {
1829 JS_ReportOutOfMemory(cx);
1830 return false;
1831 }
1832
1833 return true;
1834}
1835
1836bool ObjectPrototype::uncached_resolve(JSContext* cx, JS::HandleObject obj,
1837 JS::HandleId id, const char* name,

Callers

nothing calls this directly

Calls 2

gjs_get_string_idFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected