Compare commits

...

38 Commits

Author SHA1 Message Date
Henry Zhu
bdfeeb38c6 v7.0.0-beta.43 2018-04-02 12:47:55 -04:00
Henry Zhu
47ada5ab3a revert prev pr to temp fix osx (#7652) 2018-04-02 12:40:03 -04:00
John-David Dalton
59ba3959dc Add options.allowAwaitOutsideFunction. (#7637) 2018-03-29 10:41:14 -04:00
unconfident
0200e6256a Allow StringLiteral to be used as ObjectTypeProperty.key (#7639) 2018-03-28 09:20:46 -05:00
Henry Zhu
9a26c2b07a Merge pull request #7471 from yakotika/master
added support Node's --require and -r flags in babel-node
2018-03-27 14:44:35 -04:00
Henry Zhu
901571d72f Merge pull request #7579 from devenbansod/migrate-to-jest-expect-2
Migrate a few packages' tests to use Jest Expect (see below)
2018-03-27 14:43:44 -04:00
Deven Bansod
b09c729675 Use expect's instanceOf and toHaveProperty methods 2018-03-27 22:34:25 +05:30
Sven SAULEAU
a36525be45 Merge pull request #7615 from babel/fix-clean-makefile
clean makefile a bit
2018-03-27 08:36:16 +02:00
Logan Smyth
a10c91790f Merge pull request #7588 from loganfsmyth/register-cycle-fixes
Have @babel/core lazy-load all dependencies and make @babel/register not explode because of that
2018-03-25 15:24:00 -07:00
Justin Ridgewell
ab7d1231ad Fix flow errors with Logical Assignment Operators (#7629)
* Fix flow errors with logical assignment

* Fix column numbers
2018-03-25 22:47:48 +01:00
Logan Smyth
a5df709bc3 Lazy-load @babel/core's dependencies to decrease up-front load times. 2018-03-25 14:22:32 -07:00
Logan Smyth
1dbed5f458 Have @babel/register explicitly skip re-entrant plugins/presets. 2018-03-25 14:22:32 -07:00
Logan Smyth
40e38646e4 Include stdout in error messages to aid debugging. 2018-03-25 12:50:35 -07:00
Logan Smyth
9e4dd861ee Ensure that sourceMapSupport is installed in all branches. 2018-03-25 12:50:35 -07:00
Justin Ridgewell
a7bddc02ba Add ??= to Logical Assignment Operators (#7623)
`??=` is being merged into the Logical Assignment Operator proposal, and the overall proposal will wait until nullish coalescing is finalized.
2018-03-25 18:58:51 +01:00
Justin Ridgewell
023f8bd1cb Move Logical Assignment Ops to Stage 1 (#7625) 2018-03-25 17:49:21 +01:00
Deven Bansod
c9b99af5a6 Remove assert.* from commented out assertions 2018-03-24 16:22:20 +05:30
Deven Bansod
c8d82d6483 Migrate all remaining fixtures to jest expect 2018-03-24 16:22:20 +05:30
Deven Bansod
db42a5d70f Migrate babel-preset-es2015 and -next-target tests to use jest expect 2018-03-24 16:22:19 +05:30
Deven Bansod
0856f89882 Migrate -transform-block-scoping and -transform-classes to jest expect 2018-03-24 16:22:18 +05:30
Deven Bansod
921702ef8c Migrate babel-plugin-proposal-do-expressions tests to jest-expect 2018-03-24 16:22:18 +05:30
Deven Bansod
8b57a3e3b9 Migrate a few packages' tests to use Jest Expect (see below)
* Migrate the following packages' tests:
    * babel-helper-annotate-as-pure
    * babel-helper-module-imports
    * babel-helper-transform-fixture-test-runner
    * babel-highlight
    * babel-node
    * babel-plugin-transform-modules-commonjs
    * babel-preset-env-standalone
    * babel-preset-env
    * babel-preset-es2015
    * babel-preset-react
    * babel-standalone
    * babel-template
    * babel-traverse
    * babel-types
2018-03-24 16:22:10 +05:30
Logan Smyth
21309cc8d4 Make these tests re-throw the same error to keep the trace. 2018-03-23 21:26:50 -07:00
Andy
19708e0154 TypeScript: support mapped type modifiers syntax (#7383) 2018-03-23 14:34:15 -04:00
Mateusz Burzyński
f98dff9189 Allow placeholders in JSXElements when parsing templates (#7583) 2018-03-23 09:27:51 +01:00
Brian Ng
840ba187a7 Prevent duplicate regex flags (#7617) 2018-03-22 10:25:26 -05:00
Sven SAULEAU
de00d939f0 fix: clean makefile 2018-03-22 10:29:25 +01:00
Brian Ng
e80488f1d5 Update to beta.42 (#7609) 2018-03-21 10:39:46 -05:00
Michał Pierzchała
81c1b49f6a Disable flow on transformClass, fix preset-env errors (#7605) 2018-03-20 18:42:11 -05:00
Justin Ridgewell
55bf55398a Logical Assignment: ensure computed key isn't recomputed (#7604)
* Logical Assignment: ensure computed key isn't recomputed

* More tests
2018-03-20 23:06:09 +00:00
Daniel Tschinder
f0d681a238 Remove obsolete max-len eslint rule and reformat some stuff to fit (#7602) 2018-03-20 08:51:47 -05:00
Logan Smyth
6d6fe844fd Centralize Babel's own compilation config to make it easier to follow. (#7599) 2018-03-19 21:49:17 -07:00
Logan Smyth
edb0a70e14 Run prettier to format all JSON. 2018-03-19 18:26:55 -07:00
Brian Ng
669f6b97b2 Tweak es2015-related plugin order in preset-env (#7586) 2018-03-19 14:19:42 -05:00
Michał Pierzchała
e2c5f25e97 Refactored quirky inheritance in babel-plugin-transform-classes (#7444)
* chore(plugin-transform-classes): refactor inheritance

* path some flow types

* remove unused export

* get rid of class

* temporarily rename to vanilla for diff readability

* more setState with minor adjustments

* rename 'private' methods

* explicit null check

* adjust import ordering

* Rename createConstructor -> maybeCreateConstructor

* Rename vanilla.js -> transformClass.js
2018-03-19 16:37:59 +01:00
Amin Marashi
8eee435cd6 Add RegExp support to include/exclude preset-env options (#7242)
* Add support for RegExp includes/excludes

* Keep the plugin order

* Detect invalid modules in regexp

* Add more tests for regexp

* Cover builtins, and unnormalized in the RegExp tests

* Remove babel-plugin- in all positions

* Change babel-plugin- prefix to string

* Add a test for the same module in include/exclude

* Handle partial matches explicitly

* Remove extra valid regexp check

* Optimise validation of plugins

* Optimise selecting the plugins

* Fix undefined include/exclude option

* Update documentation to reflect the new include matching

* Fix typo

* Apply reviews

Use regexp.test instead of string.match (slower)

Define flatten helper

Do not normalize babel-plugin anywhere in the string
2018-03-18 15:54:43 +01:00
Daniel Tschinder
da2aea31f5 Fix —require 2018-03-14 13:26:07 +01:00
Abu Shamsutdinov
8317f8ab14 added support Node's --require and -r flags in babel-node 2018-03-07 12:38:57 +03:00
896 changed files with 8392 additions and 7633 deletions

View File

@@ -1,48 +1,80 @@
"use strict";
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
const envOpts = {
loose: true,
module.exports = function(api) {
const env = api.env();
const includeCoverage = process.env.BABEL_COVERAGE === "true";
const envOpts = {
loose: true,
modules: false,
exclude: ["transform-typeof-symbol"],
};
let convertESM = true;
switch (env) {
// Configs used during bundling builds.
case "babylon":
case "standalone":
convertESM = false;
break;
case "production":
// Config during builds before publish.
break;
case "development":
envOpts.debug = true;
envOpts.targets = {
node: "current",
};
break;
case "test":
envOpts.targets = {
node: "current",
};
break;
}
const config = {
comments: false,
presets: [["@babel/env", envOpts]],
plugins: [
// TODO: Use @babel/preset-flow when
// https://github.com/babel/babel/issues/7233 is fixed
"@babel/plugin-transform-flow-strip-types",
["@babel/proposal-class-properties", { loose: true }],
"@babel/proposal-export-namespace-from",
"@babel/proposal-numeric-separator",
["@babel/proposal-object-rest-spread", { useBuiltIns: true }],
// Explicitly use the lazy version of CommonJS modules.
convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null,
].filter(Boolean),
overrides: [
{
test: "packages/babylon",
plugins: [
"babel-plugin-transform-charcodes",
["@babel/transform-for-of", { assumeArray: true }],
],
},
{
test: "./packages/babel-register",
plugins: [
// Override the root options to disable lazy imports for babel-register
// because otherwise the require hook will try to lazy-import things
// leading to dependency cycles.
convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean),
},
],
};
// we need to do this as long as we do not test everything from source
if (includeCoverage) {
config.auxiliaryCommentBefore = "istanbul ignore next";
config.plugins.push("babel-plugin-istanbul");
}
return config;
};
switch (env) {
case "development":
envOpts.debug = true;
// fall-through
case "test":
case "cov":
envOpts.targets = {
node: "current",
};
}
const config = {
comments: false,
presets: [["@babel/env", envOpts]],
plugins: [
// TODO: Use @babel/preset-flow when
// https://github.com/babel/babel/issues/7233 is fixed
"@babel/plugin-transform-flow-strip-types",
["@babel/proposal-class-properties", { loose: true }],
"@babel/proposal-export-namespace-from",
"@babel/proposal-numeric-separator",
["@babel/proposal-object-rest-spread", { useBuiltIns: true }],
],
overrides: [
{
test: "packages/babylon",
plugins: [
"babel-plugin-transform-charcodes",
["@babel/transform-for-of", { assumeArray: true }],
],
},
],
};
// we need to do this as long as we do not test everything from source
if (env === "cov") {
config.auxiliaryCommentBefore = "istanbul ignore next";
config.plugins.push("babel-plugin-istanbul");
}
module.exports = config;

View File

@@ -1,16 +0,0 @@
"use strict";
const cloneDeep = require("lodash/cloneDeep");
const babelrc = require("./.babelrc.js");
const config = cloneDeep(babelrc);
const presetEnv = config.presets.find(preset => preset[0] === "@babel/env");
if (!presetEnv) {
throw new Error("Error while extracting @preset/env from .babelrc.js");
}
presetEnv[1].modules = false;
module.exports = config;

View File

@@ -22,6 +22,7 @@
"files": [
"packages/*/test/**/*.js",
"codemods/*/test/**/*.js",
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
"test/**/*.js"
],
"env": {

View File

@@ -98,8 +98,9 @@ function buildRollup(packages) {
format: "cjs",
plugins: [
rollupBabel({
envName: "babylon",
babelrc: false,
extends: "./.babelrc.rollup.js",
extends: "./.babelrc.js",
}),
rollupNodeResolve(),
],

View File

@@ -2,7 +2,7 @@ MAKEFLAGS = -j1
FLOW_COMMIT = 622bbc4f07acb77eb1109830c70815f827401d90
TEST262_COMMIT = 52f70e2f637731aae92a9c9a2d831310c3ab2e1e
export NODE_ENV = test
export BABEL_ENV = test
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
@@ -11,8 +11,7 @@ SOURCES = packages codemods
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
build: clean
make clean-lib
build: clean clean-lib
./node_modules/.bin/gulp build
node ./packages/babel-types/scripts/generateTypeHelpers.js
# call build again as the generated files might need to be compiled again.
@@ -22,7 +21,7 @@ build: clean
node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
# generate docs
node scripts/generators/docs.js > ./packages/babel-types/README.md
ifneq ("$(BABEL_ENV)", "cov")
ifneq ("$(BABEL_COVERAGE)", "true")
make build-standalone
make build-preset-env-standalone
endif
@@ -39,8 +38,7 @@ build-dist: build
cd packages/babel-runtime; \
node scripts/build-dist.js
watch: clean
make clean-lib
watch: clean clean-lib
# Ensure that build artifacts for types are created during local
# development too.
@@ -76,13 +74,11 @@ test-only:
test: lint test-only
test-ci:
make bootstrap
make test-only
test-ci: bootstrap test-only
test-ci-coverage: SHELL:=/bin/bash
test-ci-coverage:
BABEL_ENV=cov make bootstrap
BABEL_COVERAGE=true BABEL_ENV=test make bootstrap
TEST_TYPE=cov ./scripts/test-cov.sh
bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json
@@ -95,9 +91,7 @@ bootstrap-flow:
test-flow:
node scripts/tests/flow/run_babylon_flow_tests.js
test-flow-ci:
make bootstrap
make test-flow
test-flow-ci: bootstrap test-flow
test-flow-update-whitelist:
node scripts/tests/flow/run_babylon_flow_tests.js --update-whitelist
@@ -111,9 +105,7 @@ bootstrap-test262:
test-test262:
node scripts/tests/test262/run_babylon_test262.js
test-test262-ci:
make bootstrap
make test-test262
test-test262-ci: bootstrap test-test262
test-test262-update-whitelist:
node scripts/tests/test262/run_babylon_test262.js --update-whitelist
@@ -130,8 +122,7 @@ publish:
./node_modules/.bin/lerna publish --force-publish=* --exact --skip-temp-tag
make clean
bootstrap:
make clean-all
bootstrap: clean-all
yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines
make build

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-codemod-optional-catch-binding",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Remove unused catch bindings",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding",
"license": "MIT",
@@ -9,13 +9,13 @@
"@babel/plugin"
],
"dependencies": {
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.42"
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.43"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"lerna": "2.0.0-rc.4",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"changelog": {
"repo": "babel/babel",
"labels": {

View File

@@ -10,18 +10,19 @@
"test": "make test"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.41",
"@babel/core": "7.0.0-beta.41",
"@babel/preset-env": "7.0.0-beta.41",
"@babel/preset-flow": "7.0.0-beta.41",
"@babel/preset-stage-0": "7.0.0-beta.41",
"@babel/register": "7.0.0-beta.41",
"@babel/cli": "7.0.0-beta.42",
"@babel/core": "7.0.0-beta.42",
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.42",
"@babel/preset-env": "7.0.0-beta.42",
"@babel/preset-flow": "7.0.0-beta.42",
"@babel/preset-stage-0": "7.0.0-beta.42",
"@babel/register": "7.0.0-beta.42",
"babel-core": "^7.0.0-0",
"babel-eslint": "^8.0.1",
"babel-jest": "^22.4.1",
"babel-loader": "8.0.0-beta.0",
"babel-plugin-transform-charcodes": "^0.1.0",
"babylon": "7.0.0-beta.41",
"babylon": "7.0.0-beta.42",
"browserify": "^13.1.1",
"bundle-collapser": "^1.2.1",
"chai": "^4.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/cli",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel command line.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -29,11 +29,11 @@
"chokidar": "^1.6.1"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-fixtures": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-fixtures": "7.0.0-beta.43"
},
"bin": {
"babel": "./bin/babel.js",

View File

@@ -32,7 +32,6 @@ function collect(value, previousValue): Array<string> {
return previousValue ? previousValue.concat(values) : values;
}
/* eslint-disable max-len */
// Standard Babel input configs.
commander.option(
"-f, --filename [filename]",
@@ -168,7 +167,6 @@ commander.option(
"--delete-dir-on-start",
"Delete the out directory before compilation",
);
/* eslint-enable max-len */
commander.version(pkg.version + " (@babel/core " + version + ")");
commander.usage("[options] <files ...>");

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/code-frame",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Generate errors that contain a code frame that point to source locations.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,7 +8,7 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame",
"main": "lib/index.js",
"dependencies": {
"@babel/highlight": "7.0.0-beta.42"
"@babel/highlight": "7.0.0-beta.43"
},
"devDependencies": {
"chalk": "^2.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/core",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel compiler core.",
"main": "./lib/index.js",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
@@ -28,13 +28,13 @@
"./lib/transform-file-sync.js": "./lib/transform-file-sync-browser.js"
},
"dependencies": {
"@babel/code-frame": "7.0.0-beta.42",
"@babel/generator": "7.0.0-beta.42",
"@babel/helpers": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"babylon": "7.0.0-beta.42",
"@babel/code-frame": "7.0.0-beta.43",
"@babel/generator": "7.0.0-beta.43",
"@babel/helpers": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43",
"babylon": "7.0.0-beta.43",
"convert-source-map": "^1.1.0",
"debug": "^3.1.0",
"json5": "^0.5.0",
@@ -45,7 +45,7 @@
"source-map": "^0.5.0"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42",
"@babel/register": "7.0.0-beta.42"
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.43",
"@babel/register": "7.0.0-beta.43"
}
}

View File

@@ -105,7 +105,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedOriginal) {
// eslint-disable-next-line max-len
e.message += `\n- If you want to resolve "${name}", use "module:${name}"`;
}
}
@@ -119,7 +118,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedBabel) {
// eslint-disable-next-line max-len
e.message += `\n- Did you mean "@babel/${name}"?`;
}
@@ -131,7 +129,6 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedOppositeType) {
// eslint-disable-next-line max-len
e.message += `\n- Did you accidentally pass a ${type} as a ${oppositeType}?`;
}
@@ -143,8 +140,9 @@ const LOADING_MODULES = new Set();
function requireModule(type: string, name: string): mixed {
if (LOADING_MODULES.has(name)) {
throw new Error(
// eslint-disable-next-line max-len
`Reentrant ${type} detected trying to load "${name}". This module is not ignored and is trying to load itself while compiling itself, leading to a dependency cycle. We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.`,
`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` +
"and is trying to load itself while compiling itself, leading to a dependency cycle. " +
'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.',
);
}

View File

@@ -1,5 +1,4 @@
// @flow
/* eslint max-len: "off" */
export default {
auxiliaryComment: {
@@ -16,36 +15,42 @@ export default {
},
externalHelpers: {
message:
"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/",
"Use the `external-helpers` plugin instead. " +
"Check out http://babeljs.io/docs/plugins/external-helpers/",
},
extra: {
message: "",
},
jsxPragma: {
message:
"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/",
"use the `pragma` option in the `react-jsx` plugin. " +
"Check out http://babeljs.io/docs/plugins/transform-react-jsx/",
},
loose: {
message:
"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option.",
"Specify the `loose` option for the relevant plugin you are using " +
"or use a preset that sets the option.",
},
metadataUsedHelpers: {
message: "Not required anymore as this is enabled by default",
},
modules: {
message:
"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules",
"Use the corresponding module transform plugin in the `plugins` option. " +
"Check out http://babeljs.io/docs/plugins/#modules",
},
nonStandard: {
message:
"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/",
"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " +
"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/",
},
optional: {
message: "Put the specific transforms you want in the `plugins` option",
},
sourceMapName: {
message:
"The `sourceMapName` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
"The `sourceMapName` option has been removed because it makes more sense for the " +
"tooling that calls Babel to assign `map.file` themselves.",
},
stage: {
message:
@@ -69,6 +74,7 @@ export default {
sourceMapTarget: {
version: 6,
message:
"The `sourceMapTarget` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.",
"The `sourceMapTarget` option has been removed because it makes more sense for the tooling " +
"that calls Babel to assign `map.file` themselves.",
},
};

View File

@@ -243,7 +243,6 @@ describe("addon resolution", function() {
babelrc: false,
presets: ["foo"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-preset-foo'.*\n- If you want to resolve "foo", use "module:foo"/,
);
@@ -258,7 +257,6 @@ describe("addon resolution", function() {
babelrc: false,
plugins: ["foo"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-plugin-foo'.*\n- If you want to resolve "foo", use "module:foo"/,
);
@@ -273,7 +271,6 @@ describe("addon resolution", function() {
babelrc: false,
presets: ["foo"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-preset-foo'.*\n- Did you mean "@babel\/foo"\?/,
);
@@ -288,7 +285,6 @@ describe("addon resolution", function() {
babelrc: false,
plugins: ["foo"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-plugin-foo'.*\n- Did you mean "@babel\/foo"\?/,
);
@@ -303,7 +299,6 @@ describe("addon resolution", function() {
babelrc: false,
presets: ["testplugin"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a preset as a plugin\?/,
);
@@ -318,7 +313,6 @@ describe("addon resolution", function() {
babelrc: false,
plugins: ["testpreset"],
});
// eslint-disable-next-line max-len
}).toThrow(
/Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a plugin as a preset\?/,
);

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/generator",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Turns an AST into code.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -11,14 +11,14 @@
"lib"
],
"dependencies": {
"@babel/types": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.43",
"jsesc": "^2.5.1",
"lodash": "^4.2.0",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
},
"devDependencies": {
"@babel/helper-fixtures": "7.0.0-beta.42",
"babylon": "7.0.0-beta.42"
"@babel/helper-fixtures": "7.0.0-beta.43",
"babylon": "7.0.0-beta.43"
}
}

View File

@@ -302,6 +302,7 @@ export function TSMappedType(node) {
this.token("{");
this.space();
if (readonly) {
tokenIfPlusMinus(this, readonly);
this.word("readonly");
this.space();
}
@@ -315,6 +316,7 @@ export function TSMappedType(node) {
this.token("]");
if (optional) {
tokenIfPlusMinus(this, optional);
this.token("?");
}
this.token(":");
@@ -324,6 +326,12 @@ export function TSMappedType(node) {
this.token("}");
}
function tokenIfPlusMinus(self, tok) {
if (tok !== true) {
self.token(tok);
}
}
export function TSLiteralType(node) {
this.print(node.literal, node);
}

View File

@@ -1,2 +1,4 @@
let map: { [P in string]: number; };
let map: { readonly [P in string]?: number; };
let map: { [P in string]: number };
let map: { readonly [P in string]?: number };
let map: { +readonly [P in string]+?: number };
let map: { -readonly [P in string]-?: number };

View File

@@ -1,2 +1,4 @@
let map: { [P in string]: number };
let map: { readonly [P in string]?: number };
let map: { readonly [P in string]?: number };
let map: { +readonly [P in string]+?: number };
let map: { -readonly [P in string]-?: number };

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-annotate-as-pure",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to annotate paths and nodes with #__PURE__ comment",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,12 +1,11 @@
import annotateAsPure from "../";
import assert from "assert";
describe("@babel/helper-annotate-as-pure", () => {
it("will add leading comment", () => {
const node = {};
annotateAsPure(node);
assert.deepEqual(node.leadingComments, [
expect(node.leadingComments).toEqual([
{
type: "CommentBlock",
value: "#__PURE__",
@@ -26,7 +25,7 @@ describe("@babel/helper-annotate-as-pure", () => {
annotateAsPure(node);
assert.deepEqual(node.leadingComments, [
expect(node.leadingComments).toEqual([
{
type: "CommentBlock",
value: "#__PURE__",

View File

@@ -1,12 +1,12 @@
{
"name": "@babel/helper-bindify-decorators",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to bindify decorators",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,12 +1,12 @@
{
"name": "@babel/helper-builder-binary-assignment-operator-visitor",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to build binary assignment operator visitors",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-explode-assignable-expression": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-explode-assignable-expression": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,12 +1,12 @@
{
"name": "@babel/helper-builder-react-jsx",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to build react jsx",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.43",
"esutils": "^2.0.0"
}
}

View File

@@ -1,13 +1,13 @@
{
"name": "@babel/helper-call-delegate",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to call delegate",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-hoist-variables": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-hoist-variables": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,13 +1,13 @@
{
"name": "@babel/helper-define-map",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to define a map",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-function-name": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"@babel/helper-function-name": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43",
"lodash": "^4.2.0"
}
}

View File

@@ -1,12 +1,12 @@
{
"name": "@babel/helper-explode-assignable-expression",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to explode an assignable expression",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,13 +1,13 @@
{
"name": "@babel/helper-explode-class",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to explode class",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-bindify-decorators": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-bindify-decorators": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-fixtures",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to support fixtures",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"license": "MIT",

View File

@@ -1,13 +1,13 @@
{
"name": "@babel/helper-function-name",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to change the property 'name' of every function",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-get-function-arity": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-get-function-arity": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-get-function-arity",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to get function arity",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-hoist-variables",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to hoist variables",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-module-imports",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel helper functions for inserting module loads",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,10 +8,10 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.43",
"lodash": "^4.2.0"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
}
}

View File

@@ -1,4 +1,3 @@
import chai from "chai";
import * as babel from "@babel/core";
import { ImportInjector } from "../";
@@ -33,9 +32,9 @@ function test(sourceType, opts, initializer, expectedCode) {
],
});
chai
.expect(result.code.replace(/\s+/g, " ").trim())
.to.equal((expectedCode || "").replace(/\s+/g, " ").trim());
expect(result.code.replace(/\s+/g, " ").trim()).toBe(
(expectedCode || "").replace(/\s+/g, " ").trim(),
);
}
const testScript = test.bind(undefined, "script");
const testModule = test.bind(undefined, "module");
@@ -90,11 +89,9 @@ describe("@babel/helper-module-imports", () => {
describe("using a CommonJS loader", () => {
it("should import", () => {
chai
.expect(() => {
testScript({ importedType }, addNamespace());
})
.to.throw(Error, "Cannot import an ES6 module from CommonJS");
expect(() => {
testScript({ importedType }, addNamespace());
}).toThrow("Cannot import an ES6 module from CommonJS");
});
});
});
@@ -302,11 +299,9 @@ describe("@babel/helper-module-imports", () => {
describe("using a CommonJS loader", () => {
it("should import", () => {
chai
.expect(() => {
testScript({ importedType }, addDefault());
})
.to.throw(Error, "Cannot import an ES6 module from CommonJS");
expect(() => {
testScript({ importedType }, addDefault());
}).toThrow("Cannot import an ES6 module from CommonJS");
});
});
});
@@ -390,14 +385,12 @@ describe("@babel/helper-module-imports", () => {
});
it("should fail to import with force-enabled liveness", () => {
chai
.expect(() => {
testScript(
{ importedInterop, ensureLiveReference: true },
addDefault(),
);
})
.to.throw(Error, "No live reference for commonjs default");
expect(() => {
testScript(
{ importedInterop, ensureLiveReference: true },
addDefault(),
);
}).toThrow("No live reference for commonjs default");
});
});
});
@@ -659,11 +652,9 @@ describe("@babel/helper-module-imports", () => {
describe("using a CommonJS loader", () => {
it("should import", () => {
chai
.expect(() => {
testScript({ importedType }, addNamed());
})
.to.throw(Error, "Cannot import an ES6 module from CommonJS");
expect(() => {
testScript({ importedType }, addNamed());
}).toThrow("Cannot import an ES6 module from CommonJS");
});
});
});
@@ -967,11 +958,9 @@ describe("@babel/helper-module-imports", () => {
describe("using a CommonJS loader", () => {
it("should import", () => {
chai
.expect(() => {
testScript({ importedType }, addSideEffect());
})
.to.throw(Error, "Cannot import an ES6 module from CommonJS");
expect(() => {
testScript({ importedType }, addSideEffect());
}).toThrow("Cannot import an ES6 module from CommonJS");
});
});
});

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-module-transforms",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel helper functions for implementing ES6 module transformations",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,11 +8,11 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-module-imports": "7.0.0-beta.42",
"@babel/helper-simple-access": "7.0.0-beta.42",
"@babel/helper-split-export-declaration": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"@babel/helper-module-imports": "7.0.0-beta.43",
"@babel/helper-simple-access": "7.0.0-beta.43",
"@babel/helper-split-export-declaration": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43",
"lodash": "^4.2.0"
}
}

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-optimise-call-expression",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to optimise call expression",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-plugin-test-runner",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to support test runner",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42"
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-plugin-utils",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "General utilities for plugins to use",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"homepage": "https://babeljs.io/",

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-regex",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to check for literal RegEx",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex",
"license": "MIT",

View File

@@ -1,15 +1,15 @@
{
"name": "@babel/helper-remap-async-to-generator",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to remap async functions to generators",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-annotate-as-pure": "7.0.0-beta.42",
"@babel/helper-wrap-function": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-annotate-as-pure": "7.0.0-beta.43",
"@babel/helper-wrap-function": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,14 +1,14 @@
{
"name": "@babel/helper-replace-supers",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper function to replace supers",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-optimise-call-expression": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-optimise-call-expression": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-simple-access",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel helper for ensuring that access to a given value is performed through simple accesses",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,8 +8,8 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access",
"main": "lib/index.js",
"dependencies": {
"@babel/template": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43",
"lodash": "^4.2.0"
}
}

View File

@@ -1,11 +1,11 @@
{
"name": "@babel/helper-split-export-declaration",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-transform-fixture-test-runner",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Transform test runner for @babel/helper-fixtures module",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,10 +8,10 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-transform-fixture-test-runner",
"main": "lib/index.js",
"dependencies": {
"@babel/code-frame": "7.0.0-beta.42",
"@babel/core": "7.0.0-beta.42",
"@babel/helper-fixtures": "7.0.0-beta.42",
"@babel/polyfill": "7.0.0-beta.42",
"@babel/code-frame": "7.0.0-beta.43",
"@babel/core": "7.0.0-beta.43",
"@babel/helper-fixtures": "7.0.0-beta.43",
"@babel/polyfill": "7.0.0-beta.43",
"chai": "^4.1.0",
"jest": "^22.4.2",
"jest-diff": "^22.4.0",

View File

@@ -1,15 +1,7 @@
import assert from "assert";
export function assertNoOwnProperties(obj) {
assert.equal(Object.getOwnPropertyNames(obj).length, 0);
expect(Object.getOwnPropertyNames(obj)).toHaveLength(0);
}
export function assertHasOwnProperty() {}
export function assertLacksOwnProperty() {}
export function multiline(arr) {
return arr.join("\n");
}
export const assertArrayEquals = assert.deepEqual;

View File

@@ -1,4 +1,3 @@
import assert from "assert";
import { runCodeInTestContext } from "..";
describe("helper-transform-fixture-test-runner", function() {
@@ -6,13 +5,13 @@ describe("helper-transform-fixture-test-runner", function() {
try {
global.foo = "outer";
runCodeInTestContext(`
assert.equal(global.foo, undefined);
expect(global.foo).toBeUndefined();
global.foo = "inner";
`);
assert.equal(global.foo, "outer");
expect(global.foo).toBe("outer");
runCodeInTestContext(`
assert.equal(global.foo, "inner");
expect(global.foo).toBe("inner");
`);
} finally {
delete global.foo;

View File

@@ -1,14 +1,14 @@
{
"name": "@babel/helper-wrap-function",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Helper to wrap functions inside a function call.",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function",
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-function-name": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-function-name": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helpers",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Collection of helper functions used by Babel transforms.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -8,11 +8,11 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers",
"main": "lib/index.js",
"dependencies": {
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -1,5 +1,3 @@
/* eslint max-len: "off" */
import template from "@babel/template";
const helpers = {};
@@ -26,7 +24,9 @@ helpers.jsx = () => template.program.ast`
export default function _createRawReactElement(type, props, key, children) {
if (!REACT_ELEMENT_TYPE) {
REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;
REACT_ELEMENT_TYPE = (
typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")
) || 0xeac7;
}
var defaultProps = type && type.defaultProps;
@@ -431,7 +431,8 @@ helpers.inherits = () => template.program.ast`
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
if (superClass)
Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
`;

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/highlight",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Syntax highlight JavaScript strings for output in terminals.",
"author": "suchipi <me@suchipi.com>",
"homepage": "https://babeljs.io/",

View File

@@ -1,4 +1,3 @@
import assert from "assert";
import chalk from "chalk";
import stripAnsi from "strip-ansi";
import highlight, { shouldHighlight, getChalk } from "..";
@@ -24,8 +23,8 @@ describe("@babel/highlight", function() {
const code = "console.log('hi')";
const result = highlight(code);
const stripped = stripAnsi(result);
assert.ok(result.length > stripped.length);
assert.equal(stripped, code);
expect(result.length).toBeGreaterThan(stripped.length);
expect(stripped).toBe(code);
});
});
@@ -36,8 +35,8 @@ describe("@babel/highlight", function() {
const code = "console.log('hi')";
const result = highlight(code);
const stripped = stripAnsi(result);
assert.ok(result.length === stripped.length);
assert.equal(result, code);
expect(result.length).toBe(stripped.length);
expect(result).toBe(code);
});
describe("and the forceColor option is passed", function() {
@@ -45,8 +44,8 @@ describe("@babel/highlight", function() {
const code = "console.log('hi')";
const result = highlight(code, { forceColor: true });
const stripped = stripAnsi(result);
assert.ok(result.length > stripped.length);
assert.equal(stripped, code);
expect(result.length).toBeGreaterThan(stripped.length);
expect(stripped).toBe(code);
});
});
});
@@ -57,7 +56,7 @@ describe("@babel/highlight", function() {
stubColorSupport(true);
it("returns true", function() {
assert.ok(shouldHighlight({}));
expect(shouldHighlight({})).toBeTruthy();
});
});
@@ -65,12 +64,12 @@ describe("@babel/highlight", function() {
stubColorSupport(false);
it("returns false", function() {
assert.ok(!shouldHighlight({}));
expect(shouldHighlight({})).toBeFalsy();
});
describe("and the forceColor option is passed", function() {
it("returns true", function() {
assert.ok(shouldHighlight({ forceColor: true }));
expect(shouldHighlight({ forceColor: true })).toBeTruthy();
});
});
});
@@ -82,14 +81,13 @@ describe("@babel/highlight", function() {
describe("when forceColor is not passed", function() {
it("returns a Chalk instance", function() {
assert.equal(getChalk({}).constructor, chalk.constructor);
expect(getChalk({}).constructor).toBe(chalk.constructor);
});
});
describe("when forceColor is passed", function() {
it("returns a Chalk instance", function() {
assert.equal(
getChalk({ forceColor: true }).constructor,
expect(getChalk({ forceColor: true }).constructor).toBe(
chalk.constructor,
);
});
@@ -101,14 +99,13 @@ describe("@babel/highlight", function() {
describe("when forceColor is not passed", function() {
it("returns a Chalk instance", function() {
assert.equal(getChalk({}).constructor, chalk.constructor);
expect(getChalk({}).constructor).toBe(chalk.constructor);
});
});
describe("when forceColor is passed", function() {
it("returns a Chalk instance", function() {
assert.equal(
getChalk({ forceColor: true }).constructor,
expect(getChalk({ forceColor: true }).constructor).toBe(
chalk.constructor,
);
});

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/node",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Babel command line",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -16,8 +16,8 @@
"compiler"
],
"dependencies": {
"@babel/polyfill": "7.0.0-beta.42",
"@babel/register": "7.0.0-beta.42",
"@babel/polyfill": "7.0.0-beta.43",
"@babel/register": "7.0.0-beta.43",
"commander": "^2.8.1",
"fs-readdir-recursive": "^1.0.0",
"lodash": "^4.2.0",
@@ -25,11 +25,11 @@
"v8flags": "^3.0.0"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-fixtures": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-fixtures": "7.0.0-beta.43"
},
"bin": {
"babel-node": "./bin/babel-node.js"

View File

@@ -21,8 +21,8 @@ function collect(value, previousValue): Array<string> {
return previousValue ? previousValue.concat(values) : values;
}
/* eslint-disable max-len */
program.option("-e, --eval [script]", "Evaluate script");
program.option("-r, --require [module]", "Require module");
program.option("-p, --print [code]", "Evaluate script and print result");
program.option(
"-o, --only [globs]",
@@ -41,7 +41,6 @@ program.option(
);
program.option("-w, --plugins [string]", "", collect);
program.option("-b, --presets [string]", "", collect);
/* eslint-enable max-len */
program.version(pkg.version);
program.usage("[options] [ -e script | script.js ] [arguments]");
@@ -132,7 +131,11 @@ if (program.eval || program.print) {
if (arg[0] === "-") {
const parsedArg = program[arg.slice(2)];
if (parsedArg && parsedArg !== true) {
if (
arg === "-r" ||
arg === "--require" ||
(parsedArg && parsedArg !== true)
) {
ignoreNext = true;
}
} else {
@@ -142,6 +145,15 @@ if (program.eval || program.print) {
});
args = args.slice(i);
// We have to handle require ourselfs, as we want to require it in the context of babel-register
if (program.require) {
let requireFileName = program.require;
if (!path.isAbsolute(requireFileName)) {
requireFileName = path.join(process.cwd(), requireFileName);
}
require(requireFileName);
}
// make the filename absolute
const filename = args[0];
if (!path.isAbsolute(filename)) {

View File

@@ -34,7 +34,7 @@ function getNormalizedV8Flag(arg) {
}
getV8Flags(function(err, v8Flags) {
babelArgs.forEach(function(arg) {
babelArgs.forEach(function(arg, index) {
const flag = arg.split("=")[0];
switch (flag) {
@@ -50,6 +50,13 @@ getV8Flags(function(err, v8Flags) {
args.unshift(arg);
break;
case "-r":
case "--require":
args.push(flag);
args.push(babelArgs[index + 1]);
delete babelArgs[index + 1];
break;
case "-gc":
args.unshift("--expose-gc");
break;

View File

@@ -1,13 +1,11 @@
const includes = require("lodash/includes");
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const assert = require("assert");
const rimraf = require("rimraf");
const outputFileSync = require("output-file-sync");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
const chai = require("chai");
const fs = require("fs");
const fixtureLoc = path.join(__dirname, "fixtures");
@@ -53,18 +51,12 @@ const assertTest = function(stdout, stderr, opts) {
if (opts.stderr) {
if (opts.stderrContains) {
assert.ok(
includes(stderr, expectStderr),
"stderr " +
JSON.stringify(stderr) +
" didn't contain " +
JSON.stringify(expectStderr),
);
expect(includes(stderr, expectStderr)).toBeTruthy();
} else {
chai.expect(stderr).to.equal(expectStderr, "stderr didn't match");
expect(stderr).toBe(expectStderr);
}
} else if (stderr) {
throw new Error("stderr:\n" + stderr);
throw new Error("stderr:\n" + stderr + "\n\nstdout:\n" + stdout);
}
const expectStdout = opts.stdout.trim();
@@ -73,15 +65,9 @@ const assertTest = function(stdout, stderr, opts) {
if (opts.stdout) {
if (opts.stdoutContains) {
assert.ok(
includes(stdout, expectStdout),
"stdout " +
JSON.stringify(stdout) +
" didn't contain " +
JSON.stringify(expectStdout),
);
expect(includes(stdout, expectStdout)).toBeTruthy();
} else {
chai.expect(stdout).to.equal(expectStdout, "stdout didn't match");
expect(stdout).toBe(expectStdout);
}
} else if (stdout) {
throw new Error("stdout:\n" + stdout);
@@ -92,24 +78,19 @@ const assertTest = function(stdout, stderr, opts) {
Object.keys(actualFiles).forEach(function(filename) {
if (!opts.inFiles.hasOwnProperty(filename)) {
const expect = opts.outFiles[filename];
const expected = opts.outFiles[filename];
const actual = actualFiles[filename];
chai.expect(expect, "Output is missing: " + filename).to.not.be
.undefined;
expect(expected).not.toBeUndefined();
if (expect) {
chai
.expect(actual)
.to.equal(expect, "Compiled output does not match: " + filename);
if (expected) {
expect(actual).toBe(expected);
}
}
});
Object.keys(opts.outFiles).forEach(function(filename) {
chai
.expect(actualFiles, "Extraneous file in output: " + filename)
.to.contain.key(filename);
expect(actualFiles).toHaveProperty(filename);
});
}
};

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-external-helpers",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "This plugin contains helper functions thatll be placed at the top of the generated code",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers",
"license": "MIT",
@@ -9,13 +9,13 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.42"
"@babel/helper-plugin-utils": "7.0.0-beta.43"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-proposal-async-generator-functions",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "Turn async generator functions into ES2015 generators",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions",
"license": "MIT",
@@ -9,15 +9,15 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.42",
"@babel/helper-remap-async-to-generator": "7.0.0-beta.42",
"@babel/plugin-syntax-async-generators": "7.0.0-beta.42"
"@babel/helper-plugin-utils": "7.0.0-beta.43",
"@babel/helper-remap-async-to-generator": "7.0.0-beta.43",
"@babel/plugin-syntax-async-generators": "7.0.0-beta.43"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -20,5 +20,5 @@ async function main() {
}
return main().then(() => {
assert.deepEqual(actual, expected);
expect(actual).toEqual(expected);
});

View File

@@ -20,5 +20,5 @@ async function main() {
}
return main().then(() => {
assert.deepEqual(actual, expected);
expect(actual).toEqual(expected);
});

View File

@@ -21,6 +21,6 @@ function forEach(ai, fn) {
var output = 0;
return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
assert.equal(output, 42);
expect(output).toBe(42);
});

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-proposal-class-properties",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties",
"license": "MIT",
@@ -9,15 +9,15 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-function-name": "7.0.0-beta.42",
"@babel/helper-plugin-utils": "7.0.0-beta.42",
"@babel/plugin-syntax-class-properties": "7.0.0-beta.42"
"@babel/helper-function-name": "7.0.0-beta.43",
"@babel/helper-plugin-utils": "7.0.0-beta.43",
"@babel/plugin-syntax-class-properties": "7.0.0-beta.43"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -24,15 +24,15 @@ class MyClass {
const inst = new MyClass();
const expectedOrder = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
assert.deepEqual(actualOrder, expectedOrder);
expect(actualOrder).toEqual(expectedOrder);
assert.equal(MyClass[1], 10);
assert.equal(inst[2], 13);
assert.equal(inst[3], "foo");
expect(MyClass[1]).toBe(10);
expect(inst[2]).toBe(13);
expect(inst[3]).toBe("foo");
inst[4] = "baz";
assert.equal(inst.bar, "baz");
assert.equal(inst[5], 14);
assert.equal(MyClass[6], 11);
assert.equal(MyClass[7], 12);
assert.ok(typeof inst[8] === "function");
assert.equal(inst[9], 15);
expect(inst.bar).toBe("baz");
expect(inst[5]).toBe(14);
expect(MyClass[6]).toBe(11);
expect(MyClass[7]).toBe(12);
expect(typeof inst[8]).toBe("function");
expect(inst[9]).toBe(15);

View File

@@ -5,9 +5,9 @@ function test(x) {
}
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -5,9 +5,9 @@ function test(x) {
}
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -12,9 +12,9 @@ function test(x) {
};
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -2,6 +2,6 @@ var Foo = class {
static num = 0;
}
assert.equal(Foo.num, 0);
assert.equal(Foo.num = 1, 1);
assert.equal(Foo.name, "Foo");
expect(Foo.num).toBe(0);
expect(Foo.num = 1).toBe(1);
expect(Foo.name).toBe("Foo");

View File

@@ -2,5 +2,5 @@ class Foo {
static num;
}
assert.equal("num" in Foo, true);
assert.equal(Foo.num, undefined);
expect("num" in Foo).toBe(true);
expect(Foo.num).toBeUndefined();

View File

@@ -3,7 +3,7 @@ class Foo {
static str = "foo";
}
assert.equal(Foo.num, 0);
assert.equal(Foo.num = 1, 1);
assert.equal(Foo.str, "foo");
assert.equal(Foo.str = "bar", "bar");
expect(Foo.num).toBe(0);
expect(Foo.num = 1).toBe(1);
expect(Foo.str).toBe("foo");
expect(Foo.str = "bar").toBe("bar");

View File

@@ -5,9 +5,9 @@ function test(x) {
}
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -5,9 +5,9 @@ function test(x) {
}
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -7,9 +7,9 @@ function test(x) {
};
x = 'deadbeef';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
x = 'wrong';
assert.strictEqual(new F().foo, 1);
expect(new F().foo).toBe(1);
}
test('foo');

View File

@@ -2,6 +2,6 @@ var Foo = class {
static num = 0;
}
assert.equal(Foo.num, 0);
assert.equal(Foo.num = 1, 1);
assert.equal(Foo.name, "Foo");
expect(Foo.num).toBe(0);
expect(Foo.num = 1).toBe(1);
expect(Foo.name).toBe("Foo");

View File

@@ -2,5 +2,5 @@ class Foo {
static num;
}
assert.equal("num" in Foo, true);
assert.equal(Foo.num, undefined);
expect("num" in Foo).toBe(true);
expect(Foo.num).toBeUndefined();

View File

@@ -3,7 +3,7 @@ class Foo {
static str = "foo";
}
assert.equal(Foo.num, 0);
assert.equal(Foo.num = 1, 1);
assert.equal(Foo.str, "foo");
assert.equal(Foo.str = "bar", "bar");
expect(Foo.num).toBe(0);
expect(Foo.num = 1).toBe(1);
expect(Foo.str).toBe("foo");
expect(Foo.str = "bar").toBe("bar");

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-proposal-decorators",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"license": "MIT",
"description": "Compile class and object decorators to ES5",
@@ -12,14 +12,14 @@
"decorators"
],
"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.42",
"@babel/plugin-syntax-decorators": "7.0.0-beta.42"
"@babel/helper-plugin-utils": "7.0.0-beta.43",
"@babel/plugin-syntax-decorators": "7.0.0-beta.43"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/helper-plugin-test-runner": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
}
}

View File

@@ -7,4 +7,4 @@ class Parent {
parent() {};
}
assert.equal(Parent.staticProp, "prop");
expect(Parent.staticProp).toBe("prop");

View File

@@ -9,5 +9,5 @@ class Parent {
parent(){}
}
assert.equal(typeof Parent.prototype.parent, "function")
assert.equal(typeof Parent.prototype.child, "function")
expect(typeof Parent.prototype.parent).toBe("function");
expect(typeof Parent.prototype.child).toBe("function");

View File

@@ -11,4 +11,4 @@ export default class Foo {
}
}
assert.deepEqual(calls, ["Foo"]);
expect(calls).toEqual(["Foo"]);

View File

@@ -25,4 +25,4 @@ class Example {
prop2 = 2;
}
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

View File

@@ -26,4 +26,4 @@ class Example2 {
prop2 = 2;
}
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -58,8 +58,8 @@ class Example {
}
}
assert(Example.prototype.hasOwnProperty('decoratedProps'));
assert.deepEqual(Example.prototype.decoratedProps, [
expect(Example.prototype).toHaveProperty('decoratedProps');
expect(Example.prototype.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -74,42 +74,42 @@ const inst = new Example();
const descs = Object.getOwnPropertyDescriptors(Example.prototype);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._()).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(name, 4);
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe(4);
expect(typeof descriptor).toBe("object");
}
class Example {

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -59,8 +59,8 @@ class Example {
}
assert(Example.prototype.hasOwnProperty('decoratedProps'));
assert.deepEqual(Example.prototype.decoratedProps, [
expect(Example.prototype).toHaveProperty('decoratedProps');
expect(Example.prototype.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -76,42 +76,42 @@ const inst = new Example();
const descs = Object.getOwnPropertyDescriptors(Example.prototype);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._()).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(name, "str");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe("str");
expect(typeof descriptor).toBe("object");
}
class Example {

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor){
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -23,5 +23,5 @@ class Example extends Base {
let inst = new Example();
assert.equal(inst.prop, "__3__");
assert.equal(inst.prop2, "__4__");
expect(inst.prop).toBe("__3__");
expect(inst.prop2).toBe("__4__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -44,8 +44,8 @@ class Example {
const inst = new Example();
assert(Example.prototype.hasOwnProperty("decoratedProps"));
assert.deepEqual(inst.decoratedProps, [
expect(Example.prototype).toHaveProperty("decoratedProps");
expect(inst.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -58,42 +58,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite, "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf, "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite, "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum, "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite, "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf, "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write, "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._, "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor){
assert(target);
assert.equal(name, "prop");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe("prop");
expect(typeof descriptor).toBe("object");
let {initializer} = descriptor;
delete descriptor.initializer;
@@ -24,4 +24,4 @@ class Example {
let inst = new Example();
assert.equal(inst.prop, "__3__");
expect(inst.prop).toBe("__3__");

View File

@@ -7,5 +7,5 @@ class Example {
}
let inst = new Example();
assert(inst.hasOwnProperty("prop"));
assert.equal(inst.prop, undefined);
expect(inst).toHaveProperty("prop");
expect(inst.prop).toBeUndefined();

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -44,8 +44,8 @@ class Example {
const inst = new Example();
assert(Example.prototype.hasOwnProperty("decoratedProps"));
assert.deepEqual(inst.decoratedProps, [
expect(Example.prototype).toHaveProperty("decoratedProps");
expect(inst.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -58,42 +58,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite, "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf, "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite, "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum, "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite, "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf, "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write, "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._, "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -58,8 +58,8 @@ class Example {
}
}
assert(Example.hasOwnProperty("decoratedProps"));
assert.deepEqual(Example.decoratedProps, [
expect(Example).toHaveProperty("decoratedProps");
expect(Example.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -72,42 +72,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(Example.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(Example.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(Example.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(Example.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(Example.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(Example.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(Example.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(Example.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(Example.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(Example.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(Example.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(Example.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(Example.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(Example.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(Example._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(Example._()).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor){
assert(target);
assert.equal(name, 4);
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe(4);
expect(typeof descriptor).toBe("object");
}
class Example {

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -59,8 +59,8 @@ class Example {
}
assert(Example.hasOwnProperty("decoratedProps"));
assert.deepEqual(Example.decoratedProps, [
expect(Example).toHaveProperty("decoratedProps");
expect(Example.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -73,42 +73,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(Example.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(Example.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(Example.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(Example.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(Example.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(Example.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(Example.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(Example.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(Example.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable);
expect(Example.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(Example.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(Example.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(Example.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(Example.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(Example._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(Example._()).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(name, "str");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe("str");
expect(typeof descriptor).toBe("object");
}
class Example {

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -44,8 +44,8 @@ class Example {
const inst = new Example();
assert(Example.hasOwnProperty("decoratedProps"));
assert.deepEqual(Example.decoratedProps, [
expect(Example).toHaveProperty("decoratedProps");
expect(Example.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -58,42 +58,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(Example.enumconfwrite, "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(Example.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(Example.enumconf, "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(Example.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(Example.enumwrite, "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(Example.enumwrite).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(Example.enum, "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(Example.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(Example.confwrite, "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(Example.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(Example.conf, "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(Example.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(Example.write, "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(Example.write).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(Example._, "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(Example._).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor){
assert(target);
assert.equal(name, "prop");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe("prop");
expect(typeof descriptor).toBe("object");
let {initializer} = descriptor;
delete descriptor.initializer;
@@ -22,4 +22,4 @@ class Example {
static prop = 3;
}
assert.equal(Example.prop, "__3__");
expect(Example.prop).toBe("__3__");

View File

@@ -6,5 +6,5 @@ class Example {
@dec static prop;
}
assert(Example.hasOwnProperty("prop"));
assert.equal(Example.prop, undefined);
expect(Example).toHaveProperty("prop");
expect(Example.prop).toBe(undefined);

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -44,8 +44,8 @@ class Example {
const inst = new Example();
assert(Example.hasOwnProperty("decoratedProps"));
assert.deepEqual(Example.decoratedProps, [
expect(Example).toHaveProperty("decoratedProps");
expect(Example.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -58,42 +58,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(Example.enumconfwrite, "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(Example.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(Example.enumconf, "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(Example.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(Example.enumwrite, "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(Example.enumwrite).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(Example.enum, "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(Example.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(Example.confwrite, "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(Example.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(Example.conf, "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable);
expect(Example.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(Example.write, "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(Example.write).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(Example._, "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(Example._).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -58,8 +58,8 @@ const inst = {
},
}
assert(inst.hasOwnProperty('decoratedProps'));
assert.deepEqual(inst.decoratedProps, [
expect(inst).toHaveProperty('decoratedProps');
expect(inst.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -72,42 +72,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable);
expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._()).toBe("__8__");

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor){
assert(target);
assert.equal(name, 4);
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(name).toBe(4);
expect(typeof descriptor).toBe("object");
}
const inst = {

View File

@@ -1,7 +1,7 @@
function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
expect(target).toBeTruthy();
expect(typeof name).toBe("string");
expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
@@ -58,8 +58,8 @@ const inst = {
},
}
assert(inst.hasOwnProperty('decoratedProps'));
assert.deepEqual(inst.decoratedProps, [
expect(inst).toHaveProperty('decoratedProps');
expect(inst.decoratedProps).toEqual([
"enumconfwrite",
"enumconf",
"enumwrite",
@@ -72,42 +72,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable);
assert(descs.enumconfwrite.writable);
assert(descs.enumconfwrite.configurable);
assert.equal(inst.enumconfwrite(), "__1__");
expect(descs.enumconfwrite.enumerable).toBeTruthy();
expect(descs.enumconfwrite.writable).toBeTruthy();
expect(descs.enumconfwrite.configurable).toBeTruthy();
expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable);
assert.equal(descs.enumconf.writable, false);
assert(descs.enumconf.configurable);
assert.equal(inst.enumconf(), "__2__");
expect(descs.enumconf.enumerable).toBeTruthy();
expect(descs.enumconf.writable).toBe(false);
expect(descs.enumconf.configurable).toBeTruthy();
expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable);
assert(descs.enumwrite.writable);
assert.equal(descs.enumwrite.configurable, false);
assert.equal(inst.enumwrite(), "__3__");
expect(descs.enumwrite.enumerable).toBeTruthy();
expect(descs.enumwrite.writable).toBeTruthy();
expect(descs.enumwrite.configurable).toBe(false);
expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable);
assert.equal(descs.enum.writable, false);
assert.equal(descs.enum.configurable, false);
assert.equal(inst.enum(), "__4__");
expect(descs.enum.enumerable).toBeTruthy();
expect(descs.enum.writable).toBe(false);
expect(descs.enum.configurable).toBe(false);
expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false);
assert(descs.confwrite.writable);
assert(descs.confwrite.configurable);
assert.equal(inst.confwrite(), "__5__");
expect(descs.confwrite.enumerable).toBe(false);
expect(descs.confwrite.writable).toBeTruthy();
expect(descs.confwrite.configurable).toBeTruthy();
expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false);
assert.equal(descs.conf.writable, false);
assert(descs.conf.configurable);
assert.equal(inst.conf(), "__6__");
expect(descs.conf.enumerable).toBe(false);
expect(descs.conf.writable).toBe(false);
expect(descs.conf.configurable).toBeTruthy();
expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false);
assert(descs.write.writable);
assert.equal(descs.write.configurable, false);
assert.equal(inst.write(), "__7__");
expect(descs.write.enumerable).toBe(false);
expect(descs.write.writable).toBeTruthy();
expect(descs.write.configurable).toBe(false);
expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false);
assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._(), "__8__");
expect(descs._.enumerable).toBe(false);
expect(descs._.writable).toBe(false);
expect(descs._.configurable).toBe(false);
expect(inst._()).toBe("__8__");

Some files were not shown because too many files have changed in this diff Show More