Home

es5shim

es5shim, commonly written as es5-shim, is an open-source JavaScript library that provides polyfills for ECMAScript 5 features in environments that do not implement them natively. By adding missing methods and properties to built-in objects, it enables developers to use ES5-style code while maintaining compatibility with older browsers and runtimes.

The library covers a broad set of ES5 functionality. Typical shims include Array methods such as forEach,

Limitations exist: in some engines, certain ES5 details cannot be perfectly polyfilled, particularly regarding property descriptors

Context and usage: es5shim is one option among polyfills used to maintain legacy web codebases while gradually

map,
reduce,
filter,
every,
some,
indexOf,
and
lastIndexOf;
Object
methods
like
create,
defineProperty,
defineProperties,
getOwnPropertyDescriptor,
getOwnPropertyNames,
keys,
and
getPrototypeOf;
and
utilities
such
as
Object.freeze,
Object.seal,
Object.preventExtensions,
as
well
as
Function.prototype.bind
and
Date.now.
It
also
provides
JSON
support
in
environments
lacking
a
native
JSON
object.
es5shim
aims
to
mimic
ES5
semantics
where
feasible,
including
handling
of
non-enumerable
properties
and
property
descriptors,
by
augmenting
the
global
objects
when
native
implementations
are
missing
or
incomplete.
on
non-DOM
objects
or
engine-specific
bugs.
The
project
provides
best-effort
shims
and
practical
workarounds
to
improve
compatibility,
not
guarantees
of
exact
parity
with
all
ES5
behavior.
adopting
newer
JavaScript
features.
Modern
environments
typically
include
native
ES5
support,
and
contemporary
polyfills
such
as
core-js
or
es6-shim
address
later
standards.
The
project
is
maintained
as
an
open-source
effort
with
community
contributions.