1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

add some babel stuff

This commit is contained in:
s2
2018-05-05 15:35:25 +02:00
parent d17c4fe70c
commit e76e795120
604 changed files with 103725 additions and 62 deletions

13
node_modules/es-abstract/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,13 @@
root = true
[*]
indent_style = tab;
insert_final_newline = true;
quote_type = auto;
space_after_anonymous_functions = true;
space_after_control_statements = true;
spaces_around_operators = true;
trim_trailing_whitespace = true;
spaces_in_brackets = false;
end_of_line = lf;

22
node_modules/es-abstract/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"array-bracket-newline": 0,
"array-element-newline": 0,
"complexity": 0,
"eqeqeq": [2, "allow-null"],
"func-name-matching": 0,
"id-length": [2, { "min": 1, "max": 30 }],
"max-lines": [2, 700],
"max-params": [2, 4],
"max-statements": [2, 24],
"max-statements-per-line": [2, { "max": 2 }],
"no-magic-numbers": 0,
"new-cap": 0,
"no-extra-parens": 1,
"sort-keys": 0
}
}

176
node_modules/es-abstract/.jscs.json generated vendored Normal file
View File

@@ -0,0 +1,176 @@
{
"es3": true,
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"disallowSpaceAfterKeywords": [],
"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,
"disallowNodeTypes": [
"DebuggerStatement",
"ForInStatement",
"LabeledStatement",
"SwitchCase",
"SwitchStatement",
"WithStatement"
],
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
"requireSpaceBetweenArguments": true,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"requireSpaceAfterPrefixUnaryOperators": [],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforePostfixUnaryOperators": [],
"disallowSpaceBeforeBinaryOperators": [],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterBinaryOperators": [],
"disallowImplicitTypeConversion": ["binary", "string"],
"disallowKeywords": ["with", "eval"],
"requireKeywordsOnNewLine": [],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"excludeFiles": ["node_modules/**", "vendor/**"],
"disallowMultipleLineStrings": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireParenthesesAroundIIFE": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"escape": true,
"mark": "'"
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 9
},
"requirePaddingNewLinesAfterUseStrict": true,
"disallowArrowFunctions": true,
"disallowMultiLineTernary": true,
"validateOrderInObjectKeys": false,
"disallowIdenticalDestructuringNames": true,
"disallowNestedTernaries": { "maxLevel": 1 },
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,
"requireSpacesInGenerator": {
"afterStar": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowVar": false,
"requireArrayDestructuring": false,
"requireEnhancedObjectLiterals": false,
"requireObjectDestructuring": false,
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false,
"disallowUnusedVariables": true,
"requireSpacesInsideImportedObjectBraces": true,
"requireUseStrict": true
}

15
node_modules/es-abstract/.nycrc generated vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"all": true,
"check": true,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 98,
"statements": 97,
"functions": 93,
"branches": 94,
"exclude": [
"coverage",
"operations",
"test"
],
"xreport-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov"
}

207
node_modules/es-abstract/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,207 @@
language: node_js
os:
- linux
node_js:
- "9.8"
- "8.10"
- "7.10"
- "6.13"
- "5.12"
- "4.8"
- "iojs-v3.3"
- "iojs-v2.5"
- "iojs-v1.8"
- "0.12"
- "0.10"
- "0.8"
- "0.6"
before_install:
- 'nvm install-latest-npm'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
env:
- TEST=true
matrix:
fast_finish: true
include:
- node_js: "lts/*"
env: PRETEST=true
- node_js: "lts/*"
env: POSTTEST=true
- node_js: "0.8"
env: COVERAGE=true
- node_js: "0.12"
env: COVERAGE=true
- node_js: "4"
env: COVERAGE=true
- node_js: "8"
env: COVERAGE=true
- node_js: "9.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.4"
env: TEST=true ALLOW_FAILURE=true
allow_failures:
- os: osx
- env: TEST=true ALLOW_FAILURE=true

169
node_modules/es-abstract/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,169 @@
1.11.0 / 2018-03-21
=================
* [New] `ES2015+`: add iterator abstract ops
* [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape`
* [Tests] up to `node` `v9.8`, `v8.10`, `v6.13`
1.10.0 / 2017-11-24
=================
* [New] ES2015+: `AdvanceStringIndex`
* [Dev Deps] update `eslint`, `nsp`
* [Tests] require node 0.6 to pass again
* [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
1.9.0 / 2017-09-30
=================
* [New] `es2015+`: add `ArraySpeciesCreate`
* [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow`
* [Tests] consolidate duplicated tests
* [Tests] increase coverage
* [Dev Deps] update `nsp`, `eslint`
1.8.2 / 2017-09-03
=================
* [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27)
* [Dev Deps] update `eslint`
1.8.1 / 2017-08-30
=================
* [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26)
* [Deps] update `function-bind`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`
* [Docs] github broke markdown parsing
1.8.0 / 2017-08-04
=================
* [New] add ES2017
* [New] move es6+ to es2015+; leave es6/es7 as aliases
* [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor`
* [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec`
* [Fix] es7/es2016: do not mutate ES6
* [Fix] assign helper only supports one source
* [Deps] update `is-regex`
* [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape`
* [Tests] add tests for missing and excess operations
* [Tests] add codecov for coverage
* [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node
* [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same
* [Tests] ES2015: add ToNumber symbol tests
* [Tests] switch to `nyc` for code coverage
* [Tests] make IsRegExp tests consistent across editions
1.7.0 / 2017-01-22
=================
* [New] ES6: Add `GetMethod` (#16)
* [New] ES6: Add `GetV` (#16)
* [New] ES6: Add `Get` (#17)
* [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix
* [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
1.6.1 / 2016-08-21
=================
* [Fix] ES6: IsConstructor should return true for `class` constructors.
1.6.0 / 2016-08-20
=================
* [New] ES5 / ES6: add `Type`
* [New] ES6: `SpeciesConstructor`
* [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest`
* [Tests] up to `node` `v6.4`, `v5.12`, `v4.5`
1.5.1 / 2016-05-30
=================
* [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument
* [Refactor] create `isNaN` helper
* [Deps] update `is-callable`, `function-bind`
* [Deps] update `es-to-primitive`, fix ES5 tests
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp`
* [Tests] up to `node` `v6.2`, `v5.11`, `v4.4`
* [Tests] use pretest/posttest for linting/security
1.5.0 / 2015-12-27
=================
* [New] adds `Symbol.toPrimitive` support via `es-to-primitive`
* [Deps] update `is-callable`, `es-to-primitive`
* [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape`
* [Tests] up to `node` `v5.3`
1.4.3 / 2015-11-04
=================
* [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4)
* [Refactor] `ES6.ToNumber`: No need to double-trim
* [Refactor] group tests better
* [Tests] should still pass on `node` `v0.8`
1.4.2 / 2015-11-02
=================
* [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3)
1.4.1 / 2015-10-31
=================
* [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2)
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`
* [Tests] on `node` `v5.0`
* [Tests] fix npm upgrades for older node versions
* package.json: use object form of "authors", add "contributors"
1.4.0 / 2015-09-26
=================
* [Deps] update `is-callable`
* [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config`
* [Tests] on `node` `v4.2`
* [New] Add `SameValueNonNumber` to ES7
1.3.2 / 2015-09-26
=================
* [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec.
* [Tests] up to `io.js` `v3.3`, `node` `v4.1`
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`
1.3.1 / 2015-08-15
=================
* [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly
1.3.0 / 2015-08-15
=================
* [New] ES6s ToNumber now supports binary and octal literals.
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
* [Tests] up to `io.js` `v3.0`
1.2.2 / 2015-07-28
=================
* [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw.
* [Tests] Test on latest `io.js` versions.
* [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp`
1.2.1 / 2015-03-20
=================
* Fix `isFinite` helper.
1.2.0 / 2015-03-19
=================
* Use `es-to-primitive` for ToPrimitive methods.
* Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions.
1.1.2 / 2015-03-20
=================
* Fix isFinite helper.
1.1.1 / 2015-03-19
=================
* Fix isPrimitive check for functions
* Update `eslint`, `editorconfig-tools`, `semver`, `nsp`
1.1.0 / 2015-02-17
=================
* Add ES7 export (non-default).
* All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
* Test on `iojs-v1.2`.
1.0.1 / 2015-01-30
=================
* Use `is-callable` instead of an internal function.
* Update `tape`, `jscs`, `nsp`, `eslint`
1.0.0 / 2015-01-10
=================
* v1.0.0

21
node_modules/es-abstract/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2015 Jordan Harband
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.

61
node_modules/es-abstract/Makefile generated vendored Normal file
View File

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

44
node_modules/es-abstract/README.md generated vendored Normal file
View File

@@ -0,0 +1,44 @@
# es-abstract <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-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]
[![browser support][testling-svg]][testling-url]
ECMAScript spec abstract operations.
When different versions of the spec conflict, the default export will be the latest version of the abstract operation.
All abstract operations will also be available under an `es5`/`es2015`/`es2016` entry point, and exported property, if you require a specific version.
## Example
```js
var ES = require('es-abstract');
var assert = require('assert');
assert(ES.isCallable(function () {}));
assert(!ES.isCallable(/a/g));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/es-abstract
[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg
[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg
[travis-url]: https://travis-ci.org/ljharb/es-abstract
[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg
[deps-url]: https://david-dm.org/ljharb/es-abstract
[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies
[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png
[testling-url]: https://ci.testling.com/ljharb/es-abstract
[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/es-abstract.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/es-abstract.svg
[downloads-url]: http://npm-stat.com/charts.html?package=es-abstract

655
node_modules/es-abstract/es2015.js generated vendored Normal file
View File

@@ -0,0 +1,655 @@
'use strict';
var has = require('has');
var toPrimitive = require('es-to-primitive/es6');
var toStr = Object.prototype.toString;
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var SymbolIterator = hasSymbols ? Symbol.iterator : null;
var $isNaN = require('./helpers/isNaN');
var $isFinite = require('./helpers/isFinite');
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
var assign = require('./helpers/assign');
var sign = require('./helpers/sign');
var mod = require('./helpers/mod');
var isPrimitive = require('./helpers/isPrimitive');
var parseInteger = parseInt;
var bind = require('function-bind');
var arraySlice = bind.call(Function.call, Array.prototype.slice);
var strSlice = bind.call(Function.call, String.prototype.slice);
var isBinary = bind.call(Function.call, RegExp.prototype.test, /^0b[01]+$/i);
var isOctal = bind.call(Function.call, RegExp.prototype.test, /^0o[0-7]+$/i);
var regexExec = bind.call(Function.call, RegExp.prototype.exec);
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
var nonWSregex = new RegExp('[' + nonWS + ']', 'g');
var hasNonWS = bind.call(Function.call, RegExp.prototype.test, nonWSregex);
var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i;
var isInvalidHexLiteral = bind.call(Function.call, RegExp.prototype.test, invalidHexLiteral);
// whitespace from: http://es5.github.io/#x15.5.4.20
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
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'
].join('');
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
var replace = bind.call(Function.call, String.prototype.replace);
var trim = function (value) {
return replace(value, trimRegex, '');
};
var ES5 = require('./es5');
var hasRegExpMatcher = require('is-regex');
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations
var ES6 = assign(assign({}, ES5), {
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args
Call: function Call(F, V) {
var args = arguments.length > 2 ? arguments[2] : [];
if (!this.IsCallable(F)) {
throw new TypeError(F + ' is not a function');
}
return F.apply(V, args);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive
ToPrimitive: toPrimitive,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean
// ToBoolean: ES5.ToBoolean,
// http://www.ecma-international.org/ecma-262/6.0/#sec-tonumber
ToNumber: function ToNumber(argument) {
var value = isPrimitive(argument) ? argument : toPrimitive(argument, Number);
if (typeof value === 'symbol') {
throw new TypeError('Cannot convert a Symbol value to a number');
}
if (typeof value === 'string') {
if (isBinary(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 2));
} else if (isOctal(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 8));
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
return NaN;
} else {
var trimmed = trim(value);
if (trimmed !== value) {
return this.ToNumber(trimmed);
}
}
}
return Number(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger
// ToInteger: ES5.ToNumber,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32
// ToInt32: ES5.ToInt32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32
// ToUint32: ES5.ToUint32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16
ToInt16: function ToInt16(argument) {
var int16bit = this.ToUint16(argument);
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16
// ToUint16: ES5.ToUint16,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8
ToInt8: function ToInt8(argument) {
var int8bit = this.ToUint8(argument);
return int8bit >= 0x80 ? int8bit - 0x100 : int8bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8
ToUint8: function ToUint8(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
var posInt = sign(number) * Math.floor(Math.abs(number));
return mod(posInt, 0x100);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp
ToUint8Clamp: function ToUint8Clamp(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number <= 0) { return 0; }
if (number >= 0xFF) { return 0xFF; }
var f = Math.floor(argument);
if (f + 0.5 < number) { return f + 1; }
if (number < f + 0.5) { return f; }
if (f % 2 !== 0) { return f + 1; }
return f;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
ToString: function ToString(argument) {
if (typeof argument === 'symbol') {
throw new TypeError('Cannot convert a Symbol value to a string');
}
return String(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject
ToObject: function ToObject(value) {
this.RequireObjectCoercible(value);
return Object(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey
ToPropertyKey: function ToPropertyKey(argument) {
var key = this.ToPrimitive(argument, String);
return typeof key === 'symbol' ? key : this.ToString(key);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
ToLength: function ToLength(argument) {
var len = this.ToInteger(argument);
if (len <= 0) { return 0; } // includes converting -0 to +0
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
return len;
},
// http://www.ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) {
if (toStr.call(argument) !== '[object String]') {
throw new TypeError('must be a string');
}
if (argument === '-0') { return -0; }
var n = this.ToNumber(argument);
if (this.SameValue(this.ToString(n), argument)) { return n; }
return void 0;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible
RequireObjectCoercible: ES5.CheckObjectCoercible,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray
IsArray: Array.isArray || function IsArray(argument) {
return toStr.call(argument) === '[object Array]';
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable
// IsCallable: ES5.IsCallable,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor
IsConstructor: function IsConstructor(argument) {
return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument`
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o
IsExtensible: function IsExtensible(obj) {
if (!Object.preventExtensions) { return true; }
if (isPrimitive(obj)) {
return false;
}
return Object.isExtensible(obj);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger
IsInteger: function IsInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var abs = Math.abs(argument);
return Math.floor(abs) === abs;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey
IsPropertyKey: function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
},
// http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp
IsRegExp: function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {
return false;
}
if (hasSymbols) {
var isRegExp = argument[Symbol.match];
if (typeof isRegExp !== 'undefined') {
return ES5.ToBoolean(isRegExp);
}
}
return hasRegExpMatcher(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue
// SameValue: ES5.SameValue,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero
SameValueZero: function SameValueZero(x, y) {
return (x === y) || ($isNaN(x) && $isNaN(y));
},
/**
* 7.3.2 GetV (V, P)
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let O be ToObject(V).
* 3. ReturnIfAbrupt(O).
* 4. Return O.[[Get]](P, V).
*/
GetV: function GetV(V, P) {
// 7.3.2.1
if (!this.IsPropertyKey(P)) {
throw new TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.2.2-3
var O = this.ToObject(V);
// 7.3.2.4
return O[P];
},
/**
* 7.3.9 - http://www.ecma-international.org/ecma-262/6.0/#sec-getmethod
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let func be GetV(O, P).
* 3. ReturnIfAbrupt(func).
* 4. If func is either undefined or null, return undefined.
* 5. If IsCallable(func) is false, throw a TypeError exception.
* 6. Return func.
*/
GetMethod: function GetMethod(O, P) {
// 7.3.9.1
if (!this.IsPropertyKey(P)) {
throw new TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.9.2
var func = this.GetV(O, P);
// 7.3.9.4
if (func == null) {
return void 0;
}
// 7.3.9.5
if (!this.IsCallable(func)) {
throw new TypeError(P + 'is not a function');
}
// 7.3.9.6
return func;
},
/**
* 7.3.1 Get (O, P) - http://www.ecma-international.org/ecma-262/6.0/#sec-get-o-p
* 1. Assert: Type(O) is Object.
* 2. Assert: IsPropertyKey(P) is true.
* 3. Return O.[[Get]](P, O).
*/
Get: function Get(O, P) {
// 7.3.1.1
if (this.Type(O) !== 'Object') {
throw new TypeError('Assertion failed: Type(O) is not Object');
}
// 7.3.1.2
if (!this.IsPropertyKey(P)) {
throw new TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.1.3
return O[P];
},
Type: function Type(x) {
if (typeof x === 'symbol') {
return 'Symbol';
}
return ES5.Type(x);
},
// http://www.ecma-international.org/ecma-262/6.0/#sec-speciesconstructor
SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) {
if (this.Type(O) !== 'Object') {
throw new TypeError('Assertion failed: Type(O) is not Object');
}
var C = O.constructor;
if (typeof C === 'undefined') {
return defaultConstructor;
}
if (this.Type(C) !== 'Object') {
throw new TypeError('O.constructor is not an Object');
}
var S = hasSymbols && Symbol.species ? C[Symbol.species] : void 0;
if (S == null) {
return defaultConstructor;
}
if (this.IsConstructor(S)) {
return S;
}
throw new TypeError('no constructor found');
},
// http://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor
CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) {
if (!this.IsPropertyDescriptor(Desc)) {
throw new TypeError('Desc must be a Property Descriptor');
}
if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) {
if (!has(Desc, '[[Value]]')) {
Desc['[[Value]]'] = void 0;
}
if (!has(Desc, '[[Writable]]')) {
Desc['[[Writable]]'] = false;
}
} else {
if (!has(Desc, '[[Get]]')) {
Desc['[[Get]]'] = void 0;
}
if (!has(Desc, '[[Set]]')) {
Desc['[[Set]]'] = void 0;
}
}
if (!has(Desc, '[[Enumerable]]')) {
Desc['[[Enumerable]]'] = false;
}
if (!has(Desc, '[[Configurable]]')) {
Desc['[[Configurable]]'] = false;
}
return Desc;
},
// http://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
Set: function Set(O, P, V, Throw) {
if (this.Type(O) !== 'Object') {
throw new TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new TypeError('P must be a Property Key');
}
if (this.Type(Throw) !== 'Boolean') {
throw new TypeError('Throw must be a Boolean');
}
if (Throw) {
O[P] = V;
return true;
} else {
try {
O[P] = V;
} catch (e) {
return false;
}
}
},
// http://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
HasOwnProperty: function HasOwnProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new TypeError('P must be a Property Key');
}
return has(O, P);
},
// http://ecma-international.org/ecma-262/6.0/#sec-hasproperty
HasProperty: function HasProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new TypeError('P must be a Property Key');
}
return P in O;
},
// http://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
IsConcatSpreadable: function IsConcatSpreadable(O) {
if (this.Type(O) !== 'Object') {
return false;
}
if (hasSymbols && typeof Symbol.isConcatSpreadable === 'symbol') {
var spreadable = this.Get(O, Symbol.isConcatSpreadable);
if (typeof spreadable !== 'undefined') {
return this.ToBoolean(spreadable);
}
}
return this.IsArray(O);
},
// http://ecma-international.org/ecma-262/6.0/#sec-invoke
Invoke: function Invoke(O, P) {
if (!this.IsPropertyKey(P)) {
throw new TypeError('P must be a Property Key');
}
var argumentsList = arraySlice(arguments, 2);
var func = this.GetV(O, P);
return this.Call(func, O, argumentsList);
},
// http://ecma-international.org/ecma-262/6.0/#sec-getiterator
GetIterator: function GetIterator(obj, method) {
if (!hasSymbols) {
throw new SyntaxError('ES.GetIterator depends on native iterator support.');
}
var actualMethod = method;
if (arguments.length < 2) {
actualMethod = this.GetMethod(obj, SymbolIterator);
}
var iterator = this.Call(actualMethod, obj);
if (this.Type(iterator) !== 'Object') {
throw new TypeError('iterator must return an object');
}
return iterator;
},
// http://ecma-international.org/ecma-262/6.0/#sec-iteratornext
IteratorNext: function IteratorNext(iterator, value) {
var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
if (this.Type(result) !== 'Object') {
throw new TypeError('iterator next must return an object');
}
return result;
},
// http://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
IteratorComplete: function IteratorComplete(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.ToBoolean(this.Get(iterResult, 'done'));
},
// http://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
IteratorValue: function IteratorValue(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.Get(iterResult, 'value');
},
// http://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
IteratorStep: function IteratorStep(iterator) {
var result = this.IteratorNext(iterator);
var done = this.IteratorComplete(result);
return done === true ? false : result;
},
// http://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
IteratorClose: function IteratorClose(iterator, completion) {
if (this.Type(iterator) !== 'Object') {
throw new TypeError('Assertion failed: Type(iterator) is not Object');
}
if (!this.IsCallable(completion)) {
throw new TypeError('Assertion failed: completion is not a thunk for a Completion Record');
}
var completionThunk = completion;
var iteratorReturn = this.GetMethod(iterator, 'return');
if (typeof iteratorReturn === 'undefined') {
return completionThunk();
}
var completionRecord;
try {
var innerResult = this.Call(iteratorReturn, iterator, []);
} catch (e) {
// if we hit here, then "e" is the innerResult completion that needs re-throwing
// if the completion is of type "throw", this will throw.
completionRecord = completionThunk();
completionThunk = null; // ensure it's not called twice.
// if not, then return the innerResult completion
throw e;
}
completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does
completionThunk = null; // ensure it's not called twice.
if (this.Type(innerResult) !== 'Object') {
throw new TypeError('iterator .return must return an object');
}
return completionRecord;
},
// http://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
CreateIterResultObject: function CreateIterResultObject(value, done) {
if (this.Type(done) !== 'Boolean') {
throw new TypeError('Assertion failed: Type(done) is not Boolean');
}
return {
value: value,
done: done
};
},
// http://ecma-international.org/ecma-262/6.0/#sec-regexpexec
RegExpExec: function RegExpExec(R, S) {
if (this.Type(R) !== 'Object') {
throw new TypeError('R must be an Object');
}
if (this.Type(S) !== 'String') {
throw new TypeError('S must be a String');
}
var exec = this.Get(R, 'exec');
if (this.IsCallable(exec)) {
var result = this.Call(exec, R, [S]);
if (result === null || this.Type(result) === 'Object') {
return result;
}
throw new TypeError('"exec" method must return `null` or an Object');
}
return regexExec(R, S);
},
// http://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) {
if (!this.IsInteger(length) || length < 0) {
throw new TypeError('Assertion failed: length must be an integer >= 0');
}
var len = length === 0 ? 0 : length;
var C;
var isArray = this.IsArray(originalArray);
if (isArray) {
C = this.Get(originalArray, 'constructor');
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
// if (this.IsConstructor(C)) {
// if C is another realm's Array, C = undefined
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
// }
if (this.Type(C) === 'Object' && hasSymbols && Symbol.species) {
C = this.Get(C, Symbol.species);
if (C === null) {
C = void 0;
}
}
}
if (typeof C === 'undefined') {
return Array(len);
}
if (!this.IsConstructor(C)) {
throw new TypeError('C must be a constructor');
}
return new C(len); // this.Construct(C, len);
},
CreateDataProperty: function CreateDataProperty(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var oldDesc = Object.getOwnPropertyDescriptor(O, P);
var extensible = oldDesc || (typeof Object.isExtensible !== 'function' || Object.isExtensible(O));
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
if (immutable || !extensible) {
return false;
}
var newDesc = {
configurable: true,
enumerable: true,
value: V,
writable: true
};
Object.defineProperty(O, P, newDesc);
return true;
},
// http://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = this.CreateDataProperty(O, P, V);
if (!success) {
throw new TypeError('unable to create data property');
}
return success;
},
// http://ecma-international.org/ecma-262/6.0/#sec-advancestringindex
AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) {
if (this.Type(S) !== 'String') {
throw new TypeError('Assertion failed: Type(S) is not String');
}
if (!this.IsInteger(index)) {
throw new TypeError('Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)');
}
if (index < 0 || index > MAX_SAFE_INTEGER) {
throw new RangeError('Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)');
}
if (this.Type(unicode) !== 'Boolean') {
throw new TypeError('Assertion failed: Type(unicode) is not Boolean');
}
if (!unicode) {
return index + 1;
}
var length = S.length;
if ((index + 1) >= length) {
return index + 1;
}
var first = S.charCodeAt(index);
if (first < 0xD800 || first > 0xDBFF) {
return index + 1;
}
var second = S.charCodeAt(index + 1);
if (second < 0xDC00 || second > 0xDFFF) {
return index + 1;
}
return index + 2;
}
});
delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible
module.exports = ES6;

16
node_modules/es-abstract/es2016.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
'use strict';
var ES2015 = require('./es2015');
var assign = require('./helpers/assign');
var ES2016 = assign(assign({}, ES2015), {
// https://github.com/tc39/ecma262/pull/60
SameValueNonNumber: function SameValueNonNumber(x, y) {
if (typeof x === 'number' || typeof x !== typeof y) {
throw new TypeError('SameValueNonNumber requires two non-number values of the same type.');
}
return this.SameValue(x, y);
}
});
module.exports = ES2016;

25
node_modules/es-abstract/es2017.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict';
var ES2016 = require('./es2016');
var assign = require('./helpers/assign');
var ES2017 = assign(assign({}, ES2016), {
ToIndex: function ToIndex(value) {
if (typeof value === 'undefined') {
return 0;
}
var integerIndex = this.ToInteger(value);
if (integerIndex < 0) {
throw new RangeError('index must be >= 0');
}
var index = this.ToLength(integerIndex);
if (!this.SameValueZero(integerIndex, index)) {
throw new RangeError('index must be >= 0 and < 2 ** 53 - 1');
}
return index;
}
});
delete ES2017.EnumerableOwnNames; // replaced with EnumerableOwnProperties
module.exports = ES2017;

236
node_modules/es-abstract/es5.js generated vendored Normal file
View File

@@ -0,0 +1,236 @@
'use strict';
var $isNaN = require('./helpers/isNaN');
var $isFinite = require('./helpers/isFinite');
var sign = require('./helpers/sign');
var mod = require('./helpers/mod');
var IsCallable = require('is-callable');
var toPrimitive = require('es-to-primitive/es5');
var has = require('has');
// https://es5.github.io/#x9
var ES5 = {
ToPrimitive: toPrimitive,
ToBoolean: function ToBoolean(value) {
return !!value;
},
ToNumber: function ToNumber(value) {
return Number(value);
},
ToInteger: function ToInteger(value) {
var number = this.ToNumber(value);
if ($isNaN(number)) { return 0; }
if (number === 0 || !$isFinite(number)) { return number; }
return sign(number) * Math.floor(Math.abs(number));
},
ToInt32: function ToInt32(x) {
return this.ToNumber(x) >> 0;
},
ToUint32: function ToUint32(x) {
return this.ToNumber(x) >>> 0;
},
ToUint16: function ToUint16(value) {
var number = this.ToNumber(value);
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
var posInt = sign(number) * Math.floor(Math.abs(number));
return mod(posInt, 0x10000);
},
ToString: function ToString(value) {
return String(value);
},
ToObject: function ToObject(value) {
this.CheckObjectCoercible(value);
return Object(value);
},
CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {
/* jshint eqnull:true */
if (value == null) {
throw new TypeError(optMessage || 'Cannot call method on ' + value);
}
return value;
},
IsCallable: IsCallable,
SameValue: function SameValue(x, y) {
if (x === y) { // 0 === -0, but they are not identical.
if (x === 0) { return 1 / x === 1 / y; }
return true;
}
return $isNaN(x) && $isNaN(y);
},
// http://www.ecma-international.org/ecma-262/5.1/#sec-8
Type: function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
},
// http://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
IsPropertyDescriptor: function IsPropertyDescriptor(Desc) {
if (this.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
// jscs:disable
for (var key in Desc) { // eslint-disable-line
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
// jscs:enable
var isData = has(Desc, '[[Value]]');
var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
if (isData && IsAccessor) {
throw new TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
},
// http://ecma-international.org/ecma-262/5.1/#sec-8.10.1
IsAccessorDescriptor: function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
if (!this.IsPropertyDescriptor(Desc)) {
throw new TypeError('Desc must be a Property Descriptor');
}
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
return false;
}
return true;
},
// http://ecma-international.org/ecma-262/5.1/#sec-8.10.2
IsDataDescriptor: function IsDataDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
if (!this.IsPropertyDescriptor(Desc)) {
throw new TypeError('Desc must be a Property Descriptor');
}
if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
return false;
}
return true;
},
// http://ecma-international.org/ecma-262/5.1/#sec-8.10.3
IsGenericDescriptor: function IsGenericDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
if (!this.IsPropertyDescriptor(Desc)) {
throw new TypeError('Desc must be a Property Descriptor');
}
if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {
return true;
}
return false;
},
// http://ecma-international.org/ecma-262/5.1/#sec-8.10.4
FromPropertyDescriptor: function FromPropertyDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return Desc;
}
if (!this.IsPropertyDescriptor(Desc)) {
throw new TypeError('Desc must be a Property Descriptor');
}
if (this.IsDataDescriptor(Desc)) {
return {
value: Desc['[[Value]]'],
writable: !!Desc['[[Writable]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else if (this.IsAccessorDescriptor(Desc)) {
return {
get: Desc['[[Get]]'],
set: Desc['[[Set]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else {
throw new TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');
}
},
// http://ecma-international.org/ecma-262/5.1/#sec-8.10.5
ToPropertyDescriptor: function ToPropertyDescriptor(Obj) {
if (this.Type(Obj) !== 'Object') {
throw new TypeError('ToPropertyDescriptor requires an object');
}
var desc = {};
if (has(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);
}
if (has(Obj, 'configurable')) {
desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);
}
if (has(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
if (has(Obj, 'writable')) {
desc['[[Writable]]'] = this.ToBoolean(Obj.writable);
}
if (has(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !this.IsCallable(getter)) {
throw new TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
if (has(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !this.IsCallable(setter)) {
throw new TypeError('setter must be a function');
}
desc['[[Set]]'] = setter;
}
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
throw new TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;
}
};
module.exports = ES5;

3
node_modules/es-abstract/es6.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./es2015');

3
node_modules/es-abstract/es7.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./es2016');

12
node_modules/es-abstract/helpers/assign.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
var has = Object.prototype.hasOwnProperty;
module.exports = function assign(target, source) {
if (Object.assign) {
return Object.assign(target, source);
}
for (var key in source) {
if (has.call(source, key)) {
target[key] = source[key];
}
}
return target;
};

3
node_modules/es-abstract/helpers/isFinite.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
var $isNaN = Number.isNaN || function (a) { return a !== a; };
module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };

3
node_modules/es-abstract/helpers/isNaN.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};

3
node_modules/es-abstract/helpers/isPrimitive.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
module.exports = function isPrimitive(value) {
return value === null || (typeof value !== 'function' && typeof value !== 'object');
};

4
node_modules/es-abstract/helpers/mod.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return Math.floor(remain >= 0 ? remain : remain + modulo);
};

3
node_modules/es-abstract/helpers/sign.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
module.exports = function sign(number) {
return number >= 0 ? 1 : -1;
};

22
node_modules/es-abstract/index.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
var assign = require('./helpers/assign');
var ES5 = require('./es5');
var ES2015 = require('./es2015');
var ES2016 = require('./es2016');
var ES2017 = require('./es2017');
var ES = {
ES5: ES5,
ES6: ES2015,
ES2015: ES2015,
ES7: ES2016,
ES2016: ES2016,
ES2017: ES2017
};
assign(ES, ES5);
delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible
assign(ES, ES2015);
module.exports = ES;

76
node_modules/es-abstract/operations/2015.js generated vendored Normal file
View File

@@ -0,0 +1,76 @@
'use strict';
module.exports = {
IsPropertyDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type',
IsAccessorDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor',
IsDataDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor',
IsGenericDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor',
FromPropertyDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor',
ToPropertyDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor',
CompletePropertyDescriptor: 'http://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor',
ToPrimitive: 'http://ecma-international.org/ecma-262/6.0/#sec-toprimitive',
ToBoolean: 'http://ecma-international.org/ecma-262/6.0/#sec-toboolean',
ToNumber: 'http://ecma-international.org/ecma-262/6.0/#sec-tonumber',
ToInteger: 'http://ecma-international.org/ecma-262/6.0/#sec-tointeger',
ToInt32: 'http://ecma-international.org/ecma-262/6.0/#sec-toint32',
ToUint32: 'http://ecma-international.org/ecma-262/6.0/#sec-touint32',
ToInt16: 'http://ecma-international.org/ecma-262/6.0/#sec-toint16',
ToUint16: 'http://ecma-international.org/ecma-262/6.0/#sec-touint16',
ToInt8: 'http://ecma-international.org/ecma-262/6.0/#sec-toint8',
ToUint8: 'http://ecma-international.org/ecma-262/6.0/#sec-touint8',
ToUint8Clamp: 'http://ecma-international.org/ecma-262/6.0/#sec-touint8clamp',
ToString: 'http://ecma-international.org/ecma-262/6.0/#sec-tostring',
ToObject: 'http://ecma-international.org/ecma-262/6.0/#sec-toobject',
ToPropertyKey: 'http://ecma-international.org/ecma-262/6.0/#sec-topropertykey',
ToLength: 'http://ecma-international.org/ecma-262/6.0/#sec-tolength',
CanonicalNumericIndexString: 'http://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring',
RequireObjectCoercible: 'http://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible',
IsArray: 'http://ecma-international.org/ecma-262/6.0/#sec-isarray',
IsCallable: 'http://ecma-international.org/ecma-262/6.0/#sec-iscallable',
IsConstructor: 'http://ecma-international.org/ecma-262/6.0/#sec-isconstructor',
IsExtensible: 'http://ecma-international.org/ecma-262/6.0/#sec-isextensible-o',
IsInteger: 'http://ecma-international.org/ecma-262/6.0/#sec-isinteger',
IsPropertyKey: 'http://ecma-international.org/ecma-262/6.0/#sec-ispropertykey',
IsRegExp: 'http://ecma-international.org/ecma-262/6.0/#sec-isregexp',
SameValue: 'http://ecma-international.org/ecma-262/6.0/#sec-samevalue',
SameValueZero: 'http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero',
Get: 'http://ecma-international.org/ecma-262/6.0/#sec-get-o-p',
GetV: 'http://ecma-international.org/ecma-262/6.0/#sec-getv',
Set: 'http://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw',
CreateDataProperty: 'http://ecma-international.org/ecma-262/6.0/#sec-createdataproperty',
CreateMethodProperty: 'http://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty',
CreateDataPropertyOrThrow: 'http://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow',
DefinePropertyOrThrow: 'http://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow',
DeletePropertyOrThrow: 'http://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow',
GetMethod: 'http://ecma-international.org/ecma-262/6.0/#sec-getmethod',
HasProperty: 'http://ecma-international.org/ecma-262/6.0/#sec-hasproperty',
HasOwnProperty: 'http://ecma-international.org/ecma-262/6.0/#sec-hasownproperty',
Call: 'http://ecma-international.org/ecma-262/6.0/#sec-call',
Construct: 'http://ecma-international.org/ecma-262/6.0/#sec-construct',
SetIntegrityLevel: 'http://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel',
TestIntegrityLevel: 'http://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel',
CreateArrayFromList: 'http://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist',
CreateListFromArrayLike: 'http://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike',
Invoke: 'http://ecma-international.org/ecma-262/6.0/#sec-invoke',
OrdinaryHasInstance: 'http://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance',
SpeciesConstructor: 'http://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor',
EnumerableOwnNames: 'http://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames',
GetIterator: 'http://ecma-international.org/ecma-262/6.0/#sec-getiterator',
IteratorNext: 'http://ecma-international.org/ecma-262/6.0/#sec-iteratornext',
IteratorComplete: 'http://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete',
IteratorValue: 'http://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue',
IteratorStep: 'http://ecma-international.org/ecma-262/6.0/#sec-iteratorstep',
IteratorClose: 'http://ecma-international.org/ecma-262/6.0/#sec-iteratorclose',
CreateIterResultObject: 'http://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject',
CreateListIterator: 'http://ecma-international.org/ecma-262/6.0/#sec-createlistiterator',
Type: 'http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types',
thisNumberValue: 'http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object',
thisTimeValue: 'http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object',
thisStringValue: 'http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object',
RegExpExec: 'http://ecma-international.org/ecma-262/6.0/#sec-regexpexec',
RegExpBuiltinExec: 'http://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec',
IsConcatSpreadable: 'http://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable',
IsPromise: 'http://ecma-international.org/ecma-262/6.0/#sec-ispromise',
ArraySpeciesCreate: 'http://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate',
AdvanceStringIndex: 'http://ecma-international.org/ecma-262/6.0/#sec-advancestringindex'
};

77
node_modules/es-abstract/operations/2016.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
'use strict';
module.exports = {
IsPropertyDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-property-descriptor-specification-type',
IsAccessorDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor',
IsDataDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor',
IsGenericDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor',
FromPropertyDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor',
ToPropertyDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor',
CompletePropertyDescriptor: 'http://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor',
ToPrimitive: 'http://ecma-international.org/ecma-262/7.0/#sec-toprimitive',
ToBoolean: 'http://ecma-international.org/ecma-262/7.0/#sec-toboolean',
ToNumber: 'http://ecma-international.org/ecma-262/7.0/#sec-tonumber',
ToInteger: 'http://ecma-international.org/ecma-262/7.0/#sec-tointeger',
ToInt32: 'http://ecma-international.org/ecma-262/7.0/#sec-toint32',
ToUint32: 'http://ecma-international.org/ecma-262/7.0/#sec-touint32',
ToInt16: 'http://ecma-international.org/ecma-262/7.0/#sec-toint16',
ToUint16: 'http://ecma-international.org/ecma-262/7.0/#sec-touint16',
ToInt8: 'http://ecma-international.org/ecma-262/7.0/#sec-toint8',
ToUint8: 'http://ecma-international.org/ecma-262/7.0/#sec-touint8',
ToUint8Clamp: 'http://ecma-international.org/ecma-262/7.0/#sec-touint8clamp',
ToString: 'http://ecma-international.org/ecma-262/7.0/#sec-tostring',
ToObject: 'http://ecma-international.org/ecma-262/7.0/#sec-toobject',
ToPropertyKey: 'http://ecma-international.org/ecma-262/7.0/#sec-topropertykey',
ToLength: 'http://ecma-international.org/ecma-262/7.0/#sec-tolength',
CanonicalNumericIndexString: 'http://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring',
RequireObjectCoercible: 'http://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible',
IsArray: 'http://ecma-international.org/ecma-262/7.0/#sec-isarray',
IsCallable: 'http://ecma-international.org/ecma-262/7.0/#sec-iscallable',
IsConstructor: 'http://ecma-international.org/ecma-262/7.0/#sec-isconstructor',
IsExtensible: 'http://ecma-international.org/ecma-262/7.0/#sec-isextensible-o',
IsInteger: 'http://ecma-international.org/ecma-262/7.0/#sec-isinteger',
IsPropertyKey: 'http://ecma-international.org/ecma-262/7.0/#sec-ispropertykey',
IsRegExp: 'http://ecma-international.org/ecma-262/7.0/#sec-isregexp',
SameValue: 'http://ecma-international.org/ecma-262/7.0/#sec-samevalue',
SameValueZero: 'http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero',
SameValueNonNumber: 'http://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber',
Get: 'http://ecma-international.org/ecma-262/7.0/#sec-get-o-p',
GetV: 'http://ecma-international.org/ecma-262/7.0/#sec-getv',
Set: 'http://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw',
CreateDataProperty: 'http://ecma-international.org/ecma-262/7.0/#sec-createdataproperty',
CreateMethodProperty: 'http://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty',
CreateDataPropertyOrThrow: 'http://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow',
DefinePropertyOrThrow: 'http://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow',
DeletePropertyOrThrow: 'http://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow',
GetMethod: 'http://ecma-international.org/ecma-262/7.0/#sec-getmethod',
HasProperty: 'http://ecma-international.org/ecma-262/7.0/#sec-hasproperty',
HasOwnProperty: 'http://ecma-international.org/ecma-262/7.0/#sec-hasownproperty',
Call: 'http://ecma-international.org/ecma-262/7.0/#sec-call',
Construct: 'http://ecma-international.org/ecma-262/7.0/#sec-construct',
SetIntegrityLevel: 'http://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel',
TestIntegrityLevel: 'http://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel',
CreateArrayFromList: 'http://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist',
CreateListFromArrayLike: 'http://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike',
Invoke: 'http://ecma-international.org/ecma-262/7.0/#sec-invoke',
OrdinaryHasInstance: 'http://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance',
SpeciesConstructor: 'http://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor',
EnumerableOwnNames: 'http://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames',
GetIterator: 'http://ecma-international.org/ecma-262/7.0/#sec-getiterator',
IteratorNext: 'http://ecma-international.org/ecma-262/7.0/#sec-iteratornext',
IteratorComplete: 'http://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete',
IteratorValue: 'http://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue',
IteratorStep: 'http://ecma-international.org/ecma-262/7.0/#sec-iteratorstep',
IteratorClose: 'http://ecma-international.org/ecma-262/7.0/#sec-iteratorclose',
CreateIterResultObject: 'http://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject',
CreateListIterator: 'http://ecma-international.org/ecma-262/7.0/#sec-createlistiterator',
Type: 'http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types',
thisNumberValue: 'http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object',
thisTimeValue: 'http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object',
thisStringValue: 'http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object',
RegExpExec: 'http://ecma-international.org/ecma-262/7.0/#sec-regexpexec',
RegExpBuiltinExec: 'http://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec',
IsConcatSpreadable: 'http://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable',
IsPromise: 'http://ecma-international.org/ecma-262/7.0/#sec-ispromise',
ArraySpeciesCreate: 'http://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate',
AdvanceStringIndex: 'http://ecma-international.org/ecma-262/6.0/#sec-advancestringindex'
};

78
node_modules/es-abstract/operations/2017.js generated vendored Normal file
View File

@@ -0,0 +1,78 @@
'use strict';
module.exports = {
IsPropertyDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-property-descriptor-specification-type',
IsAccessorDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor',
IsDataDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor',
IsGenericDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor',
FromPropertyDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor',
ToPropertyDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor',
CompletePropertyDescriptor: 'http://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor',
ToPrimitive: 'http://ecma-international.org/ecma-262/8.0/#sec-toprimitive',
ToBoolean: 'http://ecma-international.org/ecma-262/8.0/#sec-toboolean',
ToNumber: 'http://ecma-international.org/ecma-262/8.0/#sec-tonumber',
ToInteger: 'http://ecma-international.org/ecma-262/8.0/#sec-tointeger',
ToInt32: 'http://ecma-international.org/ecma-262/8.0/#sec-toint32',
ToUint32: 'http://ecma-international.org/ecma-262/8.0/#sec-touint32',
ToInt16: 'http://ecma-international.org/ecma-262/8.0/#sec-toint16',
ToUint16: 'http://ecma-international.org/ecma-262/8.0/#sec-touint16',
ToInt8: 'http://ecma-international.org/ecma-262/8.0/#sec-toint8',
ToUint8: 'http://ecma-international.org/ecma-262/8.0/#sec-touint8',
ToUint8Clamp: 'http://ecma-international.org/ecma-262/8.0/#sec-touint8clamp',
ToString: 'http://ecma-international.org/ecma-262/8.0/#sec-tostring',
ToObject: 'http://ecma-international.org/ecma-262/8.0/#sec-toobject',
ToPropertyKey: 'http://ecma-international.org/ecma-262/8.0/#sec-topropertykey',
ToLength: 'http://ecma-international.org/ecma-262/8.0/#sec-tolength',
CanonicalNumericIndexString: 'http://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring',
ToIndex: 'http://ecma-international.org/ecma-262/8.0/#sec-toindex',
RequireObjectCoercible: 'http://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible',
IsArray: 'http://ecma-international.org/ecma-262/8.0/#sec-isarray',
IsCallable: 'http://ecma-international.org/ecma-262/8.0/#sec-iscallable',
IsConstructor: 'http://ecma-international.org/ecma-262/8.0/#sec-isconstructor',
IsExtensible: 'http://ecma-international.org/ecma-262/8.0/#sec-isextensible-o',
IsInteger: 'http://ecma-international.org/ecma-262/8.0/#sec-isinteger',
IsPropertyKey: 'http://ecma-international.org/ecma-262/8.0/#sec-ispropertykey',
IsRegExp: 'http://ecma-international.org/ecma-262/8.0/#sec-isregexp',
SameValue: 'http://ecma-international.org/ecma-262/8.0/#sec-samevalue',
SameValueZero: 'http://ecma-international.org/ecma-262/8.0/#sec-samevaluezero',
SameValueNonNumber: 'http://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber',
Get: 'http://ecma-international.org/ecma-262/8.0/#sec-get-o-p',
GetV: 'http://ecma-international.org/ecma-262/8.0/#sec-getv',
Set: 'http://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw',
CreateDataProperty: 'http://ecma-international.org/ecma-262/8.0/#sec-createdataproperty',
CreateMethodProperty: 'http://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty',
CreateDataPropertyOrThrow: 'http://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow',
DefinePropertyOrThrow: 'http://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow',
DeletePropertyOrThrow: 'http://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow',
GetMethod: 'http://ecma-international.org/ecma-262/8.0/#sec-getmethod',
HasProperty: 'http://ecma-international.org/ecma-262/8.0/#sec-hasproperty',
HasOwnProperty: 'http://ecma-international.org/ecma-262/8.0/#sec-hasownproperty',
Call: 'http://ecma-international.org/ecma-262/8.0/#sec-call',
Construct: 'http://ecma-international.org/ecma-262/8.0/#sec-construct',
SetIntegrityLevel: 'http://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel',
TestIntegrityLevel: 'http://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel',
CreateArrayFromList: 'http://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist',
CreateListFromArrayLike: 'http://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike',
Invoke: 'http://ecma-international.org/ecma-262/8.0/#sec-invoke',
OrdinaryHasInstance: 'http://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance',
SpeciesConstructor: 'http://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor',
EnumerableOwnProperties: 'http://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties',
GetIterator: 'http://ecma-international.org/ecma-262/8.0/#sec-getiterator',
IteratorNext: 'http://ecma-international.org/ecma-262/8.0/#sec-iteratornext',
IteratorComplete: 'http://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete',
IteratorValue: 'http://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue',
IteratorStep: 'http://ecma-international.org/ecma-262/8.0/#sec-iteratorstep',
IteratorClose: 'http://ecma-international.org/ecma-262/8.0/#sec-iteratorclose',
CreateIterResultObject: 'http://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject',
CreateListIterator: 'http://ecma-international.org/ecma-262/8.0/#sec-createlistiterator',
Type: 'http://ecma-international.org/ecma-262/8.0/#sec-ecmascript-language-types',
thisNumberValue: 'http://ecma-international.org/ecma-262/8.0/#sec-properties-of-the-number-prototype-object',
thisTimeValue: 'http://ecma-international.org/ecma-262/8.0/#sec-properties-of-the-date-prototype-object',
thisStringValue: 'http://ecma-international.org/ecma-262/8.0/#sec-properties-of-the-string-prototype-object',
RegExpExec: 'http://ecma-international.org/ecma-262/8.0/#sec-regexpexec',
RegExpBuiltinExec: 'http://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec',
IsConcatSpreadable: 'http://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable',
IsPromise: 'http://ecma-international.org/ecma-262/8.0/#sec-ispromise',
ArraySpeciesCreate: 'http://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate',
AdvanceStringIndex: 'http://ecma-international.org/ecma-262/6.0/#sec-advancestringindex'
};

10
node_modules/es-abstract/operations/es5.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict';
module.exports = {
IsPropertyDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10',
IsAccessorDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10.1',
IsDataDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10.2',
IsGenericDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10.3',
FromPropertyDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10.4',
ToPropertyDescriptor: 'http://ecma-international.org/ecma-262/5.1/#sec-8.10.5'
};

120
node_modules/es-abstract/package.json generated vendored Normal file
View File

@@ -0,0 +1,120 @@
{
"_from": "es-abstract@^1.5.1",
"_id": "es-abstract@1.11.0",
"_inBundle": false,
"_integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==",
"_location": "/es-abstract",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "es-abstract@^1.5.1",
"name": "es-abstract",
"escapedName": "es-abstract",
"rawSpec": "^1.5.1",
"saveSpec": null,
"fetchSpec": "^1.5.1"
},
"_requiredBy": [
"/object.getownpropertydescriptors"
],
"_resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz",
"_shasum": "cce87d518f0496893b1a30cd8461835535480681",
"_spec": "es-abstract@^1.5.1",
"_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/object.getownpropertydescriptors",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
},
"bugs": {
"url": "https://github.com/ljharb/es-abstract/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
}
],
"dependencies": {
"es-to-primitive": "^1.1.1",
"function-bind": "^1.1.1",
"has": "^1.0.1",
"is-callable": "^1.1.3",
"is-regex": "^1.0.4"
},
"deprecated": false,
"description": "ECMAScript spec abstract operations.",
"devDependencies": {
"@ljharb/eslint-config": "^12.2.1",
"editorconfig-tools": "^0.1.1",
"eslint": "^4.19.0",
"foreach": "^2.0.5",
"jscs": "^3.0.7",
"nsp": "^3.2.1",
"nyc": "^10.3.2",
"object-is": "^1.0.1",
"object.assign": "^4.1.0",
"replace": "^0.3.0",
"safe-publish-latest": "^1.1.1",
"semver": "^5.5.0",
"tape": "^4.9.0"
},
"engines": {
"node": ">= 0.4"
},
"homepage": "https://github.com/ljharb/es-abstract#readme",
"keywords": [
"ECMAScript",
"ES",
"abstract",
"operation",
"abstract operation",
"JavaScript",
"ES5",
"ES6",
"ES7"
],
"license": "MIT",
"main": "index.js",
"name": "es-abstract",
"repository": {
"type": "git",
"url": "git://github.com/ljharb/es-abstract.git"
},
"scripts": {
"coverage": "nyc npm run --silent tests-only >/dev/null 2>&1",
"eccheck": "editorconfig-tools check *.js **/*.js > /dev/null",
"eslint": "eslint test/*.js *.js",
"jscs": "jscs test/*.js *.js",
"lint": "npm run --silent jscs && npm run --silent eslint",
"postcoverage": "nyc report",
"posttest": "npm run --silent security",
"prepublish": "safe-publish-latest",
"pretest": "npm run --silent lint",
"security": "nsp check",
"test": "npm run tests-only",
"tests-only": "node test"
},
"testling": {
"files": "test/index.js",
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/20.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": "1.11.0"
}

11
node_modules/es-abstract/test/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"rules": {
"id-length": 0,
"max-lines": 0,
"max-statements-per-line": [2, { "max": 3 }],
"max-nested-callbacks": [2, 3],
"max-statements": 0,
"no-implicit-coercion": [1],
"no-invalid-this": [1]
}
}

24
node_modules/es-abstract/test/diffOps.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
'use strict';
var keys = require('object-keys');
var forEach = require('foreach');
module.exports = function diffOperations(actual, expected) {
var actualKeys = keys(actual);
var expectedKeys = keys(expected);
var extra = [];
var missing = [];
forEach(actualKeys, function (op) {
if (!(op in expected)) {
extra.push(op);
}
});
forEach(expectedKeys, function (op) {
if (!(op in actual)) {
missing.push(op);
}
});
return { missing: missing, extra: extra };
};

11
node_modules/es-abstract/test/es2015.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
var ES = require('../').ES2015;
var ops = require('../operations/2015');
// jscs:disable
var expectedMissing = ['CreateMethodProperty', 'DefinePropertyOrThrow', 'DeletePropertyOrThrow', 'Construct', 'SetIntegrityLevel', 'TestIntegrityLevel', 'CreateArrayFromList', 'CreateListFromArrayLike', 'OrdinaryHasInstance', 'EnumerableOwnNames', 'CreateListIterator', 'thisNumberValue', 'thisTimeValue', 'thisStringValue', 'RegExpBuiltinExec', 'IsPromise'];
// jscs:enable
require('./tests').es2015(ES, ops, expectedMissing);

11
node_modules/es-abstract/test/es2016.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
var ES = require('../').ES2016;
var ops = require('../operations/2016');
// jscs:disable
var expectedMissing = ['CreateMethodProperty', 'DefinePropertyOrThrow', 'DeletePropertyOrThrow', 'Construct', 'SetIntegrityLevel', 'TestIntegrityLevel', 'CreateArrayFromList', 'CreateListFromArrayLike', 'OrdinaryHasInstance', 'EnumerableOwnNames', 'CreateListIterator', 'thisNumberValue', 'thisTimeValue', 'thisStringValue', 'RegExpBuiltinExec', 'IsPromise'];
// jscs:enable
require('./tests').es2016(ES, ops, expectedMissing);

11
node_modules/es-abstract/test/es2017.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
var ES = require('../').ES2017;
var ops = require('../operations/2017');
// jscs:disable
var expectedMissing = ['CreateMethodProperty', 'DefinePropertyOrThrow', 'DeletePropertyOrThrow', 'Construct', 'SetIntegrityLevel', 'TestIntegrityLevel', 'CreateArrayFromList', 'CreateListFromArrayLike', 'OrdinaryHasInstance', 'EnumerableOwnProperties', 'CreateListIterator', 'thisNumberValue', 'thisTimeValue', 'thisStringValue', 'RegExpBuiltinExec', 'IsPromise'];
// jscs:enable
require('./tests').es2017(ES, ops, expectedMissing);

415
node_modules/es-abstract/test/es5.js generated vendored Normal file
View File

@@ -0,0 +1,415 @@
'use strict';
var ES = require('../').ES5;
var test = require('tape');
var forEach = require('foreach');
var is = require('object-is');
var coercibleObject = { valueOf: function () { return '3'; }, toString: function () { return 42; } };
var coercibleFnObject = {
valueOf: function () { return function valueOfFn() {}; },
toString: function () { return 42; }
};
var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } };
var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } };
var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } };
var uncoercibleFnObject = {
valueOf: function () { return function valueOfFn() {}; },
toString: function () { return function toStrFn() {}; }
};
var objects = [{}, coercibleObject, toStringOnlyObject, valueOfOnlyObject];
var numbers = [0, -0, Infinity, -Infinity, 42];
var nonNullPrimitives = [true, false, 'foo', ''].concat(numbers);
var primitives = [undefined, null].concat(nonNullPrimitives);
test('ToPrimitive', function (t) {
t.test('primitives', function (st) {
var testPrimitive = function (primitive) {
st.ok(is(ES.ToPrimitive(primitive), primitive), primitive + ' is returned correctly');
};
forEach(primitives, testPrimitive);
st.end();
});
t.test('objects', function (st) {
st.equal(ES.ToPrimitive(coercibleObject), coercibleObject.valueOf(), 'coercibleObject coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, Number), coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, String), coercibleObject.toString(), 'coercibleObject with hint String coerces to toString');
st.equal(ES.ToPrimitive(coercibleFnObject), coercibleFnObject.toString(), 'coercibleFnObject coerces to toString');
st.equal(ES.ToPrimitive(toStringOnlyObject), toStringOnlyObject.toString(), 'toStringOnlyObject returns toString');
st.equal(ES.ToPrimitive(valueOfOnlyObject), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
st['throws'](function () { return ES.ToPrimitive(uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError');
st['throws'](function () { return ES.ToPrimitive(uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError');
st.end();
});
t.end();
});
test('ToBoolean', function (t) {
t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false');
t.equal(false, ES.ToBoolean(null), 'null coerces to false');
t.equal(false, ES.ToBoolean(false), 'false returns false');
t.equal(true, ES.ToBoolean(true), 'true returns true');
forEach([0, -0, NaN], function (falsyNumber) {
t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false');
});
forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) {
t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true');
});
t.equal(false, ES.ToBoolean(''), 'empty string coerces to false');
t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true');
forEach(objects, function (obj) {
t.equal(true, ES.ToBoolean(obj), 'object coerces to true');
});
t.equal(true, ES.ToBoolean(uncoercibleObject), 'uncoercibleObject coerces to true');
t.end();
});
test('ToNumber', function (t) {
t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN');
t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0');
t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0');
t.equal(1, ES.ToNumber(true), 'true coerces to 1');
t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself');
forEach([0, -0, 42, Infinity, -Infinity], function (num) {
t.equal(num, ES.ToNumber(num), num + ' returns itself');
});
forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) {
t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString));
});
forEach(objects, function (object) {
t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does');
});
t['throws'](function () { return ES.ToNumber(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.end();
});
test('ToInteger', function (t) {
t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0');
forEach([0, Infinity, 42], function (num) {
t.ok(is(num, ES.ToInteger(num)), num + ' returns itself');
t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself');
});
t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3');
t['throws'](function () { return ES.ToInteger(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.end();
});
test('ToInt32', function (t) {
t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0');
forEach([0, Infinity], function (num) {
t.ok(is(0, ES.ToInt32(num)), num + ' returns +0');
t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0');
});
t['throws'](function () { return ES.ToInt32(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0');
t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1');
t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31');
t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1');
forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) {
t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16));
t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16));
});
t.end();
});
test('ToUint32', function (t) {
t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0');
forEach([0, Infinity], function (num) {
t.ok(is(0, ES.ToUint32(num)), num + ' returns +0');
t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0');
});
t['throws'](function () { return ES.ToUint32(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0');
t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1');
t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31');
t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1');
forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) {
t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16));
t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16));
});
t.end();
});
test('ToUint16', function (t) {
t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0');
forEach([0, Infinity], function (num) {
t.ok(is(0, ES.ToUint16(num)), num + ' returns +0');
t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0');
});
t['throws'](function () { return ES.ToUint16(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0');
t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1');
t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0');
t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1');
t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0');
t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1');
t.end();
});
test('ToString', function (t) {
t['throws'](function () { return ES.ToString(uncoercibleObject); }, TypeError, 'uncoercibleObject throws');
t.end();
});
test('ToObject', function (t) {
t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws');
t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws');
forEach(numbers, function (number) {
var obj = ES.ToObject(number);
t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object');
t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object');
t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number);
});
t.end();
});
test('CheckObjectCoercible', function (t) {
t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws');
t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws');
var checkCoercible = function (value) {
t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, '"' + value + '" does not throw');
};
forEach(objects.concat(nonNullPrimitives), checkCoercible);
t.end();
});
test('IsCallable', function (t) {
t.equal(true, ES.IsCallable(function () {}), 'function is callable');
var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(primitives);
forEach(nonCallables, function (nonCallable) {
t.equal(false, ES.IsCallable(nonCallable), nonCallable + ' is not callable');
});
t.end();
});
test('SameValue', function (t) {
t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN');
t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0');
forEach(objects.concat(primitives), function (val) {
t.equal(val === val, ES.SameValue(val, val), '"' + val + '" is SameValue to itself');
});
t.end();
});
test('Type', function (t) {
t.equal(ES.Type(), 'Undefined', 'Type() is Undefined');
t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined');
t.equal(ES.Type(null), 'Null', 'Type(null) is Null');
t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean');
t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean');
t.equal(ES.Type(0), 'Number', 'Type(0) is Number');
t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number');
t.equal(ES.Type('abc'), 'String', 'Type("abc") is String');
t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object');
t.equal(ES.Type({}), 'Object', 'Type({}) is Object');
t.end();
});
var bothDescriptor = function () {
return { '[[Get]]': function () {}, '[[Value]]': true };
};
var accessorDescriptor = function () {
return {
'[[Get]]': function () {},
'[[Enumerable]]': true,
'[[Configurable]]': true
};
};
var mutatorDescriptor = function () {
return {
'[[Set]]': function () {},
'[[Enumerable]]': true,
'[[Configurable]]': true
};
};
var dataDescriptor = function () {
return {
'[[Value]]': 42,
'[[Writable]]': false,
'[[Configurable]]': false
};
};
var genericDescriptor = function () {
return {
'[[Configurable]]': true,
'[[Enumerable]]': false
};
};
test('IsPropertyDescriptor', function (t) {
forEach(primitives, function (primitive) {
t.equal(ES.IsPropertyDescriptor(primitive), false, primitive + ' is not a Property Descriptor');
});
t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor');
t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor');
t.equal(ES.IsPropertyDescriptor(accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor');
t.equal(ES.IsPropertyDescriptor(mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor');
t.equal(ES.IsPropertyDescriptor(dataDescriptor()), true, 'data descriptor is a Property Descriptor');
t.equal(ES.IsPropertyDescriptor(genericDescriptor()), true, 'generic descriptor is a Property Descriptor');
t['throws'](function () {
ES.IsPropertyDescriptor(bothDescriptor());
}, TypeError, 'a Property Descriptor can not be both a Data and an Accessor Descriptor');
t.end();
});
test('IsAccessorDescriptor', function (t) {
forEach(nonNullPrimitives.concat(null), function (primitive) {
t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, primitive + ' is not a Property Descriptor');
});
t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor');
t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor');
t.equal(ES.IsAccessorDescriptor(accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor');
t.equal(ES.IsAccessorDescriptor(mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor');
t.equal(ES.IsAccessorDescriptor(dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor');
t.equal(ES.IsAccessorDescriptor(genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor');
t.end();
});
test('IsDataDescriptor', function (t) {
forEach(nonNullPrimitives.concat(null), function (primitive) {
t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, primitive + ' is not a Property Descriptor');
});
t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor');
t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor');
t.equal(ES.IsDataDescriptor(accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor');
t.equal(ES.IsDataDescriptor(mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor');
t.equal(ES.IsDataDescriptor(dataDescriptor()), true, 'data descriptor is a Data Descriptor');
t.equal(ES.IsDataDescriptor(genericDescriptor()), false, 'generic descriptor is not a Data Descriptor');
t.end();
});
test('IsGenericDescriptor', function (t) {
forEach(nonNullPrimitives.concat(null), function (primitive) {
t['throws'](
function () { ES.IsGenericDescriptor(primitive); },
TypeError,
primitive + ' is not a Property Descriptor'
);
});
t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor');
t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor');
t.equal(ES.IsGenericDescriptor(accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor');
t.equal(ES.IsGenericDescriptor(mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor');
t.equal(ES.IsGenericDescriptor(dataDescriptor()), false, 'data descriptor is not a generic Descriptor');
t.equal(ES.IsGenericDescriptor(genericDescriptor()), true, 'generic descriptor is a generic Descriptor');
t.end();
});
test('FromPropertyDescriptor', function (t) {
t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined');
t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined');
forEach(nonNullPrimitives.concat(null), function (primitive) {
t['throws'](
function () { ES.FromPropertyDescriptor(primitive); },
TypeError,
primitive + ' is not a Property Descriptor'
);
});
var accessor = accessorDescriptor();
t.deepEqual(ES.FromPropertyDescriptor(accessor), {
get: accessor['[[Get]]'],
set: accessor['[[Set]]'],
enumerable: !!accessor['[[Enumerable]]'],
configurable: !!accessor['[[Configurable]]']
});
var mutator = mutatorDescriptor();
t.deepEqual(ES.FromPropertyDescriptor(mutator), {
get: mutator['[[Get]]'],
set: mutator['[[Set]]'],
enumerable: !!mutator['[[Enumerable]]'],
configurable: !!mutator['[[Configurable]]']
});
var data = dataDescriptor();
t.deepEqual(ES.FromPropertyDescriptor(data), {
value: data['[[Value]]'],
writable: data['[[Writable]]'],
enumerable: !!data['[[Enumerable]]'],
configurable: !!data['[[Configurable]]']
});
t['throws'](
function () { ES.FromPropertyDescriptor(genericDescriptor()); },
TypeError,
'a complete Property Descriptor is required'
);
t.end();
});
test('ToPropertyDescriptor', function (t) {
forEach(nonNullPrimitives.concat(null), function (primitive) {
t['throws'](
function () { ES.ToPropertyDescriptor(primitive); },
TypeError,
primitive + ' is not an Object'
);
});
var accessor = accessorDescriptor();
t.deepEqual(ES.ToPropertyDescriptor({
get: accessor['[[Get]]'],
enumerable: !!accessor['[[Enumerable]]'],
configurable: !!accessor['[[Configurable]]']
}), accessor);
var mutator = mutatorDescriptor();
t.deepEqual(ES.ToPropertyDescriptor({
set: mutator['[[Set]]'],
enumerable: !!mutator['[[Enumerable]]'],
configurable: !!mutator['[[Configurable]]']
}), mutator);
var data = dataDescriptor();
t.deepEqual(ES.ToPropertyDescriptor({
value: data['[[Value]]'],
writable: data['[[Writable]]'],
configurable: !!data['[[Configurable]]']
}), data);
var both = bothDescriptor();
t['throws'](
function () {
ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] });
},
TypeError,
'data and accessor descriptors are mutually exclusive'
);
t['throws'](
function () { ES.ToPropertyDescriptor({ get: 'not callable' }); },
TypeError,
'"get" must be undefined or callable'
);
t['throws'](
function () { ES.ToPropertyDescriptor({ set: 'not callable' }); },
TypeError,
'"set" must be undefined or callable'
);
t.end();
});

18
node_modules/es-abstract/test/es6.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
var test = require('tape');
var ES = require('../');
var ES6 = ES.ES6;
var ES2015 = ES.ES2015;
var ES6entry = require('../es6');
test('legacy es6 export', function (t) {
t.equal(ES6, ES2015, 'main ES6 === main ES2015');
t.end();
});
test('legacy es6 entry point', function (t) {
t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point');
t.end();
});

18
node_modules/es-abstract/test/es7.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
var test = require('tape');
var ES = require('../');
var ES7 = ES.ES7;
var ES2016 = ES.ES2016;
var ES7entry = require('../es7');
test('legacy es7 export', function (t) {
t.equal(ES7, ES2016, 'main ES7 === main ES2016');
t.end();
});
test('legacy es7 entry point', function (t) {
t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point');
t.end();
});

53
node_modules/es-abstract/test/helpers/values.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
'use strict';
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } };
var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } };
var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } };
var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } };
var objects = [{}, coercibleObject, toStringOnlyObject, valueOfOnlyObject];
var nullPrimitives = [undefined, null];
var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3];
var numbers = [0, -0, Infinity, -Infinity, 42];
var strings = ['', 'foo'];
var booleans = [true, false];
var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : [];
var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers);
var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols);
var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols);
var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives);
var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects);
var primitives = [].concat(nullPrimitives, nonNullPrimitives);
var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects);
var propertyKeys = [].concat(strings, symbols);
var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects);
var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN);
var truthies = [].concat(true, 'foo', 42, symbols, objects);
module.exports = {
coercibleObject: coercibleObject,
valueOfOnlyObject: valueOfOnlyObject,
toStringOnlyObject: toStringOnlyObject,
uncoercibleObject: uncoercibleObject,
objects: objects,
nullPrimitives: nullPrimitives,
numbers: numbers,
strings: strings,
booleans: booleans,
symbols: symbols,
hasSymbols: hasSymbols,
nonSymbolPrimitives: nonSymbolPrimitives,
nonNumberPrimitives: nonNumberPrimitives,
nonNullPrimitives: nonNullPrimitives,
nonUndefinedPrimitives: nonUndefinedPrimitives,
nonStrings: nonStrings,
nonNumbers: nonNumberPrimitives.concat(objects),
nonIntegerNumbers: nonIntegerNumbers,
primitives: primitives,
nonPropertyKeys: nonPropertyKeys,
propertyKeys: propertyKeys,
nonBooleans: nonBooleans,
falsies: falsies,
truthies: truthies
};

26
node_modules/es-abstract/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict';
var ES = require('../');
var test = require('tape');
var ESkeys = Object.keys(ES).sort();
var ES6keys = Object.keys(ES.ES6).sort();
test('exposed properties', function (t) {
t.deepEqual(ESkeys, ES6keys.concat(['ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys');
t.end();
});
test('methods match', function (t) {
ES6keys.forEach(function (key) {
t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method');
});
t.end();
});
require('./es5');
require('./es6');
require('./es2015');
require('./es7');
require('./es2016');
require('./es2017');

1563
node_modules/es-abstract/test/tests.js generated vendored Normal file

File diff suppressed because it is too large Load Diff