| 1808 | } |
| 1809 | |
| 1810 | bool 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 | |
| 1836 | bool ObjectPrototype::uncached_resolve(JSContext* cx, JS::HandleObject obj, |
| 1837 | JS::HandleId id, const char* name, |
nothing calls this directly
no test coverage detected