测试版

This commit is contained in:
liuyuan
2025-03-05 15:16:45 +08:00
parent 8dbdce6d3f
commit 9accfddbe5
3849 changed files with 365801 additions and 0 deletions

66
node_modules/es5-shim/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,66 @@
{
"root": true,
"extends": "@ljharb",
"ignorePatterns": [
"*.min.js",
"tests/lib/*",
],
"rules": {
"array-bracket-newline": 0,
"object-curly-newline": 0,
"camelcase": [0],
"complexity": [0],
"eqeqeq": [2, "allow-null"],
"func-name-matching": 0,
"id-length": [2, { "min": 1, "max": 40 }],
"indent": [2, 4],
"max-lines": 0,
"max-lines-per-function": 0,
"max-nested-callbacks": [2, 5],
"max-params": [2, 7],
"max-statements": [1, 30],
"new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }],
"no-constant-condition": [1],
"no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}],
"no-extra-parens": [0],
"no-extra-semi": [1],
"no-func-assign": [1],
"no-implicit-coercion": [2, {
"boolean": false,
"number": false,
"string": true,
"disallowTemplateShorthand": false,
"allow": []
}],
"no-invalid-this": [0],
"no-magic-numbers": [0],
"no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}],
"no-new-func": [1],
"no-plusplus": [1],
"no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
"no-shadow": [1],
"no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
"operator-linebreak": [2, "before"],
"sort-keys": [0],
"spaced-comment": [0],
"strict": [0],
"multiline-comment-style": 0,
},
"overrides": [
{
"files": "tests/**",
"rules": {
"max-len": 0,
"max-statements-per-line": [2, { "max": 2 }],
},
"env": {
"jasmine": true
},
},
],
}

2
node_modules/es5-shim/.gitattributes generated vendored Normal file
View File

@@ -0,0 +1,2 @@
*.min.js -diff merge=ours
*.map -diff merge=ours

11
node_modules/es5-shim/.nycrc generated vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test",
"*.map",
"*.min.js"
]
}

510
node_modules/es5-shim/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,510 @@
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`
4.5.12
- [meta] republish broken 4.5.11
4.5.11
- [Fix] sync Object.keys excluded list from object-keys (#456)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jasmine-node`, `replace`, `semver`
- [Tests] pin jasmine-node to ~1.13
4.5.10
- [Fix] Safari 11 throws on `.sort({})`, but not on `.sort(null)`
- [Fix] ensure the shimmed parseInt throws with Symbols (#450)
- [Fix] skip over `localStorage`, which cant be accessed on file://
- [Fix] Accessing window.top.{constructor|prototype} throws error in iOS (#445)
- [Fix] avoid `width` and `height` on `window`, to prevent reflow (https://github.com/ljharb/object-keys/issues/31)
- [Fix] ensure minified literal of `1000000000000000128` stays as that literal (#441)
- [Robustness] always prefer `String(x)` over `x.toString()`
- [Tests] up to `node` `v9.3`, `v8.9`, `v7.10`, `v6.12`, `v5.12`, `v4.8`; improve test matrix; use `nvm install-latest-npm`; comment out OS X builds; pin included builds to LTS
- [Tests] `parseInt`: add another test for NaN parsing (#433)
- [Dev Deps] `uglify-js`: add `--support-ie8` and peg to v2.7.x since it doesnt follow semver
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js`, `semver`; remove `concurrently` (#421)
4.5.9
- [Fix] parseInt and parseFloat should both accept null/undefined (#402)
- [Tests] up to `node` `v6.2`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `concurrently`
4.5.8
- [Fix] Check if property descriptor is configurable before re-defining it (#394, #373)
- [Dev Deps] update `eslint`, `jscs`, `@ljharb/eslint-config`
- [Tests] up to `node` `v5.10`, `v4.4`
- [Tests] Use `concurrently` instead of `parallelshell`
- [Tests] use `pretest` to run the linter
4.5.7
- [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390)
4.5.6
- [Fix] `new Date(new Date())` should work in IE 8 (#389)
- [Tests] on `node` `v5.7`
- [Dev Deps] update `uglify-js`
4.5.5
- [Fix] Adobe Photoshops JS engine bizarrely can have `+date !== date.getTime()` (#365)
- [Dev Deps] update `eslint`
- [Refactor] Update `is-callable` implementation to match latest
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
4.5.4
- [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42
4.5.3
- [Fix] Saturday is a day in the week (#386)
- [Robustness] improve Function#bind (#381)
- [Tests] on `node` `v5.6`, `v4.3`
- [Tests] use json3 (#382)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
- [Docs] add note about script order (#379)
4.5.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.5.1
- [Fix] Make sure preexisting + broken `Array#` methods that throw dont break the runtime (#377)
- [Dev Deps] update `jscs`
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] use a cached and shimmed `String#trim`
- [Tests] up to `node` `v5.5`
- [Tests] add `parallelshell` and use it in a few tasks
- [Refactor] rename cached methods to avoid linter warnings
- [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config'
- [Docs] Update license year to 2016 (#374)
4.4.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.4.1
- [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370)
- [Docs] add missing shimmed things
4.4.0
- [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364)
- [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354)
- [Fix] In IE 6, `window.external` makes `Object.keys` throw
- [Fix] `Array#slice`: boxed string access on IE <= 8 (#349)
- [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352)
- [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358)
- [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString`
- [Robustness] Use a bound form of `Array#slice.call`
- [Tests] Properly check for descriptor support in IE <= 8
- [Tests] on `node` `v5.1`
- [Tests] Add `Array#slice` tests (#346)
- [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver`
- [Docs] Fix broken UMD links (#344)
4.3.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.3.1
- [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits
4.3.0
- [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336)
- [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined`
- [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333)
- [New] `Error#toString`: prints out the proper message in IE 7 and below (#334)
- [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340)
- [Fix] `String#lastIndexOf`: ensure the correct length in IE 8
- [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332)
- [Robustness] Use a bound `Array#push` instead of relying on `Function#call`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Add some conditionals to avoid impossible-to-fix test failures in IE 6-8, due to it being unable to distinguish between `undefined` and an absent index (#114)
- [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114)
- [Tests] add additional `Array#shift` tests (#337)
- [Tests] Add additional `Array#splice` tests (#339)
- [Tests] Add `Array#pop` tests, just in case (#338)
- [Tests] include `global` tests in HTML test files
- [Tests] Make sure the HTML tests run with the right charset
- [Tests] ensure `node` `v0.8` tests stay passing.
- [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off
- [Tests] on `node` `v5.0`
- [Tests] fix npm upgrades for older nodes
4.2.1
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.2.0
- [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support.
- [Dev Deps] update `eslint`, `jscs`
4.1.16
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.1.15
- [shim: fix] new Date + Date.parse: Fix a Safari 8 & 9 bug where the `ms` arg is treated as a signed instead of unsigned int (#329)
- [shim: fix] add 'frame' to blacklisted keys (#330)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js`
- [Tests] on `node` `v4.2`
- [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off
4.1.14
- [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327)
- [Refactor] Use `ES.ToUint32` instead of inline `>>>`
- [Tests] up to `node` `v4.1`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs`
4.1.13
- [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326)
4.1.12
- [fix] Make sure uglify doesn't remove function names
- [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325)
- [Tests] up to `io.js` `v3.3`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.1.11
- [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly)
- [shim: fix] Omit !Date.parse check in the if statement (#323)
- [sham: fix] Fix Object.create sham to not set __proto__ (#301)
- [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320)
- [Tests] up to `io.js` `v3.1`
- [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics
- [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318)
- [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config
4.1.10
- [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322)
- [Tests] Consolidating `Date.parse` extended year tests
- [Tests] Account for a `Date.parse` precision variance in Safari 8
- [Tests] DRY up some Date.parse tests
- [Tests] Don't create globals in Date tests
- [Tests] Better failure output when an invalid date's toJSON throws
- [Tests] Also compare lengths of array-likes
- [Tests] Extra check on Object.keys(arguments)
- [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable
4.1.9
- [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6
- [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix.
- [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome.
- [Performance] Speed up blacklisted key check for Object.keys automation equality bug.
- [Tests] Test on `io.js` `v2.4`
- [Dev Deps] Update `eslint`, `semver`
4.1.8
- [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275)
- [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315)
- [Fix] Fix `Date#toISOString` in Safari 5.1 (#243)
- [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289)
- [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295)
- [Robustness] Safely use and reference many builtins internally (also see #313)
- [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs
- [Dev Deps] Update `eslint`
4.1.7
- Make sure `Date.parse` is not enumerable (#310)
4.1.6
- Support IE 8 when `document.domain` is set (#306, #150)
- Remove version from `bower.json` (#307)
4.1.5
- Add a failing runtime check for Safari 8 `Date.parse`
- Update `eslint`, `semver`
- Test on `io.js` `v2.2`
4.1.4
- Make sure copied `Date` properties remain non-enumerable.
- Using a more reliable check for supported property descriptors in non-IE ES3
- Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305)
- Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`.
- Test on `io.js` `v2.1`
- Clean up `Array.prototype` iteration methods
4.1.3
- Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license
- Update `uglify-js`, `eslint`
4.1.2
- In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303)
- Date: Ensure all code paths have the correct `constructor` property
- Date: Don't copy non-own properties from original `Date`
- Test up to `io.js` `v2.0.0`
- Simplify `isPrimitive` check.
- Adding sanity check tests for ES5 `Number` constants.
- Update `uglify-js`, `eslint`, `semver`
4.1.1
- Fix name of `parseInt` replacement.
- Update copyright year
- Update `eslint`, `jscs`
- Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change.
- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
- Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures.
- Ensure some Object tests don't fail in ES6
- Make sure `Date` instances don't have an enumerable `constructor` property, when possible.
4.1.0
- Update `eslint`
- Improve type checks: `Array.isArray`, `isRegex`
- Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules
- Note which ES abstract methods are replaceable via `es-abstract`
- Run `travis-ci` tests on `iojs`!
4.0.6
- Update `jscs`, `uglify-js`, add `eslint`
- es5-sham: fix Object.defineProperty to not check for own properties (#211)
- Fix Array#splice bug in Safari 5 (#284)
- Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285)
4.0.5
- Update `jscs` so tests pass
4.0.4
- Style/indentation/whitespace cleanups.
- README tweaks
4.0.3
- Fix keywords (#268)
- add some Date tests
- Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710)
4.0.2
- Start including version numbers in minified files (#267)
4.0.1
- Fix legacy arguments object detection in Object.keys (#260)
4.0.0
- No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255)
- Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250)
- lots of internal refactoring
- Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254)
3.4.0
- Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239)
- Fix Object.keys with Arguments objects in Safari 5.0
- Now shimming String#split in Opera 10.6
- Avoid using "toString" as a variable name, since that breaks Opera
- Internal implementation and test cleanups
3.3.2
- Remove an internal "bind" call, which should make the shim a bit faster
- Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6
3.3.1
- Fixing an Array#splice bug in IE 6/7
- cleaning up Array#splice tests
3.3.0
- Fix Array#reduceRight in node 0.6 and older browsers (#238)
3.2.0
- Fix es5-sham UMD definition to work properly with AMD (#237)
- Ensure that Array methods do not autobox context in strict mode (#233)
3.1.1
- Update minified files (#231)
3.1.0
- Fix String#replace in Firefox up through 29 (#228)
3.0.2
- Fix `Function#bind` in IE 7 and 8 (#224, #225, #226)
3.0.1
- Version bump to ensure npm has newest minified assets
3.0.0
- es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini
- Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim`
- Added spec-compliant shim for `parseInt`
- Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives
- Improve minification of builds
2.3.0
- parseInt is now properly shimmed in ES3 browsers to default the radix
- update URLs to point to the new organization
2.2.0
- Function.prototype.bind shim now reports correct length on a bound function
- fix node 0.6.x v8 bug in Array#forEach
- test improvements
2.1.0
- Object.create fixes
- tweaks to the Object.defineProperties shim
2.0.0
- Separate reliable shims from dubious shims (shams).
1.2.10
- Group-effort Style Cleanup
- Took a stab at fixing Object.defineProperty on IE8 without
bad side-effects. (@hax)
- Object.isExtensible no longer fakes it. (@xavierm)
- Date.prototype.toISOString no longer deals with partial
ISO dates, per spec (@kitcambridge)
- More (mostly from @bryanforbes)
1.2.9
- Corrections to toISOString by @kitcambridge
- Fixed three bugs in array methods revealed by Jasmine tests.
- Cleaned up Function.prototype.bind with more fixes and tests from
@bryanforbes.
1.2.8
- Actually fixed problems with Function.prototype.bind, and regressions
from 1.2.7 (@bryanforbes, @jdalton #36)
1.2.7 - REGRESSED
- Fixed problems with Function.prototype.bind when called as a constructor.
(@jdalton #36)
1.2.6
- Revised Date.parse to match ES 5.1 (kitcambridge)
1.2.5
- Fixed a bug for padding it Date..toISOString (tadfisher issue #33)
1.2.4
- Fixed a descriptor bug in Object.defineProperty (raynos)
1.2.3
- Cleaned up RequireJS and <script> boilerplate
1.2.2
- Changed reduce to follow the letter of the spec with regard to having and
owning properties.
- Fixed a bug where RegExps pass as Functions in some engines in reduce.
1.2.1
- Adding few fixes to make jshint happy.
- Fix for issue #12, function expressions can cause scoping issues in IE.
- NPM will minify on install or when `npm run-script install` is executed.
- Adding .gitignore to avoid publishing dev dependencies.
1.2.0
- Making script loadable as AMD module.
- Adding `indexOf` to the list of safe shims.
1.1.0
- Added support for accessor properties where possible (which is all browsers
except IE).
- Stop exposing bound function's (that are returned by
`Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`)
as in some cases (when using facade objects for example) capabilities of the
enclosed functions will be leaked.
- `Object.create` now explicitly sets `__proto__` property to guarantee
correct behavior of `Object.getPrototypeOf`'s on all objects created using
`Object.create`.
- Switched to `===` from `==` where possible as it's slightly faster on older
browsers that are target of this lib.
- Added names to all anonymous functions to have a better stack traces.
1.0.0
- fixed Date.toISODate, using UTC accessors, as in
http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986
(arian)
0.0.4
- Revised Object.getPrototypeOf to work in more cases
in response to https://johnresig.com/blog/objectgetprototypeof/
[issue #2] (fschaefer)
0.0.3
- Fixed typos in Object.keys (samsonjs)
0.0.2
Per kangax's recommendations:
- faster Object.create(null)
- fixed a function-scope function declaration statement in Object.create
0.0.1
- fixed Object.create(null), in so far as that's possible
- reworked Rhino Object.freeze(Function) bug detector and patcher
0.0.0
- forked from narwhal-lib

27
node_modules/es5-shim/CONTRIBUTORS.md generated vendored Normal file
View File

@@ -0,0 +1,27 @@
- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
Project)
- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
- kossnocorp Sasha Koss XXX TODO License or CLA
- bryanforbes Bryan Forbes XXX TODO License or CLA
- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
License
- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
- iwyg XXX TODO License or CLA
- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
- rwldrn Rick Waldron Copyright (C) 2011 MIT License
- lexer Alexey Zakharov XXX TODO License or CLA
- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
Copyright (C) 2009 MIT License
- Steven Levithan Copyright (C) 2012 MIT License
- Jordan Harband (C) 2013 MIT License

22
node_modules/es5-shim/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

200
node_modules/es5-shim/README.md generated vendored Normal file
View File

@@ -0,0 +1,200 @@
# es5-shim <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![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
legacy JavaScript engine.
**Note:** As `es5-shim.js` is designed to patch the native Javascript
engine, it should be the library that is loaded first.
`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
closely as possible. For these methods, as closely as possible to ES5
is not very close. Many of these shams are intended only to allow code
to be written to ES5 without causing run-time errors in older engines.
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.
To run the tests, navigate to <root-folder>/tests/ , or,
simply `npm install` and `npm test`.
## Shims
### Complete tests ###
* 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 ([standalone shim](https://www.npmjs.com/package/array.prototype.some))
* Array.prototype.sort
* 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
* Function.prototype.bind
* :warning: Caveat: the bound function has a prototype property.
* :warning: Caveat: bound functions do not try too hard to keep you
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 ([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)
* Date.prototype.toISOString
* parseInt
* parseFloat
* Error.prototype.toString
* Error.prototype.name
* Error.prototype.message
* RegExp.prototype.toString
## Shams
* :warning: Object.create
For the case of simply "begetting" an object that inherits
prototypically from another, this should work fine across legacy
engines.
:warning: The second argument is passed to Object.defineProperties
which will probably fail either silently or with extreme prejudice.
* :warning: Object.getPrototypeOf
This will return "undefined" in some cases. It uses `__proto__` if
it's available. Failing that, it uses constructor.prototype, which
depends on the constructor property of the object's prototype having
not been replaced. If your object was created like this, it won't
work:
function Foo() {
}
Foo.prototype = {};
Because the prototype reassignment destroys the constructor
property.
This will work for all objects that were created using
`Object.create` implemented with this library.
* :warning: Object.getOwnPropertyNames
This method uses Object.keys, so it will not be accurate on legacy
engines.
* Object.isSealed
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isFrozen
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isExtensible
Works like a charm, by trying very hard to extend the object then
redacting the extension.
### May fail
* :warning: Object.getOwnPropertyDescriptor
The behavior of this shim does not conform to ES5. It should
probably not be used at this time, until its behavior has been
reviewed and been confirmed to be useful in legacy engines.
* :warning: Object.defineProperty
In the worst of circumstances, IE 8 provides a version of this
method that only works on DOM objects. This sham will not be
installed. The given version of `defineProperty` will throw an
exception if used on non-DOM objects.
In slightly better circumstances, this method will silently fail to
set "writable", "enumerable", and "configurable" properties.
Providing a getter or setter with "get" or "set" on a descriptor
will silently fail on engines that lack "__defineGetter__" and
"__defineSetter__", which include all versions of IE.
https://github.com/es-shims/es5-shim/issues#issue/5
* :warning: Object.defineProperties
This uses the Object.defineProperty shim.
* Object.seal
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.freeze
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.preventExtensions
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
### Example of applying ES compatibility shims in a browser project
```html
<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.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>
```
[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

33
node_modules/es5-shim/bower.json generated vendored Normal file
View File

@@ -0,0 +1,33 @@
{
"name": "es5-shim",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/es5-shim"
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"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",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
]
}

19
node_modules/es5-shim/component.json generated vendored Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "es5-shim",
"repo": "es-shims/es5-shim",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"version": "v4.5.1",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"main": "es5-shim.js",
"scripts": [
"es5-shim.js"
]
}

558
node_modules/es5-shim/es5-sham.js generated vendored Normal file
View File

@@ -0,0 +1,558 @@
/*!
* https://github.com/es-shims/es5-shim
* @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 */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory(); // eslint-disable-line no-param-reassign
}
}(this, function () {
var call = Function.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable);
var toStr = call.bind(prototypeOfObject.toString);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors = owns(prototypeOfObject, '__defineGetter__');
if (supportsAccessors) {
/* eslint-disable no-underscore-dangle, no-restricted-properties */
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
/* eslint-enable no-underscore-dangle, no-restricted-properties */
}
var isPrimitive = function isPrimitive(o) {
return o == null || (typeof o !== 'object' && typeof o !== 'function');
};
// ES5 15.2.3.2
// https://es5.github.io/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// https://johnresig.com/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
// ... this will nerever possibly return null
// ... Opera Mini breaks here with infinite loops
Object.getPrototypeOf = function getPrototypeOf(object) {
// eslint-disable-next-line no-proto
var proto = object.__proto__;
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;
}
// 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
// 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'));
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: ';
/* eslint-disable no-proto */
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if (isPrimitive(object)) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
var descriptor;
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return descriptor;
}
// If object has a property then it's for sure `configurable`, and
// probably `enumerable`. Detect enumerability though.
descriptor = {
enumerable: isEnumerable(object, property),
configurable: true
};
// If JS engine supports accessor properties then property may be a
// getter or setter.
if (supportsAccessors) {
// Unfortunately `__lookupGetter__` will return a getter even
// if object has own non getter property along with a same named
// inherited getter. To avoid misbehavior we temporary remove
// `__proto__` so that `__lookupGetter__` will return getter only
// if it's owned by an object.
var prototype = object.__proto__;
var notPrototypeOfObject = object !== prototypeOfObject;
// avoid recursion problem, breaking in Opera Mini when
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject; // eslint-disable-line no-param-reassign
}
var getter = lookupGetter(object, property);
var setter = lookupSetter(object, property);
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype; // eslint-disable-line no-param-reassign
}
if (getter || setter) {
if (getter) {
descriptor.get = getter;
}
if (setter) {
descriptor.set = setter;
}
// If it was accessor property we're done and return here
// in order to avoid adding `value` to the descriptor.
return descriptor;
}
}
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
/* eslint-enable no-proto */
}
// ES5 15.2.3.4
// https://es5.github.io/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
};
}
// ES5 15.2.3.5
// https://es5.github.io/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = !({ __proto__: null } instanceof Object);
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
/* global ActiveXObject */
var shouldUseActiveX = function shouldUseActiveX() {
// return early if document.domain not set
if (!document.domain) {
return false;
}
try {
return !!new ActiveXObject('htmlfile');
} catch (exception) {
return false;
}
};
// This supports IE8 when document.domain is used
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
var getEmptyViaActiveX = function getEmptyViaActiveX() {
var empty;
var xDoc;
xDoc = new ActiveXObject('htmlfile');
var script = 'script';
xDoc.write('<' + script + '></' + script + '>');
xDoc.close();
empty = xDoc.parentWindow.Object.prototype;
xDoc = null;
return empty;
};
// The original implementation using an iframe
// before the activex approach was added
// see https://github.com/es-shims/es5-shim/issues/150
var getEmptyViaIFrame = function getEmptyViaIFrame() {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
var empty;
iframe.style.display = 'none';
parent.appendChild(iframe);
// eslint-disable-next-line no-script-url
iframe.src = 'javascript:';
empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
return empty;
};
/* global document */
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
return { __proto__: null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
// Determine which approach to use
// see https://github.com/es-shims/es5-shim/issues/150
var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
var Empty = function Empty() {};
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
var Type = function Type() {}; // An empty constructor.
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 {
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
// neither `__proto__`, but this manually setting `__proto__` will
// guarantee that `Object.getPrototypeOf` will work as expected with
// objects created using `Object.create`
// eslint-disable-next-line no-proto
object.__proto__ = prototype;
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
// ES5 15.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:
// 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
var doesDefinePropertyWork = function doesDefinePropertyWork(object) {
try {
Object.defineProperty(object, 'sentinel', {});
return 'sentinel' in object;
} catch (exception) {
return false;
}
};
// check whether defineProperty works if it's given. Otherwise,
// shim partially.
if (Object.defineProperty) {
var definePropertyWorksOnObject = doesDefinePropertyWork({});
var definePropertyWorksOnDom = typeof document === 'undefined'
|| doesDefinePropertyWork(document.createElement('div'));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
if (!Object.defineProperty || definePropertyFallback) {
var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: ';
var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ';
var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';
Object.defineProperty = function defineProperty(object, property, descriptor) {
if (isPrimitive(object)) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if (isPrimitive(descriptor)) {
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
}
// make a valiant attempt to use the real defineProperty
// for I8's DOM elements.
if (definePropertyFallback) {
try {
return definePropertyFallback.call(Object, object, property, descriptor);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If it's a data property.
if ('value' in descriptor) {
// fail silently if 'writable', 'enumerable', or 'configurable'
// are requested but not supported
/*
// alternate approach:
if ( // can't implement these features; allow false but not true
('writable' in descriptor && !descriptor.writable) ||
('enumerable' in descriptor && !descriptor.enumerable) ||
('configurable' in descriptor && !descriptor.configurable)
))
throw new RangeError(
'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.'
);
*/
if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {
// As accessors are supported only on engines implementing
// `__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, no-param-reassign */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
// defined on object itself.
delete object[property];
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto, no-param-reassign */
} else {
object[property] = descriptor.value; // eslint-disable-line no-param-reassign
}
} else {
var hasGetter = 'get' in descriptor;
var hasSetter = 'set' in descriptor;
if (!supportsAccessors && (hasGetter || hasSetter)) {
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
}
// If we got that far then getters and setters can be defined !!
if (hasGetter) {
defineGetter(object, property, descriptor.get);
}
if (hasSetter) {
defineSetter(object, property, descriptor.set);
}
}
return object;
};
}
// ES5 15.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
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
Object.keys(properties).forEach(function (property) {
if (property !== '__proto__') {
Object.defineProperty(object, property, properties[property]);
}
});
return object;
};
}
// ES5 15.2.3.8
// https://es5.github.io/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
throw new TypeError('Object.seal can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.9
// https://es5.github.io/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// detect a Rhino bug and patch it
try {
Object.freeze(function () {});
} catch (exception) {
Object.freeze = (function (freezeObject) {
return function freeze(object) {
if (typeof object === 'function') {
return object;
}
return freezeObject(object);
};
}(Object.freeze));
}
// ES5 15.2.3.10
// https://es5.github.io/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
throw new TypeError('Object.preventExtensions can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.11
// https://es5.github.io/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isSealed can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.12
// https://es5.github.io/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isFrozen can only be called on Objects.');
}
return false;
};
}
// ES5 15.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.
if (Object(object) !== object) {
throw new TypeError('Object.isExtensible can only be called on Objects.');
}
// 2. Return the Boolean value of the [[Extensible]] internal property of O.
var name = '';
while (owns(object, name)) {
name += '?';
}
object[name] = true; // eslint-disable-line no-param-reassign
var returnValue = owns(object, name);
delete object[name]; // eslint-disable-line no-param-reassign
return returnValue;
};
}
}));

1
node_modules/es5-shim/es5-sham.map generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/es5-shim/es5-sham.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

2338
node_modules/es5-shim/es5-shim.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/es5-shim/es5-shim.map generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/es5-shim/es5-shim.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

128
node_modules/es5-shim/package.json generated vendored Normal file
View File

@@ -0,0 +1,128 @@
{
"_from": "es5-shim@^4.5.1",
"_id": "es5-shim@4.6.7",
"_inBundle": false,
"_integrity": "sha512-jg21/dmlrNQI7JyyA2w7n+yifSxBng0ZralnSfVZjoCawgNTCnS+yBCyVM9DL5itm7SUnDGgv7hcq2XCZX4iRQ==",
"_location": "/es5-shim",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "es5-shim@^4.5.1",
"name": "es5-shim",
"escapedName": "es5-shim",
"rawSpec": "^4.5.1",
"saveSpec": null,
"fetchSpec": "^4.5.1"
},
"_requiredBy": [
"/videojs-ie8"
],
"_resolved": "https://registry.npmmirror.com/es5-shim/-/es5-shim-4.6.7.tgz",
"_shasum": "bc67ae0fc3dd520636e0a1601cc73b450ad3e955",
"_spec": "es5-shim@^4.5.1",
"_where": "/Users/liuyuan/Desktop/soulspace_app/node_modules/videojs-ie8",
"bugs": {
"url": "https://github.com/es-shims/es5-shim/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Kris Kowal",
"email": "kris@cixar.com",
"url": "https://github.com/kriskowal/"
},
{
"name": "Sami Samhuri",
"email": "sami.samhuri@gmail.com",
"url": "https://samhuri.net/"
},
{
"name": "Florian Schäfer",
"email": "florian.schaefer@gmail.com",
"url": "https://github.com/fschaefer"
},
{
"name": "Irakli Gozalishvili",
"email": "rfobic@gmail.com",
"url": "https://gozala.io"
},
{
"name": "Kit Cambridge",
"email": "kitcambridge@gmail.com",
"url": "https://github.com/kitcambridge"
},
{
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "https://github.com/ljharb/"
}
],
"deprecated": false,
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"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"
},
"greenkeeper": {
"ignore": [
"uglify-js"
]
},
"homepage": "https://github.com/es-shims/es5-shim/",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"main": "es5-shim.js",
"name": "es5-shim",
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/es5-shim.git"
},
"scripts": {
"lint": "eslint .",
"minify": "npm run --silent minify-shim && npm run --silent minify-sham",
"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",
"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",
"posttest": "aud --production",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest && npm run minify",
"pretest": "npm run --silent lint",
"test": "npm run tests-only",
"tests-native": "jasmine-node --matchall tests/helpers/ tests/spec/",
"tests-only": "nyc jasmine-node --matchall es5-sh*m.js tests/helpers/ tests/spec/"
},
"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"
]
},
"version": "4.6.7"
}

7
node_modules/es5-shim/shims.json generated vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"Object": {
"prototype": {},
"keys": "object-keys"
}
}

40
node_modules/es5-shim/tests/helpers/h-matchers.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
var has = Object.prototype.hasOwnProperty;
var getKeys = function (o) {
'use strict';
var key;
var a = [];
for (key in o) {
if (has.call(o, key)) {
a.push(key);
}
}
a.sort();
return a;
};
beforeEach(function () {
'use strict';
this.addMatchers({
toExactlyMatch: function (expected) {
var a1, a2, l, i, key;
var actual = this.actual;
a1 = getKeys(actual);
a2 = getKeys(expected);
l = a1.length;
if (l !== a2.length) {
return false;
}
for (i = 0; i < l; i++) {
key = a1[i];
expect(key).toEqual(a2[i]);
expect(actual[key]).toEqual(expected[key]);
}
return true;
}
});
});

66
node_modules/es5-shim/tests/index.html generated vendored Normal file
View File

@@ -0,0 +1,66 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.js"></script>
<script src="../es5-sham.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script src="spec/s-regexp.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>

64
node_modules/es5-shim/tests/index.min.html generated vendored Normal file
View File

@@ -0,0 +1,64 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.min.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>

190
node_modules/es5-shim/tests/lib/jasmine-html.js generated vendored Normal file
View File

@@ -0,0 +1,190 @@
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
);
this.document.body.appendChild(this.outerDiv);
var suites = runner.suites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.id] = suiteDiv;
var parentDiv = this.outerDiv;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.id];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
var self = this;
showPassed.onclick = function(evt) {
if (showPassed.checked) {
self.outerDiv.className += ' show-passed';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
}
};
showSkipped.onclick = function(evt) {
if (showSkipped.checked) {
self.outerDiv.className += ' show-skipped';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
}
};
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
if (this.logRunningSpecs) {
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(spec.getFullName()),
title: spec.getFullName()
}, spec.description));
var resultItems = results.getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
specDiv.appendChild(messagesDiv);
}
this.suiteDivs[spec.suite.id].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};

166
node_modules/es5-shim/tests/lib/jasmine.css generated vendored Normal file
View File

@@ -0,0 +1,166 @@
body {
font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
}
.jasmine_reporter a:visited, .jasmine_reporter a {
color: #303;
}
.jasmine_reporter a:hover, .jasmine_reporter a:active {
color: blue;
}
.run_spec {
float:right;
padding-right: 5px;
font-size: .8em;
text-decoration: none;
}
.jasmine_reporter {
margin: 0 5px;
}
.banner {
color: #303;
background-color: #fef;
padding: 5px;
}
.logo {
float: left;
font-size: 1.1em;
padding-left: 5px;
}
.logo .version {
font-size: .6em;
padding-left: 1em;
}
.runner.running {
background-color: yellow;
}
.options {
text-align: right;
font-size: .8em;
}
.suite {
border: 1px outset gray;
margin: 5px 0;
padding-left: 1em;
}
.suite .suite {
margin: 5px;
}
.suite.passed {
background-color: #dfd;
}
.suite.failed {
background-color: #fdd;
}
.spec {
margin: 5px;
padding-left: 1em;
clear: both;
}
.spec.failed, .spec.passed, .spec.skipped {
padding-bottom: 5px;
border: 1px solid gray;
}
.spec.failed {
background-color: #fbb;
border-color: red;
}
.spec.passed {
background-color: #bfb;
border-color: green;
}
.spec.skipped {
background-color: #bbb;
}
.messages {
border-left: 1px dashed gray;
padding-left: 1em;
padding-right: 1em;
}
.passed {
background-color: #cfc;
display: none;
}
.failed {
background-color: #fbb;
}
.skipped {
color: #777;
background-color: #eee;
display: none;
}
/*.resultMessage {*/
/*white-space: pre;*/
/*}*/
.resultMessage span.result {
display: block;
line-height: 2em;
color: black;
}
.resultMessage .mismatch {
color: black;
}
.stackTrace {
white-space: pre;
font-size: .8em;
margin-left: 10px;
max-height: 5em;
overflow: auto;
border: 1px inset red;
padding: 1em;
background: #eef;
}
.finished-at {
padding-left: 1em;
font-size: .6em;
}
.show-passed .passed,
.show-skipped .skipped {
display: block;
}
#jasmine_content {
position:fixed;
right: 100%;
}
.runner {
border: 1px solid gray;
display: block;
margin: 5px 0;
padding: 2px 0 2px 10px;
}

2601
node_modules/es5-shim/tests/lib/jasmine.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

62
node_modules/es5-shim/tests/native.html generated vendored Normal file
View File

@@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script src="spec/s-regexp.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>

1981
node_modules/es5-shim/tests/spec/s-array.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

570
node_modules/es5-shim/tests/spec/s-date.js generated vendored Normal file
View File

@@ -0,0 +1,570 @@
describe('Date', function () {
'use strict';
var supportsDescriptors = Object.defineProperty && (function () {
try {
var obj = {};
Object.defineProperty(obj, 'x', {
enumerable: false,
value: obj
});
// eslint-disable-next-line no-unreachable-loop
for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
}
}());
var ifSupportsDescriptorsIt = supportsDescriptors ? it : xit;
var has = Object.prototype.hasOwnProperty;
var negativeDate;
beforeEach(function () {
var negativeCanned = [
{
getTime: -3509827329600292,
getUTCDay: 4,
getDay: 4,
dim: 31
},
{
getTime: -3509824651200292,
getUTCDay: 0,
getDay: 0,
dim: 29
},
{
getTime: -3509822145600292,
getUTCDay: 1,
getDay: 1,
dim: 31
},
{
getTime: -3509819467200292,
getUTCDay: 4,
getDay: 4,
dim: 30
},
{
getTime: -3509816875200292,
getUTCDay: 6,
getDay: 6,
dim: 31
},
{
getTime: -3509814196800292,
getUTCDay: 2,
getDay: 2,
dim: 30
},
{
getTime: -3509811604800292,
getUTCDay: 4,
getDay: 4,
dim: 31
},
{
getTime: -3509808926400292,
getUTCDay: 0,
getDay: 0,
dim: 31
},
{
getTime: -3509806248000292,
getUTCDay: 3,
getDay: 3,
dim: 30
},
{
getTime: -3509803656000292,
getUTCDay: 5,
getDay: 5,
dim: 31
},
{
getTime: -3509800977600292,
getUTCDay: 1,
getDay: 1,
dim: 30
},
{
getTime: -3509798385600292,
getUTCDay: 3,
getDay: 3,
dim: 31
}
];
negativeDate = negativeCanned.map(function (item) {
var dateFirst = new Date(item.getTime);
var dateLast = new Date(item.getTime + ((item.dim - 1) * 86400000));
return {
dates: [dateFirst, dateLast],
days: [1, item.dim],
getUTCDay: [item.getUTCDay, (item.getUTCDay + item.dim - 1) % 7],
getDay: [item.getDay, (item.getDay + item.dim - 1) % 7]
};
});
});
describe('.now()', function () {
it('should be the current time', function () {
var before = (new Date()).getTime();
var middle = Date.now();
var after = (new Date()).getTime();
expect(middle).not.toBeLessThan(before);
expect(middle).not.toBeGreaterThan(after);
});
});
describe('constructor', function () {
it('works with standard formats', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(+new Date('2012-12-31T23:59:59.000Z')).toBe(1356998399000); // 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000
expect(+new Date('2012-04-04T05:02:02.170Z')).toBe(1333515722170); // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
expect(+new Date('2012-04-04T05:02:02.170999Z')).toBe(1333515722170); // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
expect(+new Date('2012-04-04T05:02:02.17Z')).toBe(1333515722170); // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
expect(+new Date('2012-04-04T05:02:02.1Z')).toBe(1333515722100); // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
expect(+new Date('2012-04-04T24:00:00.000Z')).toBe(1333584000000); // NaN 1333584000000 1333584000000 1333584000000 1333584000000
expect(+new Date('2012-02-29T12:00:00.000Z')).toBe(1330516800000); // 1330516800000 1330516800000 1330516800000 1330516800000 1330516800000
expect(+new Date('2011-03-01T12:00:00.000Z')).toBe(1298980800000); // 1298980800000 1298980800000 1298980800000 1298980800000 1298980800000
// https://github.com/es-shims/es5-shim/issues/80 Safari bug with leap day
expect(new Date('2034-03-01T00:00:00.000Z')
- new Date('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1
});
ifSupportsDescriptorsIt('is not enumerable', function () {
expect(Object.keys(new Date())).not.toContain('constructor');
});
it('works as a function', function () {
var zeroDate = Date(0);
expect(zeroDate).toBe(String(zeroDate));
var value = Date(1441705534578);
expect(value).toBe(String(value));
});
it('fixes this Safari 8/9 bug', function () {
var offset = new Date(1970).getTimezoneOffset() * 60e3;
var timestamp = 2147483647; // Math.pow(2, 31) - 1
var date = new Date(1970, 0, 1, 0, 0, 0, timestamp);
var expectedTimestamp = timestamp + offset;
expect(date.getTime()).toBe(expectedTimestamp);
var brokenTimestamp = 2147483648; // Math.pow(2, 31)
var brokenDate = new Date(1970, 0, 1, 0, 0, 0, brokenTimestamp);
var expectedBrokenTimestamp = brokenTimestamp + offset;
expect(brokenDate.getTime()).toBe(expectedBrokenTimestamp); // NaN in Safari 8/9
var veryBrokenTS = 1435734000000;
var veryBrokenDate = new Date(1970, 0, 1, 0, 0, 0, veryBrokenTS);
var largeDate = new Date('Wed Jul 01 2015 07:00:00 GMT-0700 (PDT)');
var expectedVeryBrokenTS = veryBrokenTS + (largeDate.getTimezoneOffset() * 60e3);
expect(veryBrokenDate.getTime()).toBe(expectedVeryBrokenTS); // NaN in Safari 8/9
});
it('works with a Date object', function () {
var date = new Date(1456297712984);
var copiedDate = new Date(date);
expect(date).not.toBe(copiedDate);
expect(copiedDate.getTime()).toBe(date.getTime());
expect(+copiedDate).toBe(+date);
expect(String(copiedDate)).toBe(String(date));
});
});
describe('.parse()', function () {
// TODO: Write the rest of the test.
ifSupportsDescriptorsIt('is not enumerable', function () {
expect(Object.getOwnPropertyDescriptor(Date, 'parse').enumerable).toBe(false);
});
it('should be an invalid date', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('2012-11-31T23:59:59.000Z')).toBeFalsy(); // 1354406399000 NaN NaN 1354406399000 NaN
expect(Date.parse('2012-12-31T23:59:60.000Z')).toBeFalsy(); // NaN NaN NaN NaN 1356998400000
expect(Date.parse('2012-04-04T24:00:00.500Z')).toBeFalsy(); // NaN NaN 1333584000500 1333584000500 NaN
expect(Date.parse('2012-12-31T10:08:60.000Z')).toBeFalsy(); // NaN NaN NaN NaN 1356948540000
expect(Date.parse('2012-13-01T12:00:00.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-12-32T12:00:00.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-12-31T25:00:00.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-12-31T24:01:00.000Z')).toBeFalsy(); // NaN NaN NaN 1356998460000 NaN
expect(Date.parse('2012-12-31T12:60:00.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-12-31T12:00:60.000Z')).toBeFalsy(); // NaN NaN NaN NaN 1356955260000
expect(Date.parse('2012-00-31T23:59:59.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-12-00T23:59:59.000Z')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2011-02-29T12:00:00.000Z')).toBeFalsy(); // 1298980800000 NaN NaN 1298980800000 NaN
});
it('should work', function () {
var dates = {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1 Safari 8
'2012-12-31T23:59:59.000Z': 1356998399000, // 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000
'2012-04-04T05:02:02.170Z': 1333515722170, // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
'2012-04-04T05:02:02.170999Z': 1333515722170, // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170.999
'2012-04-04T05:02:02.17Z': 1333515722170, // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
'2012-04-04T05:02:02.1Z': 1333515722100, // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
'2012-04-04T24:00:00.000Z': 1333584000000, // NaN 1333584000000 1333584000000 1333584000000 1333584000000 1333584000000
'2012-02-29T12:00:00.000Z': 1330516800000, // 1330516800000 1330516800000 1330516800000 1330516800000 1330516800000 1330516800000
'2011-03-01T12:00:00.000Z': 1298980800000 // 1298980800000 1298980800000 1298980800000 1298980800000 1298980800000 1298980800000
};
for (var str in dates) {
if (has.call(dates, str)) {
expect(Math.floor(Date.parse(str))).toBe(dates[str]);
}
}
// https://github.com/es-shims/es5-shim/issues/80 Safari bug with leap day
expect(Date.parse('2034-03-01T00:00:00.000Z')
- Date.parse('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1
});
it('fixes a Safari 8/9 bug with parsing in UTC instead of local time', function () {
var offset = new Date('2015-07-01').getTimezoneOffset() * 60e3;
expect(Date.parse('2015-07-01T00:00:00')).toBe(1435708800000 + offset); // Safari 8/9 give NaN
});
it('should support extended years', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('0000-01-01T00:00:00.000Z')).toBe(-621672192e5); // -621672192e5 -621672192e5 -621672192e5 -621672192e5 -621672192e5
expect(Date.parse('0001-01-01T00:00:00Z')).toBe(-621355968e5); // -621355968e5 -621355968e5 -621355968e5 8.64e15 -621355968e5
expect(Date.parse('+275760-09-13T00:00:00.000Z')).toBe(8.64e15); // 8.64e15 NaN 8.64e15 8.64e15 8.64e15
expect(Date.parse('-271821-04-20T00:00:00.000Z')).toBe(-8.64e15); // -8.64e15 NaN -8.64e15 -8.64e15 -8.6400000864e15
expect(Date.parse('+275760-09-13T00:00:00.001Z')).toBeFalsy(); // NaN NaN NaN 8.64e15 + 1 8.64e15 + 1
expect(Date.parse('-271821-04-19T23:59:59.999Z')).toBeFalsy(); // NaN NaN NaN -8.64e15 - 1 -8.6400000864e15 - 1
expect(Date.parse('+033658-09-27T01:46:40.000Z')).toBe(1e15); // 1e15 NaN 1e15 1e15 9999999136e5
expect(Date.parse('-000001-01-01T00:00:00Z')).toBe(-621987552e5); // -621987552e5 NaN -621987552e5 -621987552e5 -621987552e5
expect(Date.parse('+002009-12-15T00:00:00Z')).toBe(12608352e5); // 12608352e5 NaN 12608352e5 12608352e5 12608352e5
});
it('works with timezone offsets', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('2012-01-29T12:00:00.000+01:00')).toBe(132783480e4); // 132783480e4 132783480e4 132783480e4 132783480e4 132783480e4
expect(Date.parse('2012-01-29T12:00:00.000-00:00')).toBe(132783840e4); // 132783840e4 132783840e4 132783840e4 132783840e4 132783840e4
expect(Date.parse('2012-01-29T12:00:00.000+00:00')).toBe(132783840e4); // 132783840e4 132783840e4 132783840e4 132783840e4 132783840e4
expect(Date.parse('2012-01-29T12:00:00.000+23:59')).toBe(132775206e4); // 132775206e4 132775206e4 132775206e4 132775206e4 132775206e4
expect(Date.parse('2012-01-29T12:00:00.000-23:59')).toBe(132792474e4); // 132792474e4 132792474e4 132792474e4 132792474e4 132792474e4
expect(Date.parse('2012-01-29T12:00:00.000+24:00')).toBeFalsy(); // NaN 1327752e6 NaN 1327752000000 1327752000000
expect(Date.parse('2012-01-29T12:00:00.000+24:01')).toBeFalsy(); // NaN NaN NaN 1327751940000 1327751940000
expect(Date.parse('2012-01-29T12:00:00.000+24:59')).toBeFalsy(); // NaN NaN NaN 1327748460000 1327748460000
expect(Date.parse('2012-01-29T12:00:00.000+25:00')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('2012-01-29T12:00:00.000+00:60')).toBeFalsy(); // NaN NaN NaN NaN NaN
expect(Date.parse('-271821-04-20T00:00:00.000+00:01')).toBeFalsy(); // NaN NaN NaN -864000000006e4 -864000008646e4
expect(Date.parse('-271821-04-20T00:01:00.000+00:01')).toBe(-8.64e15); // -8.64e15 NaN -8.64e15 -8.64e15 -864000008640e4
// When time zone is missed, local offset should be used (ES 5.1 bug)
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
var tzOffset = Number(new Date(1970, 0));
// same as (new Date().getTimezoneOffset() * 60000)
expect(Date.parse('1970-01-01T00:00:00')).toBe(tzOffset); // tzOffset 0 0 0 NaN
});
it('should be able to coerce to a number', function () {
var actual = Number(new Date(1970, 0));
var expected = parseInt(actual, 10);
expect(actual).toBeDefined();
expect(actual).toBe(expected);
expect(isNaN(actual)).toBeFalsy();
});
it('matches web reality', function () {
var actual = Number(new Date('1900-01-01T00:00:00.000'));
var upperBound = -2208988800000; // safari 6.2 - 13.1
var expected = -2208960000000;
expect(actual).toBeDefined();
expect(actual).toBeGreaterThan(upperBound - 1);
expect(actual).toBeLessThan(expected + 1);
// expect(actual).toBe(expected); // TODO: figure out if `upperBound` is a bug or just a difference
expect(isNaN(actual)).toBeFalsy();
});
});
describe('#toString()', function () {
var actual;
beforeEach(function () {
actual = (new Date(1970, 0)).toString();
});
it('should show correct date info for ' + actual, function () {
expect(actual).toMatch(/1970/);
expect(actual).toMatch(/jan/i);
expect(actual).toMatch(/thu/i);
expect(actual).toMatch(/00:00:00/);
});
});
describe('#valueOf()', function () {
// Note that new Date(1970, 0).valueOf() is 0 in UTC timezone.
// Check check that it's a number (and an int), not that it's "truthy".
var actual;
beforeEach(function () {
actual = (new Date(1970, 0)).valueOf();
});
it('should give a numeric value', function () {
expect(typeof actual).toBe('number');
});
it('should not be NaN', function () {
expect(isNaN(actual)).toBe(false);
});
it('should give an int value', function () {
expect(actual).toBe(Math.floor(actual));
});
});
describe('#getUTCDate()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getUTCDate()).toBe(item.days[index], date);
});
});
});
});
describe('#getUTCDay()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getUTCDay()).toBe(item.getUTCDay[index]);
});
});
});
});
describe('#getUTCFullYear()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCFullYear()).toBe(-109252);
});
});
});
});
describe('#getUTCMonth()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item, index) {
item.dates.forEach(function (date) {
expect(date.getUTCMonth()).toBe(index);
});
});
});
it('should return correct values', function () {
expect(new Date(8.64e15).getUTCMonth()).toBe(8);
expect(new Date(0).getUTCMonth()).toBe(0);
});
});
describe('#getUTCHours()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCHours()).toBe(11);
});
});
});
});
describe('#getUTCMinutes()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCMinutes()).toBe(59);
});
});
});
});
describe('#getUTCSeconds()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCSeconds()).toBe(59);
});
});
});
});
describe('#getUTCMilliseconds()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCMilliseconds()).toBe(708);
});
});
});
});
describe('#getDate()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getDate()).toBe(item.days[index]);
});
});
});
});
describe('#getDay()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getDay()).toBe(item.getDay[index]);
});
});
});
});
describe('#getFullYear()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getFullYear()).toBe(-109252);
});
});
});
});
describe('#getMonth()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item, index) {
item.dates.forEach(function (date) {
expect(date.getMonth()).toBe(index);
});
});
});
});
describe('#getHours()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getHours() + Math.floor(date.getTimezoneOffset() / 60)).toBe(11);
});
});
});
});
describe('#getMinutes()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
var off = date.getTimezoneOffset();
var offHours = Math.floor(off / 60);
var offMins = off - (offHours * 60);
var result = date.getMinutes() + offMins;
// ceil/floor is for Firefox
expect(result < 0 ? Math.ceil(result) : Math.floor(result)).toBe(59);
});
});
});
});
describe('#getSeconds()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, i) {
// the regex here is because in UTC, it's 59, but with TZData applied,
// which can have fractional hour offsets, it'll be 1.
expect(i + ':' + date.getSeconds()).toMatch(new RegExp(i + ':(?:' + 59 + '|' + 1 + ')'));
});
});
});
});
describe('#getMilliseconds()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getMilliseconds()).toBe(708);
});
});
});
});
describe('#toISOString()', function () {
// TODO: write the rest of the test.
it('should support extended years', function () {
expect(new Date(-62198755200000).toISOString().indexOf('-000001-01-01')).toBe(0);
expect(new Date(8.64e15).toISOString().indexOf('+275760-09-13')).toBe(0);
});
it('should return correct dates', function () {
expect(new Date(-1).toISOString()).toBe('1969-12-31T23:59:59.999Z'); // Safari 5.1.5 "1969-12-31T23:59:59.-01Z"
negativeDate.forEach(function (item, index) {
var m = index + 1;
item.dates.forEach(function (date, idx) {
var d = item.days[idx];
expect(date.toISOString()).toBe('-109252-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + 'T11:59:59.708Z'); // Opera 11.61/Opera 12 bug with Date#getUTCMonth
});
});
});
});
describe('#toUTCString()', function () {
it('should return correct dates', function () {
expect(new Date(-1509842289600292).toUTCString()).toBe('Mon, 01 Jan -45875 11:59:59 GMT');
});
});
describe('#toDateString()', function () {
it('should return correct dates', function () {
expect(new Date(-1509842289600292).toDateString()).toBe('Mon Jan 01 -45875');
});
});
describe('#toString()', function () {
it('should return correct dates', function () {
var actual = new Date(1449662400000).toString();
var re = /^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/;
expect(re.test(actual)).toBe(true, actual);
});
});
describe('#toJSON()', function () {
// Opera 11.6x/12 bug
it('should call toISOString', function () {
var date = new Date(0);
date.toISOString = function () {
return 1;
};
expect(date.toJSON()).toBe(1);
});
it('should return null for not finite dates', function () {
var date = new Date(NaN),
json;
try {
json = date.toJSON();
} catch (e) {
/* invalid json */
expect(e).not.toEqual(jasmine.any(Error));
}
expect(json).toBe(null);
});
it('should return the isoString when stringified', function () {
var date = new Date();
expect(JSON.stringify(date.toISOString())).toBe(JSON.stringify(date));
});
});
});

49
node_modules/es5-shim/tests/spec/s-error.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
describe('Error', function () {
'use strict';
var supportsDescriptors = Object.defineProperty && (function () {
try {
var obj = {};
Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
// eslint-disable-next-line no-unreachable-loop
for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
}
}());
var ifSupportsDescriptorsIt = supportsDescriptors ? it : xit;
describe('#toString()', function () {
it('stringifies a newed error properly', function () {
var msg = 'test';
var error = new RangeError(msg);
expect(error.name).toBe('RangeError');
expect(error.message).toBe(msg);
expect(String(error)).toBe(error.name + ': ' + msg);
});
it('stringifies a thrown error properly', function () {
var msg = 'test';
var error;
try {
throw new RangeError(msg);
} catch (e) {
error = e;
}
expect(error.name).toBe('RangeError');
expect(error.message).toBe(msg);
expect(String(error)).toBe(error.name + ': ' + msg);
});
});
describe('enumerability of prototype properties', function () {
ifSupportsDescriptorsIt('#message', function () {
expect(Object.prototype.propertyIsEnumerable.call(Error.prototype, 'message')).toBe(false);
});
ifSupportsDescriptorsIt('#name', function () {
expect(Object.prototype.propertyIsEnumerable.call(Error.prototype, 'name')).toBe(false);
});
});
});

174
node_modules/es5-shim/tests/spec/s-function.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
describe('Function', function () {
'use strict';
describe('#apply()', function () {
it('works with arraylike objects', function () {
var arrayLike = { length: 4, 0: 1, 2: 4, 3: true };
var expectedArray = [1, undefined, 4, true];
var actualArray = (function () {
return Array.prototype.slice.apply(arguments);
}.apply(null, arrayLike));
expect(actualArray).toEqual(expectedArray);
});
});
describe('#bind()', function () {
var actual;
var testSubject = {
push: function (o) {
this.a.push(o);
}
};
var func = function func() {
Array.prototype.forEach.call(arguments, function (a) {
this.push(a);
}, this);
return this;
};
beforeEach(function () {
actual = [];
testSubject.a = [];
});
it('binds properly without a context', function () {
var context;
testSubject.func = function () {
context = this;
}.bind();
testSubject.func();
expect(context).toBe(function () { return this; }.call());
});
it('binds properly without a context, and still supplies bound arguments', function () {
var a, context;
testSubject.func = function () {
a = Array.prototype.slice.call(arguments);
context = this;
}.bind(undefined, 1, 2, 3);
testSubject.func(1, 2, 3);
expect(a).toEqual([1, 2, 3, 1, 2, 3]);
expect(context).toBe(function () { return this; }.call());
});
it('binds a context properly', function () {
testSubject.func = func.bind(actual);
testSubject.func(1, 2, 3);
expect(actual).toEqual([1, 2, 3]);
expect(testSubject.a).toEqual([]);
});
it('binds a context and supplies bound arguments', function () {
testSubject.func = func.bind(actual, 1, 2, 3);
testSubject.func(4, 5, 6);
expect(actual).toEqual([1, 2, 3, 4, 5, 6]);
expect(testSubject.a).toEqual([]);
});
it('returns properly without binding a context', function () {
testSubject.func = function () {
return this;
}.bind();
var context = testSubject.func();
expect(context).toBe(function () { return this; }.call());
});
it('returns properly without binding a context, and still supplies bound arguments', function () {
var context;
testSubject.func = function () {
context = this;
return Array.prototype.slice.call(arguments);
}.bind(undefined, 1, 2, 3);
actual = testSubject.func(1, 2, 3);
expect(context).toBe(function () { return this; }.call());
expect(actual).toEqual([1, 2, 3, 1, 2, 3]);
});
it('returns properly while binding a context properly', function () {
var ret;
testSubject.func = func.bind(actual);
ret = testSubject.func(1, 2, 3);
expect(ret).toBe(actual);
expect(ret).not.toBe(testSubject);
});
it('returns properly while binding a context and supplies bound arguments', function () {
var ret;
testSubject.func = func.bind(actual, 1, 2, 3);
ret = testSubject.func(4, 5, 6);
expect(ret).toBe(actual);
expect(ret).not.toBe(testSubject);
});
it('has the new instance\'s context as a constructor', function () {
var actualContext;
var expectedContext = { foo: 'bar' };
testSubject.Func = function () {
actualContext = this;
}.bind(expectedContext);
var result = new testSubject.Func();
expect(result).toBeTruthy();
expect(actualContext).not.toBe(expectedContext);
});
it('passes the correct arguments as a constructor', function () {
var expected = { name: 'Correct' };
testSubject.Func = function (arg) {
expect(Object.prototype.hasOwnProperty.call(this, 'name')).toBe(false);
return arg;
}.bind({ name: 'Incorrect' });
var ret = new testSubject.Func(expected);
expect(ret).toBe(expected);
});
it('returns the return value of the bound function when called as a constructor', function () {
var oracle = [1, 2, 3];
var Subject = function () {
expect(this).not.toBe(oracle);
return oracle;
}.bind(null);
var result = new Subject();
expect(result).toBe(oracle);
});
it('returns the correct value if constructor returns primitive', function () {
var Subject = function (oracle) {
expect(this).not.toBe(oracle);
return oracle;
}.bind(null);
var primitives = ['asdf', null, true, 1];
for (var i = 0; i < primitives.length; ++i) {
expect(new Subject(primitives[i])).not.toBe(primitives[i]);
}
var objects = [[1, 2, 3], {}, function () {}];
for (var j = 0; j < objects.length; ++j) {
expect(new Subject(objects[j])).toBe(objects[j]);
}
});
it('returns the value that instance of original "class" when called as a constructor', function () {
var ClassA = function (x) {
this.name = x || 'A';
};
var ClassB = ClassA.bind(null, 'B');
var result = new ClassB();
expect(result instanceof ClassA).toBe(true);
expect(result instanceof ClassB).toBe(true);
});
it('sets a correct length without thisArg', function () {
var Subject = function (a, b, c) { return a + b + c; }.bind();
expect(Subject.length).toBe(3);
});
it('sets a correct length with thisArg', function () {
var Subject = function (a, b, c) { return a + b + c + this.d; }.bind({ d: 1 });
expect(Subject.length).toBe(3);
});
it('sets a correct length with thisArg and first argument', function () {
var Subject = function (a, b, c) { return a + b + c + this.d; }.bind({ d: 1 }, 1);
expect(Subject.length).toBe(2);
});
it('sets a correct length without thisArg and first argument', function () {
var Subject = function (a, b, c) { return a + b + c; }.bind(undefined, 1);
expect(Subject.length).toBe(2);
});
it('sets a correct length without thisArg and too many argument', function () {
var Subject = function (a, b, c) { return a + b + c; }.bind(undefined, 1, 2, 3, 4);
expect(Subject.length).toBe(0);
});
});
});

107
node_modules/es5-shim/tests/spec/s-global.js generated vendored Normal file
View File

@@ -0,0 +1,107 @@
describe('global methods', function () {
'use strict';
var foo = function foo() {};
var functionsHaveNames = foo.name === 'foo';
var ifFunctionsHaveNamesIt = functionsHaveNames ? it : xit;
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var ifSymbolsIt = hasSymbols ? it : xit;
var is = function (x, y) {
if (x === 0 && y === 0) {
return 1 / x === 1 / y;
}
return x === y;
};
describe('parseInt', function () {
/* eslint-disable radix */
ifFunctionsHaveNamesIt('has the right name', function () {
expect(parseInt.name).toBe('parseInt');
});
it('accepts a radix', function () {
for (var i = 2; i <= 36; ++i) {
expect(parseInt('10', i)).toBe(i);
}
});
it('defaults the radix to 10 when the number does not start with 0x or 0X', function () {
[
'01',
'08',
'10',
'42'
].forEach(function (str) {
expect(parseInt(str)).toBe(parseInt(str, 10));
});
});
it('defaults the radix to 16 when the number starts with 0x or 0X', function () {
expect(parseInt('0x16')).toBe(parseInt('0x16', 16));
expect(parseInt('0X16')).toBe(parseInt('0X16', 16));
});
it('ignores leading whitespace', function () {
expect(parseInt(' 0x16')).toBe(parseInt('0x16', 16));
expect(parseInt(' 42')).toBe(parseInt('42', 10));
expect(parseInt(' 08')).toBe(parseInt('08', 10));
var mvsIsWS = (/\s/).test('\u180E');
if (mvsIsWS) {
expect(parseInt('\u180E' + 1)).toBe(1);
} else {
expect(parseInt('\u180E' + 1)).toBeNaN();
}
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) on modern engines
expect(parseInt(ws + '08')).toBe(parseInt('08', 10));
expect(parseInt(ws + '0x16')).toBe(parseInt('0x16', 16));
});
it('defaults the radix properly when not a true number', function () {
var fakeZero = { valueOf: function () { return 0; } };
expect(parseInt('08', fakeZero)).toBe(parseInt('08', 10));
expect(parseInt('0x16', fakeZero)).toBe(parseInt('0x16', 16));
});
it('allows sign-prefixed hex values', function () {
expect(parseInt('-0xF')).toBe(-15);
expect(parseInt('-0xF', 16)).toBe(-15);
expect(parseInt('+0xF')).toBe(15);
expect(parseInt('+0xF', 16)).toBe(15);
});
it('NaN parsing', function () {
expect(parseInt()).toBeNaN();
expect(parseInt(undefined)).toBeNaN();
expect(parseInt(null)).toBeNaN();
expect(parseInt(NaN)).toBeNaN();
});
ifSymbolsIt('throws on symbols', function () {
expect(function () { parseInt(Symbol('')); }).toThrow();
expect(function () { parseInt(Object(Symbol(''))); }).toThrow();
});
/* eslint-enable radix */
});
describe('parseFloat()', function () {
it('works with zeroes', function () {
expect(is(parseFloat('0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat(' 0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat('+0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat(' +0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat('-0'), -0) ? '-0' : '+0').toBe('-0');
expect(is(parseFloat(' -0'), -0) ? '-0' : '+0').toBe('-0');
});
it('NaN parsing', function () {
expect(parseFloat(undefined)).toBeNaN();
expect(parseFloat(null)).toBeNaN();
expect(parseFloat(NaN)).toBeNaN();
});
});
});

103
node_modules/es5-shim/tests/spec/s-number.js generated vendored Normal file
View File

@@ -0,0 +1,103 @@
describe('Number', function () {
'use strict';
describe('#toExponential()', function () {
// the spec allows for this test to fail.
it('throws a RangeError when < 0 or > 20 (or > 100 in ES2018+)', function () {
expect(function () { return 1.0.toExponential(-1); }).toThrow();
expect(function () { return 1.0.toExponential(-Infinity); }).toThrow();
expect(function () { return 1.0.toExponential(Infinity); }).toThrow();
expect(function () {
return [
(0.9).toExponential(21), // ES2018 increased the limit from 21 to 100
(0.9).toExponential(101)
];
}).toThrow();
});
it('works for NaN receiver', function () {
expect(NaN.toExponential(NaN)).toBe('NaN');
expect(NaN.toExponential('abc')).toBe('NaN');
});
it('works for non-finite receivers', function () {
expect(Infinity.toExponential()).toBe('Infinity');
expect((-Infinity).toExponential()).toBe('-Infinity');
});
it('should round properly', function () {
expect(1.0.toExponential()).toBe('1e+0');
expect(1.0.toExponential(0)).toBe('1e+0');
expect(1.0.toExponential(1)).toBe('1.0e+0');
expect(1.0.toExponential(2)).toBe('1.00e+0');
expect(1.2345.toExponential()).toBe('1.2345e+0');
expect(1.2345.toExponential(0)).toBe('1e+0');
expect(1.2345.toExponential(1)).toBe('1.2e+0');
expect(1.2345.toExponential(2)).toBe('1.23e+0');
expect(1.2345.toExponential(3)).toMatch(/^1.23[45]e\+0$/);
expect(1.2345.toExponential(4)).toBe('1.2345e+0');
expect(1.2345.toExponential(5)).toBe('1.23450e+0');
expect((-6.9e-11).toExponential(4)).toBe('-6.9000e-11');
});
});
describe('#toFixed()', function () {
it('should convert numbers correctly', function () {
expect((0.00008).toFixed(3)).toBe('0.000');
expect((0.9).toFixed(0)).toBe('1');
expect((1.255).toFixed(2)).toBe('1.25');
expect((1843654265.0774949).toFixed(5)).toBe('1843654265.07749');
expect((1000000000000000128).toFixed(0)).toBe('1000000000000000128');
});
});
describe('#toPrecision()', function () {
// the spec allows for this test to fail.
it('throws a RangeError when < 1 or > 21 (or > 100 in ES2018+)', function () {
expect(function () { return (0.9).toPrecision(0); }).toThrow();
expect(function () {
return [
(0.9).toPrecision(22), // ES2018 increased the limit from 21 to 100
(0.9).toPrecision(101)
];
}).toThrow();
});
it('works as expected', function () {
expect((0.00008).toPrecision(3)).toBe('0.0000800');
expect((1.255).toPrecision(2)).toBe('1.3');
expect((1843654265.0774949).toPrecision(13)).toBe('1843654265.077');
expect(NaN.toPrecision(1)).toBe('NaN');
});
it('works with an undefined precision', function () {
var num = 123.456;
expect(num.toPrecision()).toBe(String(num));
expect(num.toPrecision(undefined)).toBe(String(num));
});
});
describe('constants', function () {
it('should have MAX_VALUE', function () {
expect(Number.MAX_VALUE).toBe(1.7976931348623157e308);
});
it('should have MIN_VALUE', function () {
expect(Number.MIN_VALUE).toBe(5e-324);
});
it('should have NaN', function () {
expect(Number.NaN).not.toBe(Number.NaN);
});
it('should have POSITIVE_INFINITY', function () {
expect(Number.POSITIVE_INFINITY).toBe(Infinity);
});
it('should have NEGATIVE_INFINITY', function () {
expect(Number.NEGATIVE_INFINITY).toBe(-Infinity);
});
});
});

403
node_modules/es5-shim/tests/spec/s-object.js generated vendored Normal file
View File

@@ -0,0 +1,403 @@
/* global window */
var has = Object.prototype.hasOwnProperty;
var supportsDescriptors = Object.defineProperty && (function () {
try {
var obj = {};
Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
// eslint-disable-next-line no-unreachable-loop
for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
}
}());
var ifSupportsDescriptorsIt = supportsDescriptors ? it : xit;
var ifWindowIt = typeof window === 'undefined' ? xit : it;
var extensionsPreventible = typeof Object.preventExtensions === 'function' && (function () {
var obj = {};
Object.preventExtensions(obj);
obj.a = 3;
return obj.a !== 3;
}());
var ifExtensionsPreventibleIt = extensionsPreventible ? it : xit;
var canSeal = typeof Object.seal === 'function' && (function () {
var obj = { a: 3 };
Object.seal(obj);
delete obj.a;
return obj.a === 3;
}());
var ifCanSealIt = canSeal ? it : xit;
var canFreeze = typeof Object.freeze === 'function' && (function () {
var obj = {};
Object.freeze(obj);
obj.a = 3;
return obj.a !== 3;
}());
var ifCanFreezeIt = canFreeze ? it : xit;
describe('Object', function () {
'use strict';
describe('.keys()', function () {
var obj = {
str: 'boz',
obj: { },
arr: [],
bool: true,
num: 42,
'null': null,
undefined: undefined
};
var loopedValues = [];
for (var key in obj) {
loopedValues.push(key);
}
var keys = Object.keys(obj);
it('should have correct length', function () {
expect(keys.length).toBe(7);
});
describe('arguments objects', function () {
it('works with an arguments object', function () {
(function () {
expect(arguments.length).toBe(3);
expect(Object.keys(arguments).length).toBe(arguments.length);
expect(Object.keys(arguments)).toEqual(['0', '1', '2']);
}(1, 2, 3));
});
it('works with a legacy arguments object', function () {
var FakeArguments = function (args) {
args.forEach(function (arg, i) {
this[i] = arg;
}.bind(this));
};
FakeArguments.prototype.length = 3;
FakeArguments.prototype.callee = function () {};
var fakeOldArguments = new FakeArguments(['a', 'b', 'c']);
expect(Object.keys(fakeOldArguments)).toEqual(['0', '1', '2']);
});
});
it('should return an Array', function () {
expect(Array.isArray(keys)).toBe(true);
});
it('should return names which are own properties', function () {
keys.forEach(function (name) {
expect(has.call(obj, name)).toBe(true);
});
});
it('should return names which are enumerable', function () {
keys.forEach(function (name) {
expect(loopedValues.indexOf(name)).toNotBe(-1);
});
});
// ES6 Object.keys does not require this throw
xit('should throw error for non object', function () {
var e = {};
expect(function () {
try {
Object.keys(42);
} catch (err) {
throw e;
}
}).toThrow(e);
});
describe('enumerating over non-enumerable properties', function () {
it('has no enumerable keys on a Function', function () {
var Foo = function () {};
expect(Object.keys(Foo.prototype)).toEqual([]);
});
it('has no enumerable keys on a boolean', function () {
expect(Object.keys(Boolean.prototype)).toEqual([]);
});
it('has no enumerable keys on an object', function () {
expect(Object.keys(Object.prototype)).toEqual([]);
});
});
it('works with boxed primitives', function () {
expect(Object.keys(Object('hello'))).toEqual(['0', '1', '2', '3', '4']);
});
it('works with boxed primitives with extra properties', function () {
var x = Object('x');
x.y = 1;
var actual = Object.keys(x);
var expected = ['0', 'y'];
actual.sort();
expected.sort();
expect(actual).toEqual(expected);
});
ifWindowIt('can serialize all objects on the `window`', function () {
var windowItemKeys, exception;
var excludedKeys = ['window', 'console', 'parent', 'self', 'frame', 'frames', 'frameElement', 'external', 'height', 'width', 'top', 'localStorage', 'applicationCache'];
if (supportsDescriptors) {
Object.defineProperty(window, 'thrower', {
configurable: true,
get: function () { throw new RangeError('thrower!'); }
});
}
for (var k in window) {
exception = void 0;
windowItemKeys = exception;
if (excludedKeys.indexOf(k) === -1 && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
windowItemKeys = Object.keys(window[k]);
} catch (e) {
exception = e;
}
expect(Array.isArray(windowItemKeys)).toBe(true);
expect(exception).toBeUndefined();
}
}
if (supportsDescriptors) {
delete window.thrower;
}
});
});
describe('.isExtensible()', function () {
var obj = { };
it('should return true if object is extensible', function () {
expect(Object.isExtensible(obj)).toBe(true);
});
ifExtensionsPreventibleIt('should return false if object is not extensible', function () {
expect(Object.isExtensible(Object.preventExtensions(obj))).toBe(false);
});
ifCanSealIt('should return false if object is sealed', function () {
expect(Object.isExtensible(Object.seal(obj))).toBe(false);
});
ifCanFreezeIt('should return false if object is frozen', function () {
expect(Object.isExtensible(Object.freeze(obj))).toBe(false);
});
it('should throw error for non object', function () {
try {
// note: in ES6, this is expected to return false.
expect(Object.isExtensible(42)).toBe(false);
} catch (err) {
expect(err).toEqual(jasmine.any(TypeError));
}
});
});
describe('.defineProperty()', function () {
var obj;
beforeEach(function () {
obj = {};
Object.defineProperty(obj, 'name', {
value: 'Testing',
configurable: true,
enumerable: true,
writable: true
});
});
it('should return the initial value', function () {
expect(has.call(obj, 'name')).toBeTruthy();
expect(obj.name).toBe('Testing');
});
it('should be setable', function () {
obj.name = 'Other';
expect(obj.name).toBe('Other');
});
it('should return the parent initial value', function () {
var child = Object.create(obj, {});
expect(child.name).toBe('Testing');
expect(has.call(child, 'name')).toBeFalsy();
});
it('should not override the parent value', function () {
var child = Object.create(obj, {});
Object.defineProperty(child, 'name', { value: 'Other' });
expect(obj.name).toBe('Testing');
expect(child.name).toBe('Other');
});
it('should throw error for non object', function () {
expect(function () {
Object.defineProperty(42, 'name', {});
}).toThrow();
});
it('should not throw error for empty descriptor', function () {
expect(function () {
Object.defineProperty({}, 'name', {});
}).not.toThrow();
});
ifSupportsDescriptorsIt('allows setting a nonwritable prototype', function () {
var F = function () {};
expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(Object.prototype.toString);
F.prototype = Number.prototype;
expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(Number.prototype.toString);
var toStringSentinel = {};
var sentinel = { toString: toStringSentinel };
Object.defineProperty(F, 'prototype', { value: sentinel, writable: false });
expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(toStringSentinel);
});
ifSupportsDescriptorsIt('properly makes a prototype non-writable', function () {
var O = { prototype: 1 };
expect(O.prototype).toEqual(Object.getOwnPropertyDescriptor(O, 'prototype').value);
expect(O.prototype).toEqual(1);
expect(function () {
Object.defineProperty(O, 'prototype', { writable: false, configurable: true });
}).not.toThrow();
var sentinel = {};
expect(function () {
Object.defineProperty(O, 'prototype', { value: sentinel });
}).not.toThrow();
expect(O.prototype).toEqual(Object.getOwnPropertyDescriptor(O, 'prototype').value);
expect(O.prototype).toEqual(sentinel);
});
});
describe('.getOwnPropertyDescriptor()', function () {
it('should return undefined because the object does not own the property', function () {
var descr = Object.getOwnPropertyDescriptor({}, 'name');
expect(descr).toBeUndefined();
});
it('should return a data descriptor', function () {
var descr = Object.getOwnPropertyDescriptor({ name: 'Testing' }, 'name');
var expected = {
value: 'Testing',
enumerable: true,
writable: true,
configurable: true
};
expect(descr).toEqual(expected);
});
it('should return undefined because the object does not own the property', function () {
var descr = Object.getOwnPropertyDescriptor(Object.create({ name: 'Testing' }, {}), 'name');
expect(descr).toBeUndefined();
});
it('should return a data descriptor', function () {
var expected = {
value: 'Testing',
configurable: true,
enumerable: true,
writable: true
};
var obj = Object.create({}, { name: expected });
var descr = Object.getOwnPropertyDescriptor(obj, 'name');
expect(descr).toEqual(expected);
});
it('should throw error for non object', function () {
try {
// note: in ES6, we expect this to return undefined.
expect(Object.getOwnPropertyDescriptor(42, 'name')).toBeUndefined();
} catch (err) {
expect(err).toEqual(jasmine.any(TypeError));
}
});
});
describe('.getPrototypeOf()', function () {
it('should return the [[Prototype]] of an object', function () {
var Foo = function () {};
var proto = Object.getPrototypeOf(new Foo());
expect(proto).toBe(Foo.prototype);
});
it('should shamone to the `Object.prototype` if `object.constructor` is not a function', function () {
var Foo = function () {};
Foo.prototype.constructor = 1;
var proto = Object.getPrototypeOf(new Foo()),
fnToString = Function.prototype.toString;
if (fnToString.call(Object.getPrototypeOf).indexOf('[native code]') < 0) {
expect(proto).toBe(Object.prototype);
} else {
expect(proto).toBe(Foo.prototype);
}
});
it('should throw error for non object', function () {
try {
expect(Object.getPrototypeOf(1)).toBe(Number.prototype); // ES6 behavior
} catch (err) {
expect(err).toEqual(jasmine.any(TypeError));
}
});
it('should return null on Object.create(null)', function () {
var obj = Object.create(null);
expect(Object.getPrototypeOf(obj) === null).toBe(true);
});
});
describe('.defineProperties()', function () {
it('should define the constructor property', function () {
var target = {};
var newProperties = { constructor: { value: 'new constructor' } };
Object.defineProperties(target, newProperties);
expect(target.constructor).toBe('new constructor');
});
});
describe('.create()', function () {
it('should create objects with no properties when called as `Object.create(null)`', function () {
var obj = Object.create(null);
expect('hasOwnProperty' in obj).toBe(false);
expect('toString' in obj).toBe(false);
expect('constructor' in obj).toBe(false);
var protoIsEnumerable = false;
for (var k in obj) {
if (k === '__proto__') {
protoIsEnumerable = true;
}
}
expect(protoIsEnumerable).toBe(false);
expect(obj instanceof Object).toBe(false);
});
});
});

26
node_modules/es5-shim/tests/spec/s-regexp.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
describe('RegExp', function () {
'use strict';
describe('#toString()', function () {
describe('literals', function () {
it('should return correct flags and in correct order', function () {
expect(String(/pattern/)).toBe('/pattern/');
expect(String(/pattern/i)).toBe('/pattern/i');
expect(String(/pattern/mi)).toBe('/pattern/im');
expect(String(/pattern/im)).toBe('/pattern/im');
expect(String(/pattern/mgi)).toBe('/pattern/gim');
});
});
describe('objects', function () {
it('should return correct flags and in correct order', function () {
/* eslint prefer-regex-literals: 0 */
expect(String(new RegExp('pattern'))).toBe('/pattern/');
expect(String(new RegExp('pattern', 'i'))).toBe('/pattern/i');
expect(String(new RegExp('pattern', 'mi'))).toBe('/pattern/im');
expect(String(new RegExp('pattern', 'im'))).toBe('/pattern/im');
expect(String(new RegExp('pattern', 'mgi'))).toBe('/pattern/gim');
});
});
});
});

277
node_modules/es5-shim/tests/spec/s-string.js generated vendored Normal file
View File

@@ -0,0 +1,277 @@
describe('String', function () {
'use strict';
describe('#trim()', function () {
var mvs = '\u180E';
var mvsIsWS = (/\s/).test(mvs);
var test = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680' + (mvsIsWS ? mvs : '') + '\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFFHello, World!\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680' + (mvsIsWS ? mvs : '') + '\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
it('trims all ES5 whitespace', function () {
expect(test.trim()).toBe('Hello, World!');
expect(test.trim().length).toBe(13);
});
it('does not trim the zero-width space', function () {
var zws = '\u200b';
expect(zws.trim()).toBe(zws);
});
it('properly handles the mongolian vowel separator', function () {
if (mvsIsWS) {
expect(mvs.trim()).toBe('');
} else {
expect(mvs.trim()).toBe(mvs);
}
});
});
describe('#replace()', function () {
it('returns undefined for non-capturing groups', function () {
var groups = [];
'x'.replace(/x(.)?/g, function (m, group) {
groups.push(group); /* "" in FF, `undefined` in CH/WK/IE */
});
expect(groups.length).toBe(1);
expect(groups[0]).toBeUndefined();
});
it('should not fail in Firefox', function () {
expect(function () {
return '* alef\n* beth \n* gimel~0\n'.replace(
/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,
function (match, m1, m2, m3, m4) { return '<li>' + m4 + '</li>\n'; }
);
}).not.toThrow();
});
});
describe('#split()', function () {
var test = 'ab';
it('If "separator" is undefined must return Array with one String - "this" string', function () {
expect(test.split()).toEqual([test]);
expect(test.split(void 0)).toEqual([test]);
});
it('If "separator" is undefined and "limit" set to 0 must return Array[]', function () {
expect(test.split(void 0, 0)).toEqual([]);
});
describe('Tests from Steven Levithan', function () {
it("''.split() results in ['']", function () {
expect(''.split()).toEqual(['']);
});
it("''.split(/./) results in ['']", function () {
expect(''.split(/./)).toEqual(['']);
});
it("''.split(/.?/) results in []", function () {
expect(''.split(/.?/)).toEqual([]);
});
it("''.split(/.??/) results in []", function () {
expect(''.split(/.??/)).toEqual([]);
});
it("'ab'.split(/a*/) results in ['', 'b']", function () {
expect('ab'.split(/a*/)).toEqual(['', 'b']);
});
it("'ab'.split(/a*?/) results in ['a', 'b']", function () {
expect('ab'.split(/a*?/)).toEqual(['a', 'b']);
});
it("'ab'.split(/(?:ab)/) results in ['', '']", function () {
expect('ab'.split(/(?:ab)/)).toEqual(['', '']);
});
it("'ab'.split(/(?:ab)*/) results in ['', '']", function () {
expect('ab'.split(/(?:ab)*/)).toEqual(['', '']);
});
it("'ab'.split(/(?:ab)*?/) results in ['a', 'b']", function () {
expect('ab'.split(/(?:ab)*?/)).toEqual(['a', 'b']);
});
it("'test'.split('') results in ['t', 'e', 's', 't']", function () {
expect('test'.split('')).toEqual(['t', 'e', 's', 't']);
});
it("'test'.split() results in ['test']", function () {
expect('test'.split()).toEqual(['test']);
});
it("'111'.split(1) results in ['', '', '', '']", function () {
expect('111'.split(1)).toEqual(['', '', '', '']);
});
it("'test'.split(/(?:)/, 2) results in ['t', 'e']", function () {
expect('test'.split(/(?:)/, 2)).toEqual(['t', 'e']);
});
it("'test'.split(/(?:)/, -1) results in ['t', 'e', 's', 't']", function () {
expect('test'.split(/(?:)/, -1)).toEqual(['t', 'e', 's', 't']);
});
it("'test'.split(/(?:)/, undefined) results in ['t', 'e', 's', 't']", function () {
expect('test'.split(/(?:)/, undefined)).toEqual(['t', 'e', 's', 't']);
});
it("'test'.split(/(?:)/, null) results in []", function () {
expect('test'.split(/(?:)/, null)).toEqual([]);
});
it("'test'.split(/(?:)/, NaN) results in []", function () {
expect('test'.split(/(?:)/, NaN)).toEqual([]);
});
it("'test'.split(/(?:)/, true) results in ['t']", function () {
expect('test'.split(/(?:)/, true)).toEqual(['t']);
});
it("'test'.split(/(?:)/, '2') results in ['t', 'e']", function () {
expect('test'.split(/(?:)/, '2')).toEqual(['t', 'e']);
});
it("'test'.split(/(?:)/, 'two') results in []", function () {
expect('test'.split(/(?:)/, 'two')).toEqual([]);
});
it("'a'.split(/-/) results in ['a']", function () {
expect('a'.split(/-/)).toEqual(['a']);
});
it("'a'.split(/-?/) results in ['a']", function () {
expect('a'.split(/-?/)).toEqual(['a']);
});
it("'a'.split(/-??/) results in ['a']", function () {
expect('a'.split(/-??/)).toEqual(['a']);
});
it("'a'.split(/a/) results in ['', '']", function () {
expect('a'.split(/a/)).toEqual(['', '']);
});
it("'a'.split(/a?/) results in ['', '']", function () {
expect('a'.split(/a?/)).toEqual(['', '']);
});
it("'a'.split(/a??/) results in ['a']", function () {
expect('a'.split(/a??/)).toEqual(['a']);
});
it("'ab'.split(/-/) results in ['ab']", function () {
expect('ab'.split(/-/)).toEqual(['ab']);
});
it("'ab'.split(/-?/) results in ['a', 'b']", function () {
expect('ab'.split(/-?/)).toEqual(['a', 'b']);
});
it("'ab'.split(/-??/) results in ['a', 'b']", function () {
expect('ab'.split(/-??/)).toEqual(['a', 'b']);
});
it("'a-b'.split(/-/) results in ['a', 'b']", function () {
expect('a-b'.split(/-/)).toEqual(['a', 'b']);
});
it("'a-b'.split(/-?/) results in ['a', 'b']", function () {
expect('a-b'.split(/-?/)).toEqual(['a', 'b']);
});
it("'a-b'.split(/-??/) results in ['a', '-', 'b']", function () {
expect('a-b'.split(/-??/)).toEqual(['a', '-', 'b']);
});
it("'a--b'.split(/-/) results in ['a', '', 'b']", function () {
expect('a--b'.split(/-/)).toEqual(['a', '', 'b']);
});
it("'a--b'.split(/-?/) results in ['a', '', 'b']", function () {
expect('a--b'.split(/-?/)).toEqual(['a', '', 'b']);
});
it("'a--b'.split(/-??/) results in ['a', '-', '-', 'b']", function () {
expect('a--b'.split(/-??/)).toEqual(['a', '-', '-', 'b']);
});
it("''.split(/()()/) results in []", function () {
expect(''.split(/()()/)).toEqual([]);
});
it("'.'.split(/()()/) results in ['.']", function () {
expect('.'.split(/()()/)).toEqual(['.']);
});
it("'.'.split(/(.?)(.?)/) results in ['', '.', '', '']", function () {
expect('.'.split(/(.?)(.?)/)).toEqual(['', '.', '', '']);
});
it("'.'.split(/(.??)(.??)/) results in ['.']", function () {
expect('.'.split(/(.??)(.??)/)).toEqual(['.']);
});
it("'.'.split(/(.)?(.)?/) results in ['', '.', undefined, '']", function () {
expect('.'.split(/(.)?(.)?/)).toEqual(['', '.', undefined, '']);
});
it("'A<B>bold</B>and<CODE>coded</CODE>'.split(/<(\\/)?([^<>]+)>/) results in ['A', undefined, 'B', 'bold', '/', 'B', 'and', undefined, 'CODE', 'coded', '/', 'CODE', '']", function () {
expect('A<B>bold</B>and<CODE>coded</CODE>'.split(/<(\/)?([^<>]+)>/)).toEqual(['A', undefined, 'B', 'bold', '/', 'B', 'and', undefined, 'CODE', 'coded', '/', 'CODE', '']);
});
it("'tesst'.split(/(s)*/) results in ['t', undefined, 'e', 's', 't']", function () {
expect('tesst'.split(/(s)*/)).toEqual(['t', undefined, 'e', 's', 't']);
});
it("'tesst'.split(/(s)*?/) results in ['t', undefined, 'e', undefined, 's', undefined, 's', undefined, 't']", function () {
expect('tesst'.split(/(s)*?/)).toEqual(['t', undefined, 'e', undefined, 's', undefined, 's', undefined, 't']);
});
it("'tesst'.split(/(s*)/) results in ['t', '', 'e', 'ss', 't']", function () {
expect('tesst'.split(/(s*)/)).toEqual(['t', '', 'e', 'ss', 't']);
});
it("'tesst'.split(/(s*?)/) results in ['t', '', 'e', '', 's', '', 's', '', 't']", function () {
expect('tesst'.split(/(s*?)/)).toEqual(['t', '', 'e', '', 's', '', 's', '', 't']);
});
it("'tesst'.split(/(?:s)*/) results in ['t', 'e', 't']", function () {
expect('tesst'.split(/(?:s)*/)).toEqual(['t', 'e', 't']);
});
it("'tesst'.split(/(?=s+)/) results in ['te', 's', 'st']", function () {
expect('tesst'.split(/(?=s+)/)).toEqual(['te', 's', 'st']);
});
it("'test'.split('t') results in ['', 'es', '']", function () {
expect('test'.split('t')).toEqual(['', 'es', '']);
});
it("'test'.split('es') results in ['t', 't']", function () {
expect('test'.split('es')).toEqual(['t', 't']);
});
it("'test'.split(/t/) results in ['', 'es', '']", function () {
expect('test'.split(/t/)).toEqual(['', 'es', '']);
});
it("'test'.split(/es/) results in ['t', 't']", function () {
expect('test'.split(/es/)).toEqual(['t', 't']);
});
it("'test'.split(/(t)/) results in ['', 't', 'es', 't', '']", function () {
expect('test'.split(/(t)/)).toEqual(['', 't', 'es', 't', '']);
});
it("'test'.split(/(es)/) results in ['t', 'es', 't']", function () {
expect('test'.split(/(es)/)).toEqual(['t', 'es', 't']);
});
it("'test'.split(/(t)(e)(s)(t)/) results in ['', 't', 'e', 's', 't', '']", function () {
expect('test'.split(/(t)(e)(s)(t)/)).toEqual(['', 't', 'e', 's', 't', '']);
});
it("'.'.split(/(((.((.??)))))/) results in ['', '.', '.', '.', '', '', '']", function () {
expect('.'.split(/(((.((.??)))))/)).toEqual(['', '.', '.', '.', '', '', '']);
});
it("'.'.split(/(((((.??)))))/) results in ['.']", function () {
expect('.'.split(/(((((.??)))))/)).toEqual(['.']);
});
it("'a b c d'.split(/ /, -(Math.pow(2, 32) - 1)) results in ['a']", function () {
expect('a b c d'.split(/ /, -(Math.pow(2, 32) - 1))).toEqual(['a']);
});
it("'a b c d'.split(/ /, Math.pow(2, 32) + 1) results in ['a']", function () {
expect('a b c d'.split(/ /, Math.pow(2, 32) + 1)).toEqual(['a']);
});
it("'a b c d'.split(/ /, Infinity) results in []", function () {
expect('a b c d'.split(/ /, Infinity)).toEqual([]);
});
});
it('works with the second argument', function () {
expect('a b'.split(/ /, 1)).toEqual(['a']);
});
});
describe('#indexOf()', function () {
it('has basic support', function () {
expect('abcab'.indexOf('a')).toBe(0);
expect('abcab'.indexOf('a', 1)).toBe(3);
expect('abcab'.indexOf('a', 4)).toBe(-1);
});
it('works with unicode', function () {
expect('あいabcあいabc'.indexOf('あい')).toBe(0);
expect('あいabcあいabc'.indexOf('あい', 0)).toBe(0);
expect('あいabcあいabc'.indexOf('あい', 1)).toBe(5);
expect('あいabcあいabc'.indexOf('あい', 6)).toBe(-1);
});
});
describe('#lastIndexOf()', function () {
it('has the right length', function () {
expect(String.prototype.lastIndexOf.length).toBe(1);
});
it('has basic support', function () {
expect('abcd'.lastIndexOf('d')).toBe(3);
expect('abcd'.lastIndexOf('d', 3)).toBe(3);
expect('abcd'.lastIndexOf('d', 2)).toBe(-1);
});
it('works with unicode', function () {
expect('abcあい'.lastIndexOf('あい')).toBe(3);
expect('abcあい'.lastIndexOf('あい', 3)).toBe(3);
expect('abcあい'.lastIndexOf('あい', 2)).toBe(-1);
});
});
});