Implementation:SeleniumHQ Selenium Closure Functions
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing utilities for creating functions, loosely inspired by Guava's Functions and Predicates classes, used by Selenium JavaScript atoms.
Description
goog.functions is a vendored copy of the Google Closure Library module. It provides utility functions for creating common function patterns including constant functions, boolean constants (TRUE, FALSE), null/undefined returning functions, and other functional programming helpers. It is inspired by the Guava library's com.google.common.base.Functions and com.google.common.base.Predicates classes. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/functions/functions.js
- Lines: 1-584
Key Exports
goog.provide('goog.functions');
// Key functions:
// goog.functions.constant(retValue) - Creates a function that always returns the same value
// goog.functions.FALSE - Always returns false
// goog.functions.TRUE - Always returns true
// goog.functions.NULL - Always returns null
// goog.functions.UNDEFINED - Always returns undefined