Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium Closure Asserts

From Leeroopedia
Revision as of 11:49, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/SeleniumHQ_Selenium_Closure_Asserts.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains JavaScript_Atoms, Vendored_Library
Last Updated 2026-02-12 00:00 GMT

Overview

Vendored Google Closure Library module providing runtime assertion utilities used by Selenium JavaScript atoms.

Description

goog.asserts is a vendored copy of the Google Closure Library module. It provides utilities to check preconditions, postconditions, and invariants at runtime. The Closure Compiler gives these methods special treatment for type-inference, allowing assertions like `goog.asserts.assert(foo)` to narrow types. The compiler can optionally strip asserts from production builds. 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

Key Exports

goog.module('goog.asserts');

exports.ENABLE_ASSERTS
exports.AssertionError(messagePattern, messageArgs)
exports.setErrorHandler(errorHandler)
exports.assert(condition, opt_message, var_args)
exports.assertExists(value, opt_message, var_args)
exports.fail(opt_message, var_args)
exports.assertNumber(value, opt_message, var_args)
exports.assertString(value, opt_message, var_args)
exports.assertFunction(value, opt_message, var_args)
exports.assertObject(value, opt_message, var_args)
exports.assertArray(value, opt_message, var_args)
exports.assertBoolean(value, opt_message, var_args)
exports.assertElement(value, opt_message, var_args)
exports.assertInstanceof(value, type, opt_message, var_args)
exports.assertFinite(value, opt_message, var_args)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment