Updated bower dependencies for client.

This commit is contained in:
baldo 2022-08-02 15:24:19 +02:00
commit fe5b68e1c4
136 changed files with 7596 additions and 9284 deletions

View file

@ -7,11 +7,11 @@
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Kris Kowal <kris@cixar.com> (https://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (https://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (https://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (https://gozala.io)",
"Kit Cambridge <kitcambridge@gmail.com> (https://github.com/kitcambridge)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
@ -30,14 +30,14 @@
"bower_components",
"tests"
],
"version": "4.5.13",
"_release": "4.5.13",
"version": "4.6.7",
"_release": "4.6.7",
"_resolution": {
"type": "version",
"tag": "v4.5.13",
"commit": "d5297adf9a9ca5669b3d43153fa2d8092e879f9c"
"tag": "v4.6.7",
"commit": "0d171c717a51e177eea2261c8443fec0c9e913bc"
},
"_source": "https://github.com/es-shims/es5-shim.git",
"_target": "4.5.13",
"_target": "4.6.7",
"_originalSource": "es5-shim"
}

View file

@ -1,3 +1,84 @@
4.6.7
- [Fix] `parseInt`, `String#trim`: properly consider Mongolian Vowel Separator
- [Robustness] `substr`: call-bind original substr method
- [Tests] ensure only the actual shims are included in tests
4.6.6
- [Fix] `splice`: IE 8: upgrade ES5 impls to ES6 default argument behavior
- [Fix] `toExponential`: IE 6 native toExponential does not throw with infinite fractionDigits
- [Fix] `Date`: fix a bug in modern Safari (#481)
- [Fix] ensure `parseInt` replacements are not constructible
- [readme] add standalone shims
- [readme] add `Array.prototype.splice` and standalone shim
- [Tests] fix a test failure with a custom matcher in IE 6
- [Tests] pave over Firefoxs increased getMinutes precision
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.6.5
- [Fix] IE 8 has a broken `Object.defineProperty`
- [patch] replace dead link in comment with archive.org link
- [Docs] update all possible http: links to https:
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`
4.6.4
- [Fix] `Object.defineProperty`: when shimmed in Chrome <= 36, properly handle writability
- [Tests] add some additional tests
4.6.3
- [Fix] `Object.defineProperty`: Chrome <= 36 has a broken dP when setting "prototype" while changing writability
- [Fix] `toExponential`: use `thisNumberValue` instead of `Number()`
- [readme] fix badges
- [readme] add standalone shims
- [actions] reuse common workflows
- [actions] update codecov uploader
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
- [Tests] avoid loading coverage data when running tests
4.6.2
- [Fix] IE 6-8 fails to throw on infinite fractional digits
4.6.1
- [Fix] `Math.log10` does not exist in older engines, oops
- [Fix] `toExponential`: start from 16 instead of 22
- [Fix] `toExponential`: ensure ToNumber is only called once on the receiver
- [Robustness] `toExponential`, `toPrecision`: ensure things do not break with later builtin modification
4.6.0
- [New] detect and patch `Number#toExponential` in Edge 15-18, which rounds incorrectly
- [Fix] `parseInt`: fails to throw on boxed Symbols in Edge 15-18
- [eslint] ensure autofix makes no further changes
- [readme] remove travis badge
- [meta] use `prepublishOnly`, for npm 7+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`
- [tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`; use codecov action
- [actions] update workflows
4.5.15
- [Fix] `es5-sham`: `getPrototypeOf`: avoid infinite loop in pre-`__proto__` browsers
- [Fix] `split`: add a function name to the "broken capturing groups" shim
- [Robustness] cache Math methods
- [readme] add standalone shims
- [meta] add `in-publish` to avoid running the minifier on install
- [meta] run `aud` in `posttest`
- [Tests] migrate tests to Github Actions (#474)
- [Tests] run `nyc` on all tests
- [actions] add "Allow Edits" workflow
- [actions] switch Automatic Rebase workflow to `pull_request_target` event
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.5.14
- [Fix] handle no `deleteCount` to `splice()` in Opera (#465)
- [Refactor] remove unnecessary comparison
- [meta] remove unused Makefile and associated utilities
- [meta] add `funding` field
- [meta] Rename CHANGES to CHANGELOG.md
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`; add `safe-publish-latest`
- [Tests] fix negative Date tests to handle TZData
- [Tests] use shared travis-ci configs
- [Tests] remove `jscs`
- [Tests] clarify toPrecision's range increased in ES2018
- [actions] add automatic rebasing / merge commit blocking
4.5.13
- [Fix] exclude deprecated Firefox keys (#460)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jasmine-node`, `replace`, `semver`
@ -70,7 +151,7 @@
4.5.0
- [New] `parseFloat('-0')` should return -0 in Opera 12 (#371)
- [New] Provide and replace Date UTC methods (#360)
- [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesnt observably look them up on the receiver
- [Robustness] cache `Date` getUTC methods so that `Date#toISOString` doesnt observably look them up on the receiver
- [Robustness] use a cached and shimmed `String#trim`
- [Tests] up to `node` `v5.5`
- [Tests] add `parallelshell` and use it in a few tasks
@ -409,7 +490,7 @@
0.0.4
- Revised Object.getPrototypeOf to work in more cases
in response to http://ejohn.org/blog/objectgetprototypeof/
in response to https://johnresig.com/blog/objectgetprototypeof/
[issue #2] (fschaefer)
0.0.3

View file

@ -1,63 +0,0 @@
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
# The files that need updating when incrementing the version number.
VERSIONED_FILES := *.js *.json *.map README*
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
UTILS := semver
# Make sure that all required utilities can be located.
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
# Default target (by virtue of being the first non '.'-prefixed in the file).
.PHONY: _no-target-specified
_no-target-specified:
$(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests)
# Lists all targets defined in this makefile.
.PHONY: list
list:
@$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
.PHONY: test
test:
@npm test
.PHONY: _ensure-tag
_ensure-tag:
ifndef TAG
$(error Please invoke with `make TAG=<new-version> release`, where <new-version> is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number)
endif
CHANGELOG_ERROR = $(error No CHANGES specified)
.PHONY: _ensure-changelog
_ensure-changelog:
@ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2)
# Ensures that the git workspace is clean.
.PHONY: _ensure-clean
_ensure-clean:
@[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGES')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; }
# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`.
.PHONY: release
release: _ensure-tag _ensure-changelog _ensure-clean
@old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \
new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \
if printf "$$new_ver" | command grep -q '^[0-9]'; then \
semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \
semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \
else \
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
fi; \
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
npm run minify; \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
replace "blob/master" "blob/v$$new_ver" -- *.min.js && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \
git tag -a -m "v$$new_ver" "v$$new_ver"

View file

@ -1,10 +1,13 @@
# es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
# es5-shim <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![npm badge][npm-badge-png]][npm-url]
[![Build Status][travis-svg]][travis-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
contain all EcmaScript 5 methods that can be faithfully emulated with a
@ -20,7 +23,6 @@ In many cases, this means that these shams cause many ES5 methods to
silently fail. Decide carefully whether this is what you want.
**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly.
## Tests
The tests are written with the Jasmine BDD test framework.
@ -31,19 +33,20 @@ simply `npm install` and `npm test`.
### Complete tests ###
* Array.prototype.every
* Array.prototype.filter
* Array.prototype.forEach
* Array.prototype.indexOf
* Array.prototype.lastIndexOf
* Array.prototype.map
* Array.prototype.every ([standalone shim](https://www.npmjs.com/package/array.prototype.every))
* Array.prototype.filter ([standalone shim](https://www.npmjs.com/package/array.prototype.filter))
* Array.prototype.forEach ([standalone shim](https://www.npmjs.com/package/array.prototype.foreach))
* Array.prototype.indexOf ([standalone shim](https://www.npmjs.com/package/array.prototype.indexof))
* Array.prototype.lastIndexOf ([standalone shim](https://www.npmjs.com/package/array.prototype.lastindexof))
* Array.prototype.map ([standalone shim](https://www.npmjs.com/package/array.prototype.map))
* Array.prototype.slice
* Array.prototype.some
* Array.prototype.some ([standalone shim](https://www.npmjs.com/package/array.prototype.some))
* Array.prototype.sort
* Array.prototype.reduce
* Array.prototype.reduceRight
* Array.prototype.push
* Array.prototype.reduce ([standalone shim](https://www.npmjs.com/package/array.prototype.reduce))
* Array.prototype.reduceRight ([standalone shim](https://www.npmjs.com/package/array.prototype.reduceright))
* Array.prototype.push ([standalone shim](https://www.npmjs.com/package/array.prototype.push))
* Array.prototype.join
* Array.prototype.splice ([standalone shim](https://www.npmjs.com/package/array.prototype.splice))
* Array.isArray
* Date.now
* Date.prototype.toJSON
@ -53,12 +56,13 @@ simply `npm install` and `npm test`.
from manipulating their ``arguments`` and ``caller`` properties.
* :warning: Caveat: bound functions don't have checks in ``call`` and
``apply`` to avoid executing as a constructor.
* Number.prototype.toExponential ([standalone shim](https://www.npmjs.com/package/number.prototype.toexponential))
* Number.prototype.toFixed
* Number.prototype.toPrecision
* Object.keys
* String.prototype.split
* String.prototype.trim
* String.prototype.lastIndexOf
* Object.keys ([standalone shim](https://www.npmjs.com/package/object-keys))
* String.prototype.split ([standalone shim](https://www.npmjs.com/package/string.prototype.split))
* String.prototype.trim ([standalone shim](https://www.npmjs.com/package/string.prototype.trim))
* String.prototype.lastIndexOf ([standalone shim](https://string.prototype.lastindexof))
* String.prototype.replace
* Firefox (through v29) natively handles capturing groups incorrectly.
* Date.parse (for ISO parsing)
@ -168,23 +172,29 @@ simply `npm install` and `npm test`.
provisions of this method, which you cannot possibly
obtain in legacy engines.
### Example of applying ES compatability shims in a browser project
### Example of applying ES compatibility shims in a browser project
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.14/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.14/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script>
<script src="https://wzrd.in/standalone/es7-shim@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.5/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.5/es6-sham.min.js"></script>
<script src="other-libs.js"></script>
```
[npm-url]: https://npmjs.org/package/es5-shim
[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg
[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg
[travis-url]: https://travis-ci.org/es-shims/es5-shim
[package-url]: https://npmjs.org/package/es5-shim
[npm-version-svg]: https://versionbadg.es/es-shims/es5-shim.svg
[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg
[deps-url]: https://david-dm.org/es-shims/es5-shim
[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es5-shim.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es5-shim.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es5-shim
[codecov-image]: https://codecov.io/gh/es-shims/es5-shim/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/es5-shim/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/es5-shim
[actions-url]: https://github.com/es-shims/es5-shim/actions

View file

@ -7,11 +7,11 @@
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Kris Kowal <kris@cixar.com> (https://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (https://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (https://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (https://gozala.io)",
"Kit Cambridge <kitcambridge@gmail.com> (https://github.com/kitcambridge)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",

View file

@ -1,20 +1,20 @@
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
; // eslint-disable-line no-extra-semi
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
@ -25,7 +25,7 @@
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
root.returnExports = factory(); // eslint-disable-line no-param-reassign
}
}(this, function () {
@ -55,10 +55,10 @@
};
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
// https://es5.github.io/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// https://johnresig.com/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
@ -67,36 +67,35 @@
Object.getPrototypeOf = function getPrototypeOf(object) {
// eslint-disable-next-line no-proto
var proto = object.__proto__;
if (proto || proto === null) {
if (proto || proto == null) { // `undefined` is for pre-proto browsers
return proto;
} else if (toStr(object.constructor) === '[object Function]') {
return object.constructor.prototype;
} else if (object instanceof Object) {
return prototypeOfObject;
} else {
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
}
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
// https://es5.github.io/#x15.2.3.3
// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially.
if (Object.defineProperty) {
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0; // eslint-disable-line no-param-reassign
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined'
|| doesGetOwnPropertyDescriptorWork(document.createElement('div'));
@ -152,7 +151,7 @@
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject;
object.__proto__ = prototypeOfObject; // eslint-disable-line no-param-reassign
}
var getter = lookupGetter(object, property);
@ -160,7 +159,7 @@
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype;
object.__proto__ = prototype; // eslint-disable-line no-param-reassign
}
if (getter || setter) {
@ -186,7 +185,7 @@
}
// ES5 15.2.3.4
// http://es5.github.com/#x15.2.3.4
// https://es5.github.io/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
@ -194,7 +193,7 @@
}
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
// https://es5.github.io/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
@ -302,15 +301,14 @@
if (prototype === null) {
object = createEmpty();
} else if (isPrimitive(prototype)) {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
} else {
if (prototype !== null && isPrimitive(prototype)) {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
@ -330,14 +328,14 @@
}
// ES5 15.2.3.6
// http://es5.github.com/#x15.2.3.6
// https://es5.github.io/#x15.2.3.6
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
// https://msdn.microsoft.com/en-us/library/dd282900.aspx
// https://msdn.microsoft.com/en-us/library/dd229916.aspx
// WebKit Bugs:
// https://bugs.webkit.org/show_bug.cgi?id=36423
@ -405,7 +403,7 @@
// `__proto__` we can safely override `__proto__` while defining
// a property to make sure that we don't hit an inherited
// accessor.
/* eslint-disable no-proto */
/* eslint-disable no-proto, no-param-reassign */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
@ -414,9 +412,9 @@
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto */
/* eslint-enable no-proto, no-param-reassign */
} else {
object[property] = descriptor.value;
object[property] = descriptor.value; // eslint-disable-line no-param-reassign
}
} else {
var hasGetter = 'get' in descriptor;
@ -437,7 +435,7 @@
}
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
// https://es5.github.io/#x15.2.3.7
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
@ -459,7 +457,7 @@
}
// ES5 15.2.3.8
// http://es5.github.com/#x15.2.3.8
// https://es5.github.io/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
@ -473,7 +471,7 @@
}
// ES5 15.2.3.9
// http://es5.github.com/#x15.2.3.9
// https://es5.github.io/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
@ -494,15 +492,15 @@
return function freeze(object) {
if (typeof object === 'function') {
return object;
} else {
return freezeObject(object);
}
return freezeObject(object);
};
}(Object.freeze));
}
// ES5 15.2.3.10
// http://es5.github.com/#x15.2.3.10
// https://es5.github.io/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
@ -516,7 +514,7 @@
}
// ES5 15.2.3.11
// http://es5.github.com/#x15.2.3.11
// https://es5.github.io/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
@ -527,7 +525,7 @@
}
// ES5 15.2.3.12
// http://es5.github.com/#x15.2.3.12
// https://es5.github.io/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
@ -538,7 +536,7 @@
}
// ES5 15.2.3.13
// http://es5.github.com/#x15.2.3.13
// https://es5.github.io/#x15.2.3.13
if (!Object.isExtensible) {
Object.isExtensible = function isExtensible(object) {
// 1. If Type(O) is not Object throw a TypeError exception.
@ -550,9 +548,9 @@
while (owns(object, name)) {
name += '?';
}
object[name] = true;
object[name] = true; // eslint-disable-line no-param-reassign
var returnValue = owns(object, name);
delete object[name];
delete object[name]; // eslint-disable-line no-param-reassign
return returnValue;
};
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,20 @@
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
; // eslint-disable-line no-extra-semi
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
@ -25,16 +25,16 @@
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
root.returnExports = factory(); // eslint-disable-line no-param-reassign
}
}(this, function () {
/**
* Brings an environment as close to ECMAScript 5 compliance
* as is possible with the facilities of erstwhile engines.
*
* Annotated ES5: http://es5.github.com/ (specific links below)
* ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
* Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
* Annotated ES5: https://es5.github.io/ (specific links below)
* ES5 Spec: https://www.ecma-international.org/wp-content/uploads/ECMA-262_5.1_edition_june_2011.pdf
* Required reading: https://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
*/
// Shortcut to an often accessed properties, in order to avoid multiple
@ -60,11 +60,19 @@
var apply = FunctionPrototype.apply;
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var abs = Math.abs;
var pow = Math.pow;
var round = Math.round;
var log = Math.log;
var LOG10E = Math.LOG10E;
var log10 = Math.log10 || function log10(value) {
return log(value) * LOG10E;
};
// Having a toString local variable name breaks in Opera so use to_string.
var to_string = ObjectPrototype.toString;
/* global Symbol */
/* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
@ -73,14 +81,13 @@
var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
/* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
/* inlined from http://npmjs.com/define-properties */
/* inlined from https://npmjs.com/define-properties */
var supportsDescriptors = $Object.defineProperty && (function () {
try {
var obj = {};
$Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
return false;
}
// eslint-disable-next-line no-unreachable-loop, max-statements-per-line
for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
@ -107,7 +114,7 @@
if (!forceAssign && (name in object)) {
return;
}
object[name] = method;
object[name] = method; // eslint-disable-line no-param-reassign
};
}
return function defineProperties(object, map, forceAssign) {
@ -119,6 +126,38 @@
};
}(ObjectPrototype.hasOwnProperty));
// this is needed in Chrome 15 (probably earlier) - 36
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
if ($Object.defineProperty && supportsDescriptors) {
var F = function () {};
var toStringSentinel = {};
var sentinel = { toString: toStringSentinel };
$Object.defineProperty(F, 'prototype', { value: sentinel, writable: false });
if ((new F()).toString !== toStringSentinel) {
var $dP = $Object.defineProperty;
var $gOPD = $Object.getOwnPropertyDescriptor;
defineProperties($Object, {
defineProperty: function defineProperty(o, k, d) {
var key = $String(k);
if (typeof o === 'function' && key === 'prototype') {
var desc = $gOPD(o, key);
if (desc.writable && !d.writable && 'value' in d) {
try {
o[key] = d.value; // eslint-disable-line no-param-reassign
} catch (e) { /**/ }
}
return $dP(o, key, {
configurable: 'configurable' in d ? d.configurable : desc.configurable,
enumerable: 'enumerable' in d ? d.enumerable : desc.enumerable,
writable: d.writable
});
}
return $dP(o, key, d);
}
}, true);
}
}
//
// Util
// ======
@ -136,7 +175,7 @@
var ES = {
// ES5 9.4
// http://es5.github.com/#x9.4
// https://es5.github.io/#x9.4
// http://jsperf.com/to-integer
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
ToInteger: function ToInteger(num) {
@ -144,7 +183,7 @@
if (isActualNaN(n)) {
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
n = (n > 0 || -1) * floor(abs(n));
}
return n;
},
@ -173,7 +212,7 @@
},
// ES5 9.9
// http://es5.github.com/#x9.9
// https://es5.github.io/#x9.9
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
ToObject: function (o) {
if (o == null) { // this matches both null and undefined
@ -194,7 +233,7 @@
//
// ES-5 15.3.4.5
// http://es5.github.com/#x15.3.4.5
// https://es5.github.io/#x15.3.4.5
var Empty = function Empty() {};
@ -249,33 +288,31 @@
}
return this;
} else {
// 15.3.4.5.1 [[Call]]
// When the [[Call]] internal method of a function object, F,
// which was created using the bind function is called with a
// this value and a list of arguments ExtraArgs, the following
// steps are taken:
// 1. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 2. Let boundThis be the value of F's [[BoundThis]] internal
// property.
// 3. Let target be the value of F's [[TargetFunction]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Call]] internal method
// of target providing boundThis as the this value and
// providing args as the arguments.
// equiv: target.call(this, ...boundArgs, ...args)
return apply.call(
target,
that,
array_concat.call(args, array_slice.call(arguments))
);
}
// 15.3.4.5.1 [[Call]]
// When the [[Call]] internal method of a function object, F,
// which was created using the bind function is called with a
// this value and a list of arguments ExtraArgs, the following
// steps are taken:
// 1. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 2. Let boundThis be the value of F's [[BoundThis]] internal
// property.
// 3. Let target be the value of F's [[TargetFunction]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Call]] internal method
// of target providing boundThis as the this value and
// providing args as the arguments.
// equiv: target.call(this, ...boundArgs, ...args)
return apply.call(
target,
that,
array_concat.call(args, array_slice.call(arguments))
);
};
@ -377,7 +414,7 @@
};
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.13
// https://es5.github.io/#x15.4.4.13
// Return len+argCount.
// [bugfix, ielt8]
// IE < 8 bug: [].unshift(0) === undefined but should be "1"
@ -390,7 +427,7 @@
}, hasUnshiftReturnValueBug);
// ES5 15.4.3.2
// http://es5.github.com/#x15.4.3.2
// https://es5.github.io/#x15.4.3.2
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
defineProperties($Array, { isArray: isArray });
@ -407,7 +444,7 @@
// expressions.
// ES5 15.4.4.18
// http://es5.github.com/#x15.4.4.18
// https://es5.github.io/#x15.4.4.18
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
// Check failure of by-index access of string characters (IE < 9)
@ -471,7 +508,7 @@
}, !properlyBoxesContext(ArrayPrototype.forEach));
// ES5 15.4.4.19
// http://es5.github.com/#x15.4.4.19
// https://es5.github.io/#x15.4.4.19
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
defineProperties(ArrayPrototype, {
map: function map(callbackfn/*, thisArg*/) {
@ -503,7 +540,7 @@
}, !properlyBoxesContext(ArrayPrototype.map));
// ES5 15.4.4.20
// http://es5.github.com/#x15.4.4.20
// https://es5.github.io/#x15.4.4.20
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
defineProperties(ArrayPrototype, {
filter: function filter(callbackfn/*, thisArg*/) {
@ -535,7 +572,7 @@
}, !properlyBoxesContext(ArrayPrototype.filter));
// ES5 15.4.4.16
// http://es5.github.com/#x15.4.4.16
// https://es5.github.io/#x15.4.4.16
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
defineProperties(ArrayPrototype, {
every: function every(callbackfn/*, thisArg*/) {
@ -562,7 +599,7 @@
}, !properlyBoxesContext(ArrayPrototype.every));
// ES5 15.4.4.17
// http://es5.github.com/#x15.4.4.17
// https://es5.github.io/#x15.4.4.17
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
defineProperties(ArrayPrototype, {
some: function some(callbackfn/*, thisArg */) {
@ -589,7 +626,7 @@
}, !properlyBoxesContext(ArrayPrototype.some));
// ES5 15.4.4.21
// http://es5.github.com/#x15.4.4.21
// https://es5.github.io/#x15.4.4.21
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
var reduceCoercesToObject = false;
if (ArrayPrototype.reduce) {
@ -642,7 +679,7 @@
}, !reduceCoercesToObject);
// ES5 15.4.4.22
// http://es5.github.com/#x15.4.4.22
// https://es5.github.io/#x15.4.4.22
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
var reduceRightCoercesToObject = false;
if (ArrayPrototype.reduceRight) {
@ -699,7 +736,7 @@
}, !reduceRightCoercesToObject);
// ES5 15.4.4.14
// http://es5.github.com/#x15.4.4.14
// https://es5.github.io/#x15.4.4.14
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
defineProperties(ArrayPrototype, {
@ -728,7 +765,7 @@
}, hasFirefox2IndexOfBug);
// ES5 15.4.4.15
// http://es5.github.com/#x15.4.4.15
// https://es5.github.io/#x15.4.4.15
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
defineProperties(ArrayPrototype, {
@ -744,7 +781,7 @@
i = min(i, ES.ToInteger(arguments[1]));
}
// handle negative indices
i = i >= 0 ? i : length - Math.abs(i);
i = i >= 0 ? i : length - abs(i);
for (; i >= 0; i--) {
if (i in self && searchElement === self[i]) {
return i;
@ -755,7 +792,7 @@
}, hasFirefox2LastIndexOfBug);
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.12
// https://es5.github.io/#x15.4.4.12
var spliceNoopReturnsEmptyArray = (function () {
var a = [1, 2];
var result = a.splice();
@ -766,9 +803,9 @@
splice: function splice(start, deleteCount) {
if (arguments.length === 0) {
return [];
} else {
return array_splice.apply(this, arguments);
}
return array_splice.apply(this, arguments);
}
}, !spliceNoopReturnsEmptyArray);
@ -777,6 +814,7 @@
ArrayPrototype.splice.call(obj, 0, 0, 1);
return obj.length === 1;
}());
var hasES6Defaults = [0, 1, 2].splice(0).length === 3;
defineProperties(ArrayPrototype, {
splice: function splice(start, deleteCount) {
if (arguments.length === 0) {
@ -794,7 +832,7 @@
}
return array_splice.apply(this, args);
}
}, !spliceWorksWithEmptyObject);
}, !spliceWorksWithEmptyObject || !hasES6Defaults);
var spliceWorksWithLargeSparseArrays = (function () {
// Per https://github.com/es-shims/es5-shim/issues/295
// Safari 7/8 breaks with sparse arrays of size 1e5 or greater
@ -822,7 +860,11 @@
var len = ES.ToUint32(O.length);
var relativeStart = ES.ToInteger(start);
var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
var actualDeleteCount = arguments.length === 0
? 0
: arguments.length === 1
? len - actualStart
: min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
var k = 0;
var from;
@ -941,7 +983,7 @@
defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);
// ES5 15.2.3.14
// http://es5.github.io/#x15.4.4.10
// https://es5.github.io/#x15.4.4.10
// Fix boxed string bug
defineProperties(ArrayPrototype, {
slice: function (start, end) {
@ -996,9 +1038,10 @@
//
// ES5 15.2.3.14
// http://es5.github.com/#x15.2.3.14
// https://es5.github.io/#x15.2.3.14
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
// https://web.archive.org/web/20140727042234/http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
// eslint-disable-next-line quote-props
var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); // jscs:ignore disallowQuotedKeysInObjects
var hasProtoEnumBug = isEnum(function () {}, 'prototype');
var hasStringEnumBug = !owns('x', '0');
@ -1141,9 +1184,9 @@
keys: function keys(object) {
if (isArguments(object)) {
return originalKeys(arraySlice(object));
} else {
return originalKeys(object);
}
return originalKeys(object);
}
}, !keysWorksWithArguments || keysHasArgumentsLengthBug);
@ -1314,8 +1357,8 @@
var minute = this.getMinutes();
var second = this.getSeconds();
var timezoneOffset = this.getTimezoneOffset();
var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
var hoursOffset = floor(abs(timezoneOffset) / 60);
var minutesOffset = floor(abs(timezoneOffset) % 60);
return dayName[day] + ' '
+ monthName[month] + ' '
+ (date < 10 ? '0' + date : date) + ' '
@ -1337,7 +1380,7 @@
}
// ES5 15.9.5.43
// http://es5.github.com/#x15.9.5.43
// https://es5.github.io/#x15.9.5.43
// This function returns a String value represent the instance in time
// represented by this Date object. The format of the String is the Date Time
// string format defined in 15.9.1.15. All fields are present in the String.
@ -1361,7 +1404,7 @@
var month = originalGetUTCMonth(this);
// see https://github.com/es-shims/es5-shim/issues/111
year += Math.floor(month / 12);
year += floor(month / 12);
month = ((month % 12) + 12) % 12;
// the date time string format is specified in 15.9.1.15.
@ -1374,7 +1417,7 @@
];
year = (
(year < 0 ? '-' : (year > 9999 ? '+' : ''))
+ strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
+ strSlice('00000' + abs(year), (0 <= year && year <= 9999) ? -4 : -6)
);
for (var i = 0; i < result.length; ++i) {
@ -1391,7 +1434,7 @@
}, hasNegativeDateBug || hasSafari51DateBug);
// ES5 15.9.5.44
// http://es5.github.com/#x15.9.5.44
// https://es5.github.io/#x15.9.5.44
// This function provides a String representation of a Date object for use by
// JSON.stringify (15.12.3).
var dateToJSONIsSupported = (function () {
@ -1443,17 +1486,16 @@
}
// ES5 15.9.4.2
// http://es5.github.com/#x15.9.4.2
// https://es5.github.io/#x15.9.4.2
// based on work shared by Daniel Friesen (dantman)
// http://gist.github.com/303249
// https://gist.github.com/303249
var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
// XXX global assignment won't work in embeddings that use
// an alternate object for the context.
/* global Date: true */
var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
var maxSafeUnsigned32Bit = pow(2, 31) - 1;
var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
// eslint-disable-next-line no-implicit-globals, no-global-assign
Date = (function (NativeDate) {
@ -1466,14 +1508,16 @@
var millis = ms;
if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = Math.floor(msToShift / 1e3);
var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = floor(msToShift / 1e3);
seconds += sToShift;
millis -= sToShift * 1e3;
}
date = length === 1 && $String(Y) === Y // isString(Y)
var parsed = DateShim.parse(Y);
var hasNegTimestampParseBug = isNaN(parsed);
date = length === 1 && $String(Y) === Y && !hasNegTimestampParseBug // isString(Y)
// We explicitly pass it through parse:
? new NativeDate(DateShim.parse(Y))
? new NativeDate(parsed)
// We have to manually make calls depending on argument
// length here
: length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis)
@ -1522,10 +1566,10 @@
var t = month > 1 ? 1 : 0;
return (
months[month]
+ Math.floor((year - 1969 + t) / 4)
- Math.floor((year - 1901 + t) / 100)
+ Math.floor((year - 1601 + t) / 400)
+ (365 * (year - 1970))
+ floor((year - 1969 + t) / 4)
- floor((year - 1901 + t) / 100)
+ floor((year - 1601 + t) / 400)
+ (365 * (year - 1970))
);
};
@ -1534,8 +1578,8 @@
var ms = t;
if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = Math.floor(msToShift / 1e3);
var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = floor(msToShift / 1e3);
s += sToShift;
ms -= sToShift * 1e3;
}
@ -1570,7 +1614,7 @@
hour = $Number(match[4] || 0),
minute = $Number(match[5] || 0),
second = $Number(match[6] || 0),
millisecond = Math.floor($Number(match[7] || 0) * 1000),
millisecond = floor($Number(match[7] || 0) * 1000),
// When time zone is missed, local offset should be used
// (ES 5.1 bug)
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
@ -1612,11 +1656,10 @@
return DateShim;
}(Date));
/* global Date: false */
}
// ES5 15.9.4.4
// http://es5.github.com/#x15.9.4.4
// https://es5.github.io/#x15.9.4.4
if (!Date.now) {
Date.now = function now() {
return new Date().getTime();
@ -1629,7 +1672,7 @@
//
// ES5.1 15.7.4.5
// http://es5.github.com/#x15.7.4.5
// https://es5.github.io/#x15.7.4.5
var hasToFixedBugs = NumberPrototype.toFixed && (
(0.00008).toFixed(3) !== '0.000'
|| (0.9).toFixed(0) !== '1'
@ -1647,7 +1690,7 @@
while (++i < toFixedHelpers.size) {
c2 += n * toFixedHelpers.data[i];
toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
c2 = Math.floor(c2 / toFixedHelpers.base);
c2 = floor(c2 / toFixedHelpers.base);
}
},
divide: function divide(n) {
@ -1655,7 +1698,7 @@
var c = 0;
while (--i >= 0) {
c += toFixedHelpers.data[i];
toFixedHelpers.data[i] = Math.floor(c / n);
toFixedHelpers.data[i] = floor(c / n);
c = (c % n) * toFixedHelpers.base;
}
},
@ -1697,7 +1740,7 @@
// Test for NaN and round fractionDigits down
f = $Number(fractionDigits);
f = isActualNaN(f) ? 0 : Math.floor(f);
f = isActualNaN(f) ? 0 : floor(f);
if (f < 0 || f > 20) {
throw new RangeError('Number.toFixed called with invalid number of decimals');
@ -1728,7 +1771,7 @@
// -70 < log2(x) < 70
e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
z *= 0x10000000000000; // Math.pow(2, 52);
z *= 0x10000000000000; // pow(2, 52);
e = 52 - e;
// -18 < e < 122
@ -1777,6 +1820,140 @@
};
defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);
var hasToExponentialRoundingBug = (function () {
try {
return (-6.9e-11).toExponential(4) !== '-6.9000e-11';
} catch (e) {
return false;
}
}());
var toExponentialAllowsInfiniteDigits = (function () {
try {
(1).toExponential(Infinity);
(1).toExponential(-Infinity);
return true;
} catch (e) {
return false;
}
}());
var originalToExponential = call.bind(NumberPrototype.toExponential);
var numberToString = call.bind(NumberPrototype.toString);
var numberValueOf = call.bind(NumberPrototype.valueOf);
defineProperties(NumberPrototype, {
toExponential: function toExponential(fractionDigits) {
// 1: Let x be this Number value.
var x = numberValueOf(this);
if (typeof fractionDigits === 'undefined') {
return originalToExponential(x);
}
var f = ES.ToInteger(fractionDigits);
if (isActualNaN(x)) {
return 'NaN';
}
if (f < 0 || f > 20) {
if (!isFinite(f)) {
// IE 6 doesn't throw in the native one
throw new RangeError('toExponential() argument must be between 0 and 20');
}
// this will probably have thrown already
return originalToExponential(x, f);
}
// only cases left are a finite receiver + in-range fractionDigits
// implementation adapted from https://gist.github.com/SheetJSDev/1100ad56b9f856c95299ed0e068eea08
// 4: Let s be the empty string
var s = '';
// 5: If x < 0
if (x < 0) {
s = '-';
x = -x;
}
// 6: If x = +Infinity
if (x === Infinity) {
return s + 'Infinity';
}
// 7: If fractionDigits is not undefined and (f < 0 or f > 20), throw a RangeError exception.
if (typeof fractionDigits !== 'undefined' && (f < 0 || f > 20)) {
throw new RangeError('Fraction digits ' + fractionDigits + ' out of range');
}
var m = '';
var e = 0;
var c = '';
var d = '';
// 8: If x = 0 then
if (x === 0) {
e = 0;
f = 0;
m = '0';
} else { // 9: Else, x != 0
var L = log10(x);
e = floor(L); // 10 ** e <= x and x < 10 ** (e+1)
var n = 0;
if (typeof fractionDigits !== 'undefined') { // eslint-disable-line no-negated-condition
var w = pow(10, e - f); // x / 10 ** (f+1) < w and w <= x / 10 ** f
n = round(x / w); // 10 ** f <= n and n < 10 ** (f+1)
if (2 * x >= (((2 * n) + 1) * w)) {
n += 1; // pick larger value
}
if (n >= pow(10, f + 1)) { // 10e-1 = 1e0
n /= 10;
e += 1;
}
} else {
f = 16; // start from Math.ceil(Math.log10(Number.MAX_SAFE_INTEGER)) and loop down
var guess_n = round(pow(10, L - e + f));
var target_f = f;
while (f-- > 0) {
guess_n = round(pow(10, L - e + f));
if (
abs((guess_n * pow(10, e - f)) - x)
<= abs((n * pow(10, e - target_f)) - x)
) {
target_f = f;
n = guess_n;
}
}
}
m = numberToString(n, 10);
if (typeof fractionDigits === 'undefined') {
while (strSlice(m, -1) === '0') {
m = strSlice(m, 0, -1);
d += 1;
}
}
}
// 10: If f != 0, then
if (f !== 0) {
m = strSlice(m, 0, 1) + '.' + strSlice(m, 1);
}
// 11: If e = 0, then
if (e === 0) {
c = '+';
d = '0';
} else { // 12: Else
c = e > 0 ? '+' : '-';
d = numberToString(abs(e), 10);
}
// 13: Let m be the concatenation of the four Strings m, "e", c, and d.
m += 'e' + c + d;
// 14: Return the concatenation of the Strings s and m.
return s + m;
}
}, hasToExponentialRoundingBug || toExponentialAllowsInfiniteDigits);
var hasToPrecisionUndefinedBug = (function () {
try {
return 1.0.toPrecision(undefined) === '1';
@ -1784,10 +1961,10 @@
return true;
}
}());
var originalToPrecision = NumberPrototype.toPrecision;
var originalToPrecision = call.bind(NumberPrototype.toPrecision);
defineProperties(NumberPrototype, {
toPrecision: function toPrecision(precision) {
return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision);
return typeof precision === 'undefined' ? originalToPrecision(this) : originalToPrecision(this, precision);
}
}, hasToPrecisionUndefinedBug);
@ -1797,12 +1974,12 @@
//
// ES5 15.5.4.14
// http://es5.github.com/#x15.5.4.14
// https://es5.github.io/#x15.5.4.14
// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
// Many browsers do not split properly with regular expressions or they
// do not perform the split correctly under obscure conditions.
// See http://blog.stevenlevithan.com/archives/cross-browser-split
// See https://blog.stevenlevithan.com/archives/cross-browser-split
// I've tested in many browsers and this seems to cover the deviant ones:
// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
@ -1821,9 +1998,9 @@
) {
(function () {
var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
var maxSafe32BitInt = Math.pow(2, 32) - 1;
var maxSafe32BitInt = pow(2, 32) - 1;
StringPrototype.split = function (separator, limit) {
StringPrototype.split = function split(separator, limit) {
var string = String(this);
if (typeof separator === 'undefined' && limit === 0) {
return [];
@ -1850,8 +2027,8 @@
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // maxSafe32BitInt
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If positive number: limit = floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - floor(abs(limit))
* If other: Type-convert, then use the above rules
*/
var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
@ -1929,18 +2106,18 @@
var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
if (!isFn || !hasCapturingGroups) {
return str_replace.call(this, searchValue, replaceValue);
} else {
var wrappedReplaceValue = function (match) {
var length = arguments.length;
var originalLastIndex = searchValue.lastIndex;
searchValue.lastIndex = 0;
var args = searchValue.exec(match) || [];
searchValue.lastIndex = originalLastIndex;
pushCall(args, arguments[length - 2], arguments[length - 1]);
return replaceValue.apply(this, args);
};
return str_replace.call(this, searchValue, wrappedReplaceValue);
}
var wrappedReplaceValue = function (match) {
var length = arguments.length;
var originalLastIndex = searchValue.lastIndex;
searchValue.lastIndex = 0; // eslint-disable-line no-param-reassign
var args = searchValue.exec(match) || [];
searchValue.lastIndex = originalLastIndex; // eslint-disable-line no-param-reassign
pushCall(args, arguments[length - 2], arguments[length - 1]);
return replaceValue.apply(this, args);
};
return str_replace.call(this, searchValue, wrappedReplaceValue);
};
}
@ -1949,32 +2126,39 @@
// non-normative section suggesting uniform semantics and it should be
// normalized across all browsers
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
var string_substr = StringPrototype.substr;
var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
var string_substr = hasNegativeSubstrBug && call.bind(StringPrototype.substr);
defineProperties(StringPrototype, {
substr: function substr(start, length) {
var normalizedStart = start;
if (start < 0) {
normalizedStart = max(this.length + start, 0);
}
return string_substr.call(this, normalizedStart, length);
return string_substr(this, normalizedStart, length);
}
}, hasNegativeSubstrBug);
// ES5 15.5.4.20
// whitespace from: http://es5.github.io/#x15.5.4.20
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003'
+ '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028'
+ '\u2029\uFEFF';
// whitespace from: https://es5.github.io/#x15.5.4.20
var mvs = '\u180E';
var mvsIsWS = (/\s/).test(mvs);
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'
.replace(/\S/g, ''); // remove the mongolian vowel separator (\u180E) in modern engines
var zeroWidth = '\u200b';
var wsRegexChars = '[' + ws + ']';
var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
var hasTrimWhitespaceBug = StringPrototype.trim && (
ws.trim() !== '' // if ws is not considered whitespace
|| zeroWidth.trim() === '' // if zero-width IS considered whitespace
|| mvs.trim() !== (mvsIsWS ? '' : mvs) // if MVS is either wrongly considered whitespace, or, wrongly considered NOT whitespace
);
defineProperties(StringPrototype, {
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
// https://blog.stevenlevithan.com/archives/faster-trim-javascript
// http://perfectionkills.com/whitespace-deviations/
trim: function trim() {
'use strict';
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
@ -2014,19 +2198,61 @@
}
}, StringPrototype.lastIndexOf.length !== 1);
var hexRegex = /^[-+]?0[xX]/;
// ES-5 15.1.2.2
// eslint-disable-next-line radix
if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
/* global parseInt: true */
if (
parseInt(ws + '08') !== 8 // eslint-disable-line radix
|| parseInt(ws + '0x16') !== 22 // eslint-disable-line radix
|| (mvsIsWS ? parseInt(mvs + 1) !== 1 : !isNaN(parseInt(mvs + 1))) // eslint-disable-line radix
) {
// eslint-disable-next-line no-global-assign, no-implicit-globals
parseInt = (function (origParseInt) {
var hexRegex = /^[-+]?0[xX]/;
return function parseInt(str, radix) {
if (typeof str === 'symbol') {
if (this instanceof parseInt) { new origParseInt(); } // eslint-disable-line new-cap, no-new, max-statements-per-line
var string = trim(String(str));
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
return origParseInt(string, defaultedRadix);
};
}(parseInt));
}
// Edge 15-18
var parseIntFailsToThrowOnBoxedSymbols = (function () {
if (typeof Symbol !== 'function') {
return false;
}
try {
// eslint-disable-next-line radix
parseInt(Object(Symbol.iterator));
return true;
} catch (e) { /**/ }
try {
// eslint-disable-next-line radix
parseInt(Symbol.iterator);
return true;
} catch (e) { /**/ }
return false;
}());
if (parseIntFailsToThrowOnBoxedSymbols) {
var symbolValueOf = Symbol.prototype.valueOf;
// eslint-disable-next-line no-global-assign, no-implicit-globals
parseInt = (function (origParseInt) {
return function parseInt(str, radix) {
if (this instanceof parseInt) { new origParseInt(); } // eslint-disable-line new-cap, no-new, max-statements-per-line
var isSym = typeof str === 'symbol';
if (!isSym && str && typeof str === 'object') {
try {
symbolValueOf.call(str);
isSym = true;
} catch (e) { /**/ }
}
if (isSym) {
// handle Symbols in node 8.3/8.4
// eslint-disable-next-line no-implicit-coercion, no-unused-expressions
'' + str; // jscs:ignore disallowImplicitTypeConversion
}
var string = trim(String(str));
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
return origParseInt(string, defaultedRadix);
@ -2036,7 +2262,7 @@
// https://es5.github.io/#x15.1.2.3
if (1 / parseFloat('-0') !== -Infinity) {
/* global parseFloat: true */
// eslint-disable-next-line no-global-assign, no-implicit-globals, no-native-reassign
parseFloat = (function (origParseFloat) {
return function parseFloat(string) {
var inputString = trim(String(string));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,79 +1,80 @@
{
"name": "es5-shim",
"version": "4.5.13",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"homepage": "http://github.com/es-shims/es5-shim/",
"contributors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"bugs": {
"mail": "ljharb@gmail.com",
"url": "http://github.com/es-shims/es5-shim/issues"
},
"license": "MIT",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "http://github.com/es-shims/es5-shim.git"
},
"scripts": {
"prepublish": "npm run minify",
"minify": "npm run --silent minify-shim && npm run --silent minify-sham",
"minify-shim": "uglifyjs es5-shim.js --support-ie8 --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false | sed 's/0xde0b6b3a7640080/1000000000000000128/' > es5-shim.min.js",
"minify-sham": "uglifyjs es5-sham.js --support-ie8 --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"tests-only": "jasmine-node --matchall ./ tests/spec/",
"test-native": "jasmine-node --matchall tests/spec/",
"lint": "npm run --silent jscs && npm run --silent eslint",
"eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js",
"jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js"
},
"devDependencies": {
"@ljharb/eslint-config": "^13.1.1",
"eslint": "^5.16.0",
"jasmine-node": "^1.16.2",
"jscs": "^3.0.7",
"replace": "^1.1.0",
"semver": "^6.0.0",
"uglify-js": "2.7.3"
},
"engines": {
"node": ">=0.4.0"
},
"testling": {
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/18.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/25.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"greenkeeper": {
"ignore": [
"uglify-js"
]
}
"name": "es5-shim",
"version": "4.6.7",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"homepage": "https://github.com/es-shims/es5-shim/",
"contributors": [
"Kris Kowal <kris@cixar.com> (https://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (https://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (https://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (https://gozala.io)",
"Kit Cambridge <kitcambridge@gmail.com> (https://github.com/kitcambridge)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"bugs": {
"mail": "ljharb@gmail.com",
"url": "https://github.com/es-shims/es5-shim/issues"
},
"license": "MIT",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "https://github.com/es-shims/es5-shim.git"
},
"scripts": {
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest && npm run minify",
"minify": "npm run --silent minify-shim && npm run --silent minify-sham",
"minify-shim": "uglifyjs es5-shim.js --support-ie8 --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false | sed 's/0xde0b6b3a7640080/1000000000000000128/' > es5-shim.min.js",
"minify-sham": "uglifyjs es5-sham.js --support-ie8 --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",
"pretest": "npm run --silent lint",
"test": "npm run tests-only",
"posttest": "aud --production",
"tests-only": "nyc jasmine-node --matchall es5-sh*m.js tests/helpers/ tests/spec/",
"tests-native": "jasmine-node --matchall tests/helpers/ tests/spec/",
"lint": "eslint ."
},
"devDependencies": {
"@ljharb/eslint-config": "^21.0.0",
"aud": "^2.0.0",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"jasmine-node": "^1.16.2",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"uglify-js": "2.7.3"
},
"engines": {
"node": ">=0.4.0"
},
"testling": {
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/18.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/25.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"greenkeeper": {
"ignore": [
"uglify-js"
]
}
}