module JS::Helpers

def native_methods

def native_methods
  @native_methods ||= %x{
    let obj = #{to_n};
    const props = new Set();
    while (obj !== null) {
      for (const key of Reflect.ownKeys(obj)) {
        const stringKey = key.toString()
        const rubyName = #{to_rb_name(`stringKey`)}
        if (typeof key !== 'symbol' && stringKey !== rubyName ) { props.add(rubyName); }
        props.add(stringKey);
      }
      obj = Object.getPrototypeOf(obj);
    }
    return Array.from(props);
  }
end