es-shims/es5-shim

ECMAScript 5 compatibility shims for legacy (and modern) JavaScript engines

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 3 minutes ago
Added to GitGenius on September 9th, 2026
Created on September 16th, 2010
Open Issues & Pull Requests: 45 (+0)
GitHub issues: Enabled
Number of forks: 877
Total Stargazers: 7,074 (+0)
Total Subscribers: 207 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.7 hours
Mean response time: 4.7 hours
90th percentile: 4.7 hours
Tracked items: 1

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 2
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,271 days
Stale 30+ days: 1
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

es5-shim is a polyfill library that provides ECMAScript 5 compatibility shims for JavaScript engines.

The library addresses the problem of running ES5 code on legacy JavaScript engines that lack native support for ES5 methods. It works by monkey-patching the JavaScript context with two complementary components: es5-shim.js provides faithful emulations of ES5 methods that can be reliably replicated in older engines, while es5-sham.js attempts to emulate additional ES5 methods that cannot be faithfully implemented, accepting trade-offs like silent failures where true compliance is impossible. The shim must be loaded first in the execution order to properly patch the native engine before other code runs.

Developers should choose this tool when supporting legacy JavaScript environments where native ES5 support is unavailable. It suits projects that need to run ES5-compliant code on older browsers or engines without rewriting for older syntax. The es5-sham component requires careful consideration during adoption, as its methods may silently fail rather than throw errors, which could mask bugs in code relying on ES5 semantics. The library is designed as a foundational dependency that should load before any other scripts in the execution context.

The project maintains an active test suite written with the Jasmine BDD framework, with tests runnable via npm test. The repository includes both unminified and minified versions of each shim component, providing flexibility for different deployment scenarios.