MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / test_every_self_jsfunction

Function test_every_self_jsfunction

tests/python/test_arrays.py:1837–1851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1835
1836
1837def test_every_self_jsfunction():
1838 items = ['Four', 'Three', 'One']
1839
1840 result = pm.eval("""
1841 (arr) => {
1842 function increment(element, index, array) {
1843 this.count++
1844 return true;
1845 }
1846 let jsObj = {count: 0}
1847 arr.every(increment, jsObj);
1848 return jsObj.count;
1849 }
1850 """)(items)
1851 assert result == 3
1852
1853# find
1854

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected