merge Master on saga
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
SERVER_URL=http://localhost:3000
|
||||
MONGO_URI=mongodb://declic:declic42@ds115653.mlab.com:15653/next-auth
|
||||
FACEBOOK_ID=2332071840142634
|
||||
FACEBOOK_SECRET=afb8bbca72bd8c517c64f81e998e4f12
|
||||
LINKEDIN_ID=77k1m8qx7w6ygj
|
||||
LINKEDIN_SECRET=mbcnVjyy2vqAZz1B
|
||||
EMAIL_FROM=noreply@talentstube.com
|
||||
EMAIL_SERVER=mail.gandi.net
|
||||
EMAIL_PORT=465
|
||||
EMAIL_SECURE=true
|
||||
EMAIL_USERNAME=noreply@talentstube.com
|
||||
EMAIL_PASSWORD=zfYwOGBHweCQ8OI9ghF6lUyo
|
||||
@@ -1,2 +1 @@
|
||||
/.next
|
||||
/node_modules/
|
||||
Vendored
+5
-21
@@ -1,31 +1,15 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Chrome",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Next: Chrome",
|
||||
"url": "http://localhost:3000",
|
||||
"webRoot": "${workspaceFolder}/nextjs/"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Next: Node",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
|
||||
"runtimeArgs": [
|
||||
"--inspect"
|
||||
],
|
||||
"port": 9229,
|
||||
"console": "integratedTerminal",
|
||||
|
||||
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Next: Full",
|
||||
"configurations": ["Next: Node", "Next: Chrome"]
|
||||
"webRoot": "${workspaceRoot}"
|
||||
}
|
||||
]
|
||||
}
|
||||
+6
-1
@@ -2,11 +2,16 @@
|
||||
|
||||
## How to use
|
||||
|
||||
Download the example [or clone the repo](https://github.com/mui-org/material-ui):
|
||||
|
||||
```bash
|
||||
git clone
|
||||
```
|
||||
|
||||
Install it and run:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
yarn build
|
||||
yarn dev
|
||||
```
|
||||
|
||||
|
||||
@@ -1,58 +1,139 @@
|
||||
import React from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import Router from 'next/router'
|
||||
import getConfig from 'next/config'
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import Avatar from '@material-ui/core/Avatar';
|
||||
import Card from '@material-ui/core/Card';
|
||||
import Chip from '@material-ui/core/Chip';
|
||||
import CardContent from '@material-ui/core/CardContent';
|
||||
import CardHeader from '@material-ui/core/CardHeader';
|
||||
import CardMedia from '@material-ui/core/CardMedia';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
|
||||
import { Button } from '@material-ui/core';
|
||||
|
||||
const styles = theme => ({
|
||||
card: {
|
||||
display: 'flex',
|
||||
position: 'relative',
|
||||
height: '50vh',
|
||||
width: '100%',
|
||||
|
||||
[theme.breakpoints.up('md')]: {
|
||||
width : '30%',
|
||||
},
|
||||
details: {
|
||||
[theme.breakpoints.down('md')]: {
|
||||
width : '40%',
|
||||
},
|
||||
[theme.breakpoints.down('xs')]: {
|
||||
width : '100%',
|
||||
},
|
||||
|
||||
margin: '1vh 2vh 1vh 2vh',
|
||||
[theme.breakpoints.up('sm')]: {
|
||||
margin: '1vh 0 1vh 0',
|
||||
},
|
||||
borderRadius: 0
|
||||
},
|
||||
details_container: {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
padding: '8vh 0 0 0',
|
||||
},
|
||||
company_title: {
|
||||
fontSize: '1em',
|
||||
fontWeight: 'normal',
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
content: {
|
||||
flex: '1 0 auto',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
flexWrap: 'wrap',
|
||||
width: '100%',
|
||||
padding: 0,
|
||||
},
|
||||
cover: {
|
||||
width: 151,
|
||||
height: 151,
|
||||
width: '100%',
|
||||
height: '50%',
|
||||
backgroundSize: 'cover',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
},
|
||||
logo_container: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
width: 100,
|
||||
height: 100,
|
||||
position: 'absolute',
|
||||
left: '50%',
|
||||
top: '50%',
|
||||
transform: 'translate(-50%, -66%)',
|
||||
backgroundColor: 'white',
|
||||
boxShadow: '0 8px 6px -6px grey',
|
||||
},
|
||||
logo: {
|
||||
width: '100%',
|
||||
height: 'auto',
|
||||
objectfit: 'contain',
|
||||
borderRadius: 0,
|
||||
},
|
||||
chip: {
|
||||
margin: '0 1vh 0 1vh',
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const { publicRuntimeConfig } = getConfig()
|
||||
class OffreRowComponent extends React.Component {
|
||||
|
||||
render() {
|
||||
|
||||
const { classes, theme, rowData } = this.props;
|
||||
|
||||
const imgDefaultUrl = "https://www.talentstube.com/img/default_picture_company.svg"
|
||||
|
||||
const imgUrl = (rowData.video.thumbnails[0] && rowData.video.thumbnails[0].sizes[4]) ? rowData.video.thumbnails[0].sizes[4].link : imgDefaultUrl
|
||||
|
||||
|
||||
const logoUrl = publicRuntimeConfig.logoUrl + rowData.company.logo
|
||||
//rowData._embedded.company.business_name
|
||||
return (
|
||||
<Card onClick={() => Router.push(`/Offre/${rowData.id}`)}>
|
||||
<CardHeader />
|
||||
<CardContent>
|
||||
|
||||
<Card className={classes.card} onClick={() => Router.push(`/Offre?id=${rowData.id}`)}>
|
||||
<CardContent className={classes.content}>
|
||||
<CardMedia
|
||||
className={classes.cover}
|
||||
image={imgUrl}
|
||||
title={rowData.title}
|
||||
/>
|
||||
<Typography gutterBottom component="h3"
|
||||
className={classes.details}>
|
||||
{rowData.title}
|
||||
</Typography>
|
||||
<Typography gutterBottom component="h4"
|
||||
className={classes.details}>
|
||||
|
||||
<div className={classes.logo_container}>
|
||||
<Avatar className={classes.logo} src={logoUrl} />
|
||||
</div>
|
||||
|
||||
<div className={classes.details_container}>
|
||||
<Typography
|
||||
gutterBottom
|
||||
variant="headline"
|
||||
variant="h6"
|
||||
component="h4"
|
||||
align="center"
|
||||
className={classes.company_title}>
|
||||
{rowData.company.business_name}
|
||||
</Typography>
|
||||
<Typography
|
||||
gutterBottom
|
||||
variant="headline"
|
||||
variant="h6"
|
||||
component="h3"
|
||||
align="center"
|
||||
className={classes.job_title}>
|
||||
{rowData.title}
|
||||
</Typography>
|
||||
</div>
|
||||
<div>
|
||||
<Chip label={rowData.extra.contract_type} className={classes.chip} />
|
||||
<Chip label={rowData.location.gmap_address.address_components[0].long_name} className={classes.chip} />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -10,6 +10,7 @@ import GriddleCustomTable from "../organisms/GriddleCustomTableComponent";
|
||||
//
|
||||
//https://codesandbox.io/s/pw9zy43v1m?module=%2FGrid.js
|
||||
|
||||
|
||||
const CustomTableBody = ({ rowIds, Row, style, className }) => (
|
||||
<div style={style} className={className}>
|
||||
{rowIds && rowIds.valueSeq().map(r => <Row key={r} griddleKey={r} />)}
|
||||
@@ -66,6 +67,12 @@ class Grid extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const style = {
|
||||
styles: {
|
||||
TableBody: { display: "flex", flexWrap: "wrap", justifyContent: "space-around"},
|
||||
}
|
||||
}
|
||||
|
||||
const { data, currentPage, pageSize, recordCount } = this.state;
|
||||
// console.debug("-- render -- ")
|
||||
// console.debug(data)
|
||||
@@ -95,6 +102,7 @@ class Grid extends Component {
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<div>
|
||||
<Griddle
|
||||
data={data}
|
||||
@@ -115,6 +123,7 @@ class Grid extends Component {
|
||||
onGetPage: this._onGetPage,
|
||||
onFilter: this._onFilter
|
||||
}}
|
||||
styleConfig={style}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import Header from '../organisms/Header'
|
||||
import Footer from '../organisms/Footer'
|
||||
import Header from './Header'
|
||||
import Footer from './Footer'
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import Header from '../organisms/Header'
|
||||
import Header from './Header'
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
$ionicons-font-path: "/fonts/ionicons" !default;
|
||||
$ionicons-font-family: "Ionicons" !default;
|
||||
$ionicons-version: "3.0.0-alpha.3" !default;
|
||||
@import "../node_modules/ionicons/dist/scss/ionicons";
|
||||
@import "../node_modules/bootstrap/scss/bootstrap.scss";
|
||||
@import "../node_modules/react-bootstrap-table/dist/react-bootstrap-table-all.min";
|
||||
@import "nojs-menus.scss";
|
||||
|
||||
.lead {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #333;
|
||||
border-color: #333;
|
||||
color: #eee;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.navbar,
|
||||
.navbar .btn,
|
||||
.navbar .dropdown-item,
|
||||
.navbar button {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.display-2 {
|
||||
font-size: 3em;
|
||||
}
|
||||
.display-3 {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
.display-4 {
|
||||
font-size: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-spin {
|
||||
display: inline-block;
|
||||
animation: spin 1s infinite linear;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a fix for Reactstrap 5.0.0-alpha.4 not displaying menus in the
|
||||
* navbar correcrtly on mobile devices.
|
||||
**/
|
||||
.navbar .dropdown {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.navbar .dropdown-menu {
|
||||
position: relative !important;
|
||||
display: block !important;
|
||||
transform: none !important;
|
||||
padding: 0 0 10px 0;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix for Reactstrap
|
||||
**/
|
||||
.react-bs-table-sizePerPage-dropdown .dropdown-item a {
|
||||
display: block;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.react-bs-table-sizePerPage-dropdown button {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* Pure CSS .nojs-dropdown & .nojs-navbar classes for Boostrap menus .
|
||||
*
|
||||
* @FIXME: While this works well for browsers without JavaScript, there are
|
||||
* accessibility issues for keyboard access and screen readers with this
|
||||
* implementation.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Add ".nojs-dropdown" class to any Bootstrap ".dropdown" for a pure CSS menu.
|
||||
* Note: Do not also add JavaScript to the dropdown.
|
||||
**/
|
||||
.nojs-dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
}
|
||||
.nojs-dropdown .dropdown-toggle {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nojs-dropdown .dropdown-menu {
|
||||
position: absolute !important;
|
||||
z-index: 1000 !important;
|
||||
display: block;
|
||||
visibility: hidden !important;
|
||||
transition: visibility 0.5s !important;
|
||||
}
|
||||
.nojs-dropdown:focus .dropdown-menu {
|
||||
visibility: visible !important;
|
||||
transition: opacity 0.1s !important;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nojs-dropdown .dropdown-menu {
|
||||
top: 0px;
|
||||
visibility: visible !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* For right-align menus (automatic and override with .nojs-dropdown-right) */
|
||||
.nojs-dropdown.pull-right .dropdown-menu,
|
||||
.ml-auto .nojs-dropdown .dropdown-menu,
|
||||
.nojs-dropdown.nojs-dropdown-right .dropdown-menu {
|
||||
left: auto !important;
|
||||
right: 0px !important;
|
||||
}
|
||||
|
||||
/* Override default to left-align menus by adding .nojs-dropdown-left */
|
||||
.nojs-dropdown.nojs-dropdown-left .dropdown-menu {
|
||||
left: 0px !important;
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* .nojs-navbar navigation menu
|
||||
*
|
||||
* To use, add the following inside your navbar:
|
||||
*
|
||||
* <input class="nojs-navbar-check" id="nojs-navbar-check" type="checkbox" aria-label="Menu"/>
|
||||
* <label tabindex="1" htmlFor="nojs-navbar-check" class="nojs-navbar-label" />
|
||||
* <div class="nojs-navbar"> <!-- Add your Navbar Menu --> </div>
|
||||
**/
|
||||
.nojs-navbar {
|
||||
display: flex;
|
||||
flex-basis: auto;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.nojs-navbar-label {
|
||||
display: none;
|
||||
}
|
||||
.nojs-navbar-check {
|
||||
display: none;
|
||||
}
|
||||
.nojs-navbar-check:checked ~ .nojs-navbar-label {
|
||||
border-bottom: 3px solid transparent;
|
||||
transition: border-bottom 0.8s ease-in-out;
|
||||
|
||||
&:before {
|
||||
transform: rotate(-405deg) translateY(0px) translateX(-1px);
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
&:after {
|
||||
transform: rotate(405deg) translateY(-5px) translateX(-6px);
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
}
|
||||
.nojs-navbar-check:checked ~ .nojs-navbar {
|
||||
max-height: 1000px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nojs-navbar {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 0px;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.5s ease-in-out !important;
|
||||
}
|
||||
.nojs-navbar-label {
|
||||
$width: 28px;
|
||||
|
||||
display: inline-block;
|
||||
outline: 0;
|
||||
cursor: pointer;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: $width;
|
||||
transition: border-bottom 1s ease-in-out;
|
||||
|
||||
&::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
display: block;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -6,10 +6,10 @@ case `uname` in
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../babel-generator/node_modules/jsesc/bin/jsesc" "$@"
|
||||
"$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../babel-generator/node_modules/jsesc/bin/jsesc" "$@"
|
||||
node "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\babel-generator\node_modules\jsesc\bin\jsesc" %*
|
||||
"%~dp0\node.exe" "%~dp0\..\jsesc\bin\jsesc" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\babel-generator\node_modules\jsesc\bin\jsesc" %*
|
||||
node "%~dp0\..\jsesc\bin\jsesc" %*
|
||||
)
|
||||
+112
-213
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ function buildRootChain(opts, context) {
|
||||
({
|
||||
ignore: ignoreFile,
|
||||
config: babelrcFile
|
||||
} = (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller));
|
||||
} = (0, _files.findRelativeConfig)(pkgData, context.envName));
|
||||
|
||||
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
|
||||
return null;
|
||||
@@ -338,7 +338,7 @@ function normalizeOptions(opts) {
|
||||
delete options.include;
|
||||
delete options.exclude;
|
||||
|
||||
if (options.hasOwnProperty("sourceMap")) {
|
||||
if (options.sourceMap) {
|
||||
options.sourceMaps = options.sourceMap;
|
||||
delete options.sourceMap;
|
||||
}
|
||||
|
||||
-18
@@ -3,7 +3,6 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findConfigUpwards = findConfigUpwards;
|
||||
exports.findRelativeConfig = findRelativeConfig;
|
||||
exports.findRootConfig = findRootConfig;
|
||||
exports.loadConfig = loadConfig;
|
||||
@@ -74,23 +73,6 @@ const BABELRC_FILENAME = ".babelrc";
|
||||
const BABELRC_JS_FILENAME = ".babelrc.js";
|
||||
const BABELIGNORE_FILENAME = ".babelignore";
|
||||
|
||||
function findConfigUpwards(rootDir) {
|
||||
let dirname = rootDir;
|
||||
|
||||
while (true) {
|
||||
if (_fs().default.existsSync(_path().default.join(dirname, BABEL_CONFIG_JS_FILENAME))) {
|
||||
return dirname;
|
||||
}
|
||||
|
||||
const nextDir = _path().default.dirname(dirname);
|
||||
|
||||
if (dirname === nextDir) break;
|
||||
dirname = nextDir;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function findRelativeConfig(packageData, envName, caller) {
|
||||
let config = null;
|
||||
let ignore = null;
|
||||
|
||||
-5
@@ -3,7 +3,6 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findConfigUpwards = findConfigUpwards;
|
||||
exports.findPackageData = findPackageData;
|
||||
exports.findRelativeConfig = findRelativeConfig;
|
||||
exports.findRootConfig = findRootConfig;
|
||||
@@ -13,10 +12,6 @@ exports.resolvePreset = resolvePreset;
|
||||
exports.loadPlugin = loadPlugin;
|
||||
exports.loadPreset = loadPreset;
|
||||
|
||||
function findConfigUpwards(rootDir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function findPackageData(filepath) {
|
||||
return {
|
||||
filepath,
|
||||
|
||||
-6
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "findPackageData", {
|
||||
return _package.findPackageData;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findConfigUpwards", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.findConfigUpwards;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findRelativeConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
|
||||
+2
-30
@@ -28,36 +28,8 @@ var _environment = require("./helpers/environment");
|
||||
|
||||
var _options = require("./validation/options");
|
||||
|
||||
var _files = require("./files");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function resolveRootMode(rootDir, rootMode) {
|
||||
switch (rootMode) {
|
||||
case "root":
|
||||
return rootDir;
|
||||
|
||||
case "upward-optional":
|
||||
{
|
||||
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
|
||||
return upwardRootDir === null ? rootDir : upwardRootDir;
|
||||
}
|
||||
|
||||
case "upward":
|
||||
{
|
||||
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
|
||||
if (upwardRootDir !== null) return upwardRootDir;
|
||||
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}"`), {
|
||||
code: "BABEL_ROOT_NOT_FOUND",
|
||||
dirname: rootDir
|
||||
});
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error(`Assertion failure - unknown rootMode value`);
|
||||
}
|
||||
}
|
||||
|
||||
function loadPrivatePartialConfig(inputOpts) {
|
||||
if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
|
||||
throw new Error("Babel options must be an object, null, or undefined");
|
||||
@@ -68,13 +40,13 @@ function loadPrivatePartialConfig(inputOpts) {
|
||||
envName = (0, _environment.getEnv)(),
|
||||
cwd = ".",
|
||||
root: rootDir = ".",
|
||||
rootMode = "root",
|
||||
caller
|
||||
} = args;
|
||||
|
||||
const absoluteCwd = _path().default.resolve(cwd);
|
||||
|
||||
const absoluteRootDir = resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode);
|
||||
const absoluteRootDir = _path().default.resolve(absoluteCwd, rootDir);
|
||||
|
||||
const context = {
|
||||
filename: typeof args.filename === "string" ? _path().default.resolve(cwd, args.filename) : undefined,
|
||||
cwd: absoluteCwd,
|
||||
|
||||
-9
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.msg = msg;
|
||||
exports.access = access;
|
||||
exports.assertRootMode = assertRootMode;
|
||||
exports.assertSourceMaps = assertSourceMaps;
|
||||
exports.assertCompact = assertCompact;
|
||||
exports.assertSourceType = assertSourceType;
|
||||
@@ -52,14 +51,6 @@ function access(loc, name) {
|
||||
};
|
||||
}
|
||||
|
||||
function assertRootMode(loc, value) {
|
||||
if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
|
||||
throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function assertSourceMaps(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
|
||||
throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
const ROOT_VALIDATORS = {
|
||||
cwd: _optionAssertions.assertString,
|
||||
root: _optionAssertions.assertString,
|
||||
rootMode: _optionAssertions.assertRootMode,
|
||||
configFile: _optionAssertions.assertConfigFileSearch,
|
||||
caller: _optionAssertions.assertCallerMetadata,
|
||||
filename: _optionAssertions.assertString,
|
||||
|
||||
+1
-3
@@ -183,9 +183,7 @@ class File {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof versionRange !== "string") return true;
|
||||
if (_semver().default.valid(versionRange)) versionRange = `^${versionRange}`;
|
||||
return !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);
|
||||
return typeof versionRange !== "string" || !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);
|
||||
}
|
||||
|
||||
addHelper(name) {
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ function mergeSourceMap(inputMap, map) {
|
||||
}
|
||||
|
||||
function makeMappingKey(item) {
|
||||
return `${item.line}/${item.columnStart}`;
|
||||
return JSON.stringify([item.line, item.columnStart]);
|
||||
}
|
||||
|
||||
function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {
|
||||
|
||||
+7
-10
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.1.2",
|
||||
"version": "7.0.0",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-core",
|
||||
"keywords": [
|
||||
"6to5",
|
||||
@@ -34,12 +31,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/generator": "^7.1.2",
|
||||
"@babel/helpers": "^7.1.2",
|
||||
"@babel/parser": "^7.1.2",
|
||||
"@babel/template": "^7.1.2",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.1.2",
|
||||
"@babel/generator": "^7.0.0",
|
||||
"@babel/helpers": "^7.0.0",
|
||||
"@babel/parser": "^7.0.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@babel/traverse": "^7.0.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"json5": "^0.5.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+8
-36
@@ -8,9 +8,15 @@ exports.Program = Program;
|
||||
exports.BlockStatement = BlockStatement;
|
||||
exports.Noop = Noop;
|
||||
exports.Directive = Directive;
|
||||
exports.DirectiveLiteral = DirectiveLiteral;
|
||||
exports.InterpreterDirective = InterpreterDirective;
|
||||
exports.Placeholder = Placeholder;
|
||||
Object.defineProperty(exports, "DirectiveLiteral", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types.StringLiteral;
|
||||
}
|
||||
});
|
||||
|
||||
var _types = require("./types");
|
||||
|
||||
function File(node) {
|
||||
if (node.program) {
|
||||
@@ -58,40 +64,6 @@ function Directive(node) {
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
|
||||
function DirectiveLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (raw != null) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
value
|
||||
} = node;
|
||||
|
||||
if (!unescapedDoubleQuoteRE.test(value)) {
|
||||
this.token(`"${value}"`);
|
||||
} else if (!unescapedSingleQuoteRE.test(value)) {
|
||||
this.token(`'${value}'`);
|
||||
} else {
|
||||
throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
|
||||
}
|
||||
}
|
||||
|
||||
function InterpreterDirective(node) {
|
||||
this.token(`#!${node.value}\n`);
|
||||
}
|
||||
|
||||
function Placeholder(node) {
|
||||
this.token("%%");
|
||||
this.print(node.name);
|
||||
this.token("%%");
|
||||
|
||||
if (node.expectedNode === "Statement") {
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
-8
@@ -8,7 +8,6 @@ exports.ClassBody = ClassBody;
|
||||
exports.ClassProperty = ClassProperty;
|
||||
exports.ClassPrivateProperty = ClassPrivateProperty;
|
||||
exports.ClassMethod = ClassMethod;
|
||||
exports.ClassPrivateMethod = ClassPrivateMethod;
|
||||
exports._classMethodHead = _classMethodHead;
|
||||
|
||||
function t() {
|
||||
@@ -161,13 +160,6 @@ function ClassMethod(node) {
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function ClassPrivateMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function _classMethodHead(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ var n = _interopRequireWildcard(require("../node"));
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function UnaryExpression(node) {
|
||||
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
|
||||
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {
|
||||
this.word(node.operator);
|
||||
this.space();
|
||||
} else {
|
||||
|
||||
-16
@@ -133,23 +133,7 @@ function ArrowFunctionExpression(node) {
|
||||
const firstParam = node.params[0];
|
||||
|
||||
if (node.params.length === 1 && t().isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
|
||||
if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
|
||||
this.token("(");
|
||||
|
||||
if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
|
||||
this.indent();
|
||||
this.print(firstParam, node);
|
||||
this.dedent();
|
||||
|
||||
this._catchUp("start", node.body.loc);
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
|
||||
this.token(")");
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
} else {
|
||||
this._params(node);
|
||||
}
|
||||
|
||||
-20
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Identifier = Identifier;
|
||||
exports.ArgumentPlaceholder = ArgumentPlaceholder;
|
||||
exports.SpreadElement = exports.RestElement = RestElement;
|
||||
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
|
||||
exports.ObjectMethod = ObjectMethod;
|
||||
@@ -16,9 +15,6 @@ exports.NullLiteral = NullLiteral;
|
||||
exports.NumericLiteral = NumericLiteral;
|
||||
exports.StringLiteral = StringLiteral;
|
||||
exports.BigIntLiteral = BigIntLiteral;
|
||||
exports.PipelineTopicExpression = PipelineTopicExpression;
|
||||
exports.PipelineBareFunction = PipelineBareFunction;
|
||||
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
@@ -50,10 +46,6 @@ function Identifier(node) {
|
||||
});
|
||||
}
|
||||
|
||||
function ArgumentPlaceholder() {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function RestElement(node) {
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
@@ -184,15 +176,3 @@ function BigIntLiteral(node) {
|
||||
|
||||
this.token(node.value);
|
||||
}
|
||||
|
||||
function PipelineTopicExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
}
|
||||
|
||||
function PipelineBareFunction(node) {
|
||||
this.print(node.callee, node);
|
||||
}
|
||||
|
||||
function PipelinePrimaryTopicReference() {
|
||||
this.token("#");
|
||||
}
|
||||
+1
-40
@@ -17,7 +17,6 @@ exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
||||
exports.TSMethodSignature = TSMethodSignature;
|
||||
exports.TSIndexSignature = TSIndexSignature;
|
||||
exports.TSAnyKeyword = TSAnyKeyword;
|
||||
exports.TSUnknownKeyword = TSUnknownKeyword;
|
||||
exports.TSNumberKeyword = TSNumberKeyword;
|
||||
exports.TSObjectKeyword = TSObjectKeyword;
|
||||
exports.TSBooleanKeyword = TSBooleanKeyword;
|
||||
@@ -39,8 +38,6 @@ exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
|
||||
exports.tsPrintBraced = tsPrintBraced;
|
||||
exports.TSArrayType = TSArrayType;
|
||||
exports.TSTupleType = TSTupleType;
|
||||
exports.TSOptionalType = TSOptionalType;
|
||||
exports.TSRestType = TSRestType;
|
||||
exports.TSUnionType = TSUnionType;
|
||||
exports.TSIntersectionType = TSIntersectionType;
|
||||
exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
|
||||
@@ -61,7 +58,6 @@ exports.TSEnumDeclaration = TSEnumDeclaration;
|
||||
exports.TSEnumMember = TSEnumMember;
|
||||
exports.TSModuleDeclaration = TSModuleDeclaration;
|
||||
exports.TSModuleBlock = TSModuleBlock;
|
||||
exports.TSImportType = TSImportType;
|
||||
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
|
||||
exports.TSExternalModuleReference = TSExternalModuleReference;
|
||||
exports.TSNonNullExpression = TSNonNullExpression;
|
||||
@@ -216,10 +212,6 @@ function TSAnyKeyword() {
|
||||
this.word("any");
|
||||
}
|
||||
|
||||
function TSUnknownKeyword() {
|
||||
this.word("unknown");
|
||||
}
|
||||
|
||||
function TSNumberKeyword() {
|
||||
this.word("number");
|
||||
}
|
||||
@@ -334,7 +326,7 @@ function tsPrintBraced(members, node) {
|
||||
}
|
||||
|
||||
function TSArrayType(node) {
|
||||
this.print(node.elementType, node);
|
||||
this.print(node.elementType);
|
||||
this.token("[]");
|
||||
}
|
||||
|
||||
@@ -344,16 +336,6 @@ function TSTupleType(node) {
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function TSOptionalType(node) {
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function TSRestType(node) {
|
||||
this.token("...");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSUnionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "|");
|
||||
}
|
||||
@@ -627,27 +609,6 @@ function TSModuleBlock(node) {
|
||||
this.tsPrintBraced(node.body, node);
|
||||
}
|
||||
|
||||
function TSImportType(node) {
|
||||
const {
|
||||
argument,
|
||||
qualifier,
|
||||
typeParameters
|
||||
} = node;
|
||||
this.word("import");
|
||||
this.token("(");
|
||||
this.print(argument, node);
|
||||
this.token(")");
|
||||
|
||||
if (qualifier) {
|
||||
this.token(".");
|
||||
this.print(qualifier, node);
|
||||
}
|
||||
|
||||
if (typeParameters) {
|
||||
this.print(typeParameters, node);
|
||||
}
|
||||
}
|
||||
|
||||
function TSImportEqualsDeclaration(node) {
|
||||
const {
|
||||
isExport,
|
||||
|
||||
+3
-18
@@ -3,8 +3,7 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.ObjectExpression = ObjectExpression;
|
||||
exports.DoExpression = DoExpression;
|
||||
@@ -12,7 +11,6 @@ exports.Binary = Binary;
|
||||
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
|
||||
exports.BinaryExpression = BinaryExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
||||
@@ -21,7 +19,6 @@ exports.UnaryLike = UnaryLike;
|
||||
exports.FunctionExpression = FunctionExpression;
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
|
||||
@@ -70,10 +67,6 @@ function NullableTypeAnnotation(node, parent) {
|
||||
return t().isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function FunctionTypeAnnotation(node, parent) {
|
||||
return t().isUnionTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function UpdateExpression(node, parent) {
|
||||
return t().isMemberExpression(parent, {
|
||||
object: node
|
||||
@@ -135,10 +128,6 @@ function TSTypeAssertion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TSUnionType(node, parent) {
|
||||
return t().isTSArrayType(parent) || t().isTSOptionalType(parent) || t().isTSIntersectionType(parent) || t().isTSUnionType(parent) || t().isTSRestType(parent);
|
||||
}
|
||||
|
||||
function BinaryExpression(node, parent) {
|
||||
return node.operator === "in" && (t().isVariableDeclarator(parent) || t().isFor(parent));
|
||||
}
|
||||
@@ -152,7 +141,7 @@ function SequenceExpression(node, parent) {
|
||||
}
|
||||
|
||||
function YieldExpression(node, parent) {
|
||||
return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isAwaitExpression(parent) && t().isYieldExpression(node) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
}
|
||||
|
||||
function ClassExpression(node, parent, printStack) {
|
||||
@@ -187,17 +176,13 @@ function ArrowFunctionExpression(node, parent) {
|
||||
function ConditionalExpression(node, parent) {
|
||||
if (t().isUnaryLike(parent) || t().isBinary(parent) || t().isConditionalExpression(parent, {
|
||||
test: node
|
||||
}) || t().isAwaitExpression(parent) || t().isOptionalMemberExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) {
|
||||
}) || t().isAwaitExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return UnaryLike(node, parent);
|
||||
}
|
||||
|
||||
function OptionalMemberExpression(node, parent) {
|
||||
return t().isCallExpression(parent) || t().isMemberExpression(parent);
|
||||
}
|
||||
|
||||
function AssignmentExpression(node) {
|
||||
if (t().isObjectPattern(node.left)) {
|
||||
return true;
|
||||
|
||||
+7
-7
@@ -292,14 +292,14 @@ class Printer {
|
||||
|
||||
if (needsParens) this.token("(");
|
||||
|
||||
this._printLeadingComments(node);
|
||||
this._printLeadingComments(node, parent);
|
||||
|
||||
const loc = t().isProgram(node) || t().isFile(node) ? null : node.loc;
|
||||
this.withSource("start", loc, () => {
|
||||
printMethod.call(this, node, parent);
|
||||
this[node.type](node, parent);
|
||||
});
|
||||
|
||||
this._printTrailingComments(node);
|
||||
this._printTrailingComments(node, parent);
|
||||
|
||||
if (needsParens) this.token(")");
|
||||
|
||||
@@ -392,12 +392,12 @@ class Printer {
|
||||
this.print(node, parent);
|
||||
}
|
||||
|
||||
_printTrailingComments(node) {
|
||||
this._printComments(this._getComments(false, node));
|
||||
_printTrailingComments(node, parent) {
|
||||
this._printComments(this._getComments(false, node, parent));
|
||||
}
|
||||
|
||||
_printLeadingComments(node) {
|
||||
this._printComments(this._getComments(true, node));
|
||||
_printLeadingComments(node, parent) {
|
||||
this._printComments(this._getComments(true, node, parent));
|
||||
}
|
||||
|
||||
printInnerComments(node, indent = true) {
|
||||
|
||||
+6
-10
@@ -1,28 +1,24 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.4.4",
|
||||
"version": "7.0.0",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-generator",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.4.4",
|
||||
"@babel/types": "^7.0.0",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.10",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"@babel/parser": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/helper-fixtures": "^7.0.0",
|
||||
"@babel/parser": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ function _default(path, scope = path.scope) {
|
||||
};
|
||||
path.traverse(visitor, state);
|
||||
|
||||
if (state.foundArguments || state.foundThis) {
|
||||
if (state.foundArguments) {
|
||||
callee = t().memberExpression(container, t().identifier("apply"));
|
||||
args = [];
|
||||
|
||||
|
||||
+5
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-call-delegate",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Helper function to call delegate",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate",
|
||||
"license": "MIT",
|
||||
@@ -9,9 +9,8 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-hoist-variables": "^7.4.4",
|
||||
"@babel/traverse": "^7.4.4",
|
||||
"@babel/types": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/helper-hoist-variables": "^7.0.0",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ function push(mutatorMap, node, kind, file, scope) {
|
||||
}
|
||||
|
||||
function hasComputed(mutatorMap) {
|
||||
for (const key of Object.keys(mutatorMap)) {
|
||||
for (const key in mutatorMap) {
|
||||
if (mutatorMap[key]._computed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-define-map",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Helper function to define a map",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map",
|
||||
"license": "MIT",
|
||||
@@ -10,8 +10,7 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/types": "^7.4.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/types": "^7.0.0",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ function splitExportDeclaration(exportDeclaration) {
|
||||
exportDeclaration.replaceWith(updatedDeclaration);
|
||||
|
||||
if (needBindingRegistration) {
|
||||
scope.registerDeclaration(exportDeclaration);
|
||||
scope.registerBinding(isClassDeclaration ? "let" : "var", exportDeclaration);
|
||||
}
|
||||
|
||||
return exportDeclaration;
|
||||
|
||||
+3
-7
@@ -1,15 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"version": "7.4.4",
|
||||
"version": "7.0.0",
|
||||
"description": "",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+393
-549
File diff suppressed because it is too large
Load Diff
+5
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -11,12 +11,11 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.4.4",
|
||||
"@babel/traverse": "^7.4.4",
|
||||
"@babel/types": "^7.4.4"
|
||||
"@babel/template": "^7.1.0",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
> A JavaScript parser
|
||||
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen) associated with this package.
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20babylon%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
+5023
-5805
File diff suppressed because it is too large
Load Diff
+5
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -28,13 +28,11 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"charcodes": "^0.2.0",
|
||||
"unicode-12.0.0": "^0.7.9"
|
||||
"@babel/helper-fixtures": "^7.0.0",
|
||||
"charcodes": "0.1.0",
|
||||
"unicode-11.0.0": "^0.7.7"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "./bin/babel-parser.js"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-27
@@ -78,14 +78,6 @@ export interface ParserOptions {
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
}
|
||||
|
||||
export type ParserPlugin =
|
||||
@@ -114,22 +106,4 @@ export type ParserPlugin =
|
||||
'optionalCatchBinding' |
|
||||
'throwExpressions' |
|
||||
'pipelineOperator' |
|
||||
'nullishCoalescingOperator' |
|
||||
ParserPluginWithOptions;
|
||||
|
||||
export type ParserPluginWithOptions =
|
||||
['decorators', DecoratorsPluginOptions] |
|
||||
['pipelineOperator', PipelineOperatorPluginOptions] |
|
||||
['flow', FlowPluginOptions];
|
||||
|
||||
export interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
}
|
||||
|
||||
export interface PipelineOperatorPluginOptions {
|
||||
proposal: 'minimal' | 'smart';
|
||||
}
|
||||
|
||||
export interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
}
|
||||
'nullishCoalescingOperator';
|
||||
|
||||
Generated
Vendored
-1
@@ -119,7 +119,6 @@ var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
|
||||
};
|
||||
return {
|
||||
name: "proposal-async-generator-functions",
|
||||
inherits: _pluginSyntaxAsyncGenerators().default,
|
||||
visitor: {
|
||||
Program(path, state) {
|
||||
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-async-generator-functions",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"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",
|
||||
@@ -14,13 +14,13 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-remap-async-to-generator": "^7.1.0",
|
||||
"@babel/plugin-syntax-async-generators": "^7.2.0"
|
||||
"@babel/plugin-syntax-async-generators": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+18
-78
@@ -232,26 +232,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
};
|
||||
const staticPrivatePropertyHandlerSpec = Object.assign({}, privateNameHandlerSpec, {
|
||||
get(member) {
|
||||
const {
|
||||
file,
|
||||
privateId,
|
||||
classRef
|
||||
} = this;
|
||||
return _core().types.callExpression(file.addHelper("classStaticPrivateFieldSpecGet"), [this.receiver(member), _core().types.cloneNode(classRef), _core().types.cloneNode(privateId)]);
|
||||
},
|
||||
|
||||
set(member, value) {
|
||||
const {
|
||||
file,
|
||||
privateId,
|
||||
classRef
|
||||
} = this;
|
||||
return _core().types.callExpression(file.addHelper("classStaticPrivateFieldSpecSet"), [this.receiver(member), _core().types.cloneNode(classRef), _core().types.cloneNode(privateId), value]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function buildClassPropertySpec(ref, path, state) {
|
||||
const {
|
||||
@@ -308,7 +288,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
});
|
||||
}
|
||||
|
||||
function buildClassPrivatePropertyLooseHelper(ref, path, state) {
|
||||
function buildClassPrivatePropertyLoose(ref, path, initNodes, state) {
|
||||
const {
|
||||
parentPath,
|
||||
scope
|
||||
@@ -322,68 +302,27 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
prop,
|
||||
file: state
|
||||
}, privateNameHandlerLoose));
|
||||
return {
|
||||
keyDecl: _core().template.statement`var PROP = HELPER(NAME);`({
|
||||
initNodes.push(_core().template.statement`var PROP = HELPER(NAME);`({
|
||||
PROP: prop,
|
||||
HELPER: state.addHelper("classPrivateFieldLooseKey"),
|
||||
NAME: _core().types.stringLiteral(name)
|
||||
}),
|
||||
buildInit: () => _core().template.statement.ast`
|
||||
Object.defineProperty(${ref}, ${prop}, {
|
||||
}));
|
||||
return () => _core().template.statement`
|
||||
Object.defineProperty(REF, PROP, {
|
||||
// configurable is false by default
|
||||
// enumerable is false by default
|
||||
writable: true,
|
||||
value: ${path.node.value || scope.buildUndefinedNode()}
|
||||
value: VALUE
|
||||
});
|
||||
`({
|
||||
REF: ref,
|
||||
PROP: prop,
|
||||
VALUE: path.node.value || scope.buildUndefinedNode()
|
||||
});
|
||||
`
|
||||
};
|
||||
}
|
||||
|
||||
function buildClassInstancePrivatePropertyLoose(ref, path, initNodes, state) {
|
||||
const {
|
||||
keyDecl,
|
||||
buildInit
|
||||
} = buildClassPrivatePropertyLooseHelper(ref, path, state);
|
||||
initNodes.push(keyDecl);
|
||||
return buildInit;
|
||||
}
|
||||
|
||||
function buildClassStaticPrivatePropertyLoose(ref, path, state) {
|
||||
const {
|
||||
keyDecl,
|
||||
buildInit
|
||||
} = buildClassPrivatePropertyLooseHelper(ref, path, state);
|
||||
return [keyDecl, buildInit()];
|
||||
}
|
||||
|
||||
function buildClassStaticPrivatePropertySpec(ref, path, state) {
|
||||
const {
|
||||
parentPath,
|
||||
scope
|
||||
} = path;
|
||||
const {
|
||||
name
|
||||
} = path.node.key.id;
|
||||
const privateId = scope.generateUidIdentifier(name);
|
||||
(0, _helperMemberExpressionToFunctions().default)(parentPath, privateNameVisitor, Object.assign({
|
||||
name,
|
||||
privateId,
|
||||
classRef: ref,
|
||||
file: state
|
||||
}, staticPrivatePropertyHandlerSpec));
|
||||
return [_core().template.statement.ast`
|
||||
var ${privateId} = {
|
||||
// configurable is always false for private elements
|
||||
// enumerable is always false for private elements
|
||||
writable: true,
|
||||
value: ${path.node.value || scope.buildUndefinedNode()}
|
||||
}
|
||||
`];
|
||||
}
|
||||
|
||||
const buildClassProperty = loose ? buildClassPropertyLoose : buildClassPropertySpec;
|
||||
const buildClassPrivateProperty = loose ? buildClassInstancePrivatePropertyLoose : buildClassPrivatePropertySpec;
|
||||
const buildClassStaticPrivateProperty = loose ? buildClassStaticPrivatePropertyLoose : buildClassStaticPrivatePropertySpec;
|
||||
const buildClassPrivateProperty = loose ? buildClassPrivatePropertyLoose : buildClassPrivatePropertySpec;
|
||||
return {
|
||||
inherits: _pluginSyntaxClassProperties().default,
|
||||
visitor: {
|
||||
@@ -411,6 +350,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
if (path.isClassPrivateProperty()) {
|
||||
const {
|
||||
static: isStatic,
|
||||
key: {
|
||||
id: {
|
||||
name
|
||||
@@ -418,6 +358,10 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
} = path.node;
|
||||
|
||||
if (isStatic) {
|
||||
throw path.buildCodeFrameError("Static class fields are not spec'ed yet.");
|
||||
}
|
||||
|
||||
if (privateNames.has(name)) {
|
||||
throw path.buildCodeFrameError("Duplicate private field");
|
||||
}
|
||||
@@ -466,7 +410,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
const privateMapInits = [];
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop.isPrivate() && !prop.node.static) {
|
||||
if (prop.isPrivate()) {
|
||||
const inits = [];
|
||||
privateMapInits.push(inits);
|
||||
privateMaps.push(buildClassPrivateProperty(_core().types.thisExpression(), prop, inits, state));
|
||||
@@ -477,11 +421,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop.node.static) {
|
||||
if (prop.isPrivate()) {
|
||||
staticNodes.push(...buildClassStaticPrivateProperty(_core().types.cloneNode(ref), prop, state));
|
||||
} else {
|
||||
staticNodes.push(buildClassProperty(_core().types.cloneNode(ref), prop, state));
|
||||
}
|
||||
} else if (prop.isPrivate()) {
|
||||
instanceBody.push(privateMaps[p]());
|
||||
staticNodes.push(...privateMapInits[p]);
|
||||
|
||||
+3
-6
@@ -1,22 +1,19 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-class-properties",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"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",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-function-name": "^7.0.0",
|
||||
"@babel/helper-member-expression-to-functions": "^7.0.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.1.0",
|
||||
"@babel/helper-replace-supers": "^7.0.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-2
@@ -56,7 +56,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
if (method && module) {
|
||||
return {
|
||||
name: "transform-async-to-generator",
|
||||
visitor: {
|
||||
Function(path, state) {
|
||||
if (!path.node.async || path.node.generator) return;
|
||||
@@ -78,7 +77,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
return {
|
||||
name: "transform-async-to-generator",
|
||||
visitor: {
|
||||
Function(path, state) {
|
||||
if (!path.node.async || path.node.generator) return;
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-async-to-generator",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Turn async functions into ES2015 generators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator",
|
||||
"license": "MIT",
|
||||
@@ -20,8 +20,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -80,7 +80,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
} = options;
|
||||
const VISITED = Symbol();
|
||||
return {
|
||||
name: "transform-classes",
|
||||
visitor: {
|
||||
ExportDefaultDeclaration(path) {
|
||||
if (!path.get("declaration").isClassDeclaration()) return;
|
||||
|
||||
+88
-43
@@ -67,6 +67,42 @@ function buildConstructor(classRef, constructorBody, node) {
|
||||
return func;
|
||||
}
|
||||
|
||||
const verifyConstructorVisitor = _core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
Super(path, state) {
|
||||
if (state.isDerived) return;
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
throw path.buildCodeFrameError("super() is only allowed in a derived constructor");
|
||||
}
|
||||
},
|
||||
|
||||
ThisExpression(path, state) {
|
||||
if (!state.isDerived) return;
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isMemberExpression({
|
||||
object: node
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
const assertion = _core().types.callExpression(state.file.addHelper("assertThisInitialized"), [node]);
|
||||
|
||||
path.replaceWith(assertion);
|
||||
path.skip();
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
function transformClass(path, file, builtinClasses, isLoose) {
|
||||
const classState = {
|
||||
parent: undefined,
|
||||
@@ -89,6 +125,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
instancePropRefs: {},
|
||||
staticPropBody: [],
|
||||
body: [],
|
||||
bareSupers: new Set(),
|
||||
superThises: [],
|
||||
pushedConstructor: false,
|
||||
pushedInherits: false,
|
||||
@@ -200,6 +237,14 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
|
||||
if (_core().types.isClassMethod(node)) {
|
||||
const isConstructor = node.kind === "constructor";
|
||||
|
||||
if (isConstructor) {
|
||||
path.traverse(verifyConstructorVisitor, {
|
||||
isDerived: classState.isDerived,
|
||||
file: classState.file
|
||||
});
|
||||
}
|
||||
|
||||
const replaceSupers = new (_helperReplaceSupers().default)({
|
||||
methodPath: path,
|
||||
objectRef: classState.classRef,
|
||||
@@ -208,18 +253,34 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
file: classState.file
|
||||
});
|
||||
replaceSupers.replace();
|
||||
const superReturns = [];
|
||||
const state = {
|
||||
returns: [],
|
||||
bareSupers: new Set()
|
||||
};
|
||||
path.traverse(_core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
ReturnStatement(path) {
|
||||
ReturnStatement(path, state) {
|
||||
if (!path.getFunctionParent().isArrowFunctionExpression()) {
|
||||
superReturns.push(path);
|
||||
state.returns.push(path);
|
||||
}
|
||||
},
|
||||
|
||||
Super(path, state) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
state.bareSupers.add(parentPath);
|
||||
}
|
||||
}
|
||||
|
||||
}]));
|
||||
}]), state);
|
||||
|
||||
if (isConstructor) {
|
||||
pushConstructor(superReturns, node, path);
|
||||
pushConstructor(state, node, path);
|
||||
} else {
|
||||
pushMethod(node, path);
|
||||
}
|
||||
@@ -315,6 +376,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
const path = classState.userConstructorPath;
|
||||
const body = path.get("body");
|
||||
path.traverse(findThisesVisitor);
|
||||
let guaranteedSuperBeforeFinish = !!classState.bareSupers.size;
|
||||
|
||||
let thisRef = function () {
|
||||
const ref = path.scope.generateDeclaredUidIdentifier("this");
|
||||
@@ -324,6 +386,23 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
return ref;
|
||||
};
|
||||
|
||||
for (const bareSuper of classState.bareSupers) {
|
||||
wrapSuperCall(bareSuper, classState.superName, thisRef, body);
|
||||
|
||||
if (guaranteedSuperBeforeFinish) {
|
||||
bareSuper.find(function (parentPath) {
|
||||
if (parentPath === path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parentPath.isLoop() || parentPath.isConditional() || parentPath.isArrowFunctionExpression()) {
|
||||
guaranteedSuperBeforeFinish = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
for (const thisPath of classState.superThises) {
|
||||
const {
|
||||
node,
|
||||
@@ -340,41 +419,6 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
thisPath.replaceWith(_core().types.callExpression(classState.file.addHelper("assertThisInitialized"), [thisRef()]));
|
||||
}
|
||||
|
||||
const bareSupers = new Set();
|
||||
path.traverse(_core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
Super(path) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
bareSupers.add(parentPath);
|
||||
}
|
||||
}
|
||||
|
||||
}]));
|
||||
let guaranteedSuperBeforeFinish = !!bareSupers.size;
|
||||
|
||||
for (const bareSuper of bareSupers) {
|
||||
wrapSuperCall(bareSuper, classState.superName, thisRef, body);
|
||||
|
||||
if (guaranteedSuperBeforeFinish) {
|
||||
bareSuper.find(function (parentPath) {
|
||||
if (parentPath === path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parentPath.isLoop() || parentPath.isConditional() || parentPath.isArrowFunctionExpression()) {
|
||||
guaranteedSuperBeforeFinish = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let wrapReturn;
|
||||
|
||||
if (classState.isLoose) {
|
||||
@@ -423,7 +467,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
|
||||
let func = _core().types.functionExpression(null, node.params, node.body, node.generator, node.async);
|
||||
|
||||
_core().types.inherits(func, node);
|
||||
func.returnType = node.returnType;
|
||||
|
||||
const key = _core().types.toComputedKey(node, node.key);
|
||||
|
||||
@@ -460,7 +504,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
}
|
||||
}
|
||||
|
||||
function pushConstructor(superReturns, method, path) {
|
||||
function pushConstructor(replaceSupers, method, path) {
|
||||
if (path.scope.hasOwnBinding(classState.classRef.name)) {
|
||||
path.scope.rename(classState.classRef.name);
|
||||
}
|
||||
@@ -469,7 +513,8 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
userConstructorPath: path,
|
||||
userConstructor: method,
|
||||
hasConstructor: true,
|
||||
superReturns
|
||||
bareSupers: replaceSupers.bareSupers,
|
||||
superReturns: replaceSupers.returns
|
||||
});
|
||||
const {
|
||||
construct
|
||||
|
||||
+6
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-classes",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 classes to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes",
|
||||
"license": "MIT",
|
||||
@@ -10,12 +10,12 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.0.0",
|
||||
"@babel/helper-define-map": "^7.4.4",
|
||||
"@babel/helper-define-map": "^7.1.0",
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.4.4",
|
||||
"@babel/helper-split-export-declaration": "^7.4.4",
|
||||
"@babel/helper-replace-supers": "^7.1.0",
|
||||
"@babel/helper-split-export-declaration": "^7.0.0",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -25,8 +25,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -40,7 +40,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-exponentiation-operator",
|
||||
visitor: (0, _helperBuilderBinaryAssignmentOperatorVisitor().default)({
|
||||
operator: "**",
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-exponentiation-operator",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile exponentiation operator to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -30,7 +30,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-function-name",
|
||||
visitor: {
|
||||
FunctionExpression: {
|
||||
exit(path) {
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-function-name",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Apply ES2015 function.name semantics to all functions",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name",
|
||||
"license": "MIT",
|
||||
@@ -19,8 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
noInterop
|
||||
} = options;
|
||||
return {
|
||||
name: "transform-modules-amd",
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-modules-amd",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "This plugin transforms ES2015 modules to AMD",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -123,7 +123,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
return {
|
||||
name: "transform-modules-umd",
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-modules-umd",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "This plugin transforms ES2015 modules to UMD",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -49,7 +49,6 @@ function replacePropertySuper(path, getObjectRef, file) {
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-object-super",
|
||||
visitor: {
|
||||
ObjectExpression(path, state) {
|
||||
let objectRef;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-object-super",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 object super to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -27,7 +27,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
loose
|
||||
} = options;
|
||||
return {
|
||||
name: "transform-parameters",
|
||||
visitor: {
|
||||
Function(path) {
|
||||
if (path.isArrowFunctionExpression() && path.get("params").some(param => param.isRestElement() || param.isAssignmentPattern())) {
|
||||
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-parameters",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 default and rest parameters to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters",
|
||||
"license": "MIT",
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-call-delegate": "^7.4.4",
|
||||
"@babel/helper-call-delegate": "^7.1.0",
|
||||
"@babel/helper-get-function-arity": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0"
|
||||
},
|
||||
@@ -20,8 +20,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+4
-48
@@ -4,28 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _semver() {
|
||||
const data = _interopRequireDefault(require("semver"));
|
||||
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function hasMinVersion(minVersion, runtimeVersion) {
|
||||
if (!runtimeVersion) return true;
|
||||
if (_semver().default.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
|
||||
return !_semver().default.intersects(`<${minVersion}`, runtimeVersion) && !_semver().default.intersects(`>=8.0.0`, runtimeVersion);
|
||||
}
|
||||
|
||||
var _default = runtimeVersion => {
|
||||
const includeMathModule = hasMinVersion("7.0.1", runtimeVersion);
|
||||
return {
|
||||
var _default = {
|
||||
builtins: {
|
||||
Symbol: "symbol",
|
||||
Promise: "promise",
|
||||
@@ -38,7 +17,7 @@ var _default = runtimeVersion => {
|
||||
parseFloat: "parse-float",
|
||||
parseInt: "parse-int"
|
||||
},
|
||||
methods: Object.assign({
|
||||
methods: {
|
||||
Array: {
|
||||
from: "array/from",
|
||||
isArray: "array/is-array",
|
||||
@@ -68,28 +47,7 @@ var _default = runtimeVersion => {
|
||||
seal: "object/seal",
|
||||
setPrototypeOf: "object/set-prototype-of",
|
||||
values: "object/values"
|
||||
}
|
||||
}, includeMathModule ? {
|
||||
Math: {
|
||||
acosh: "math/acosh",
|
||||
asinh: "math/asinh",
|
||||
atanh: "math/atanh",
|
||||
cbrt: "math/cbrt",
|
||||
clz32: "math/clz32",
|
||||
cosh: "math/cosh",
|
||||
expm1: "math/expm1",
|
||||
fround: "math/fround",
|
||||
hypot: "math/hypot",
|
||||
imul: "math/imul",
|
||||
log10: "math/log10",
|
||||
log1p: "math/log1p",
|
||||
log2: "math/log2",
|
||||
sign: "math/sign",
|
||||
sinh: "math/sinh",
|
||||
tanh: "math/tanh",
|
||||
trunc: "math/trunc"
|
||||
}
|
||||
} : {}, {
|
||||
},
|
||||
Symbol: {
|
||||
asyncIterator: "symbol/async-iterator",
|
||||
for: "symbol/for",
|
||||
@@ -140,8 +98,6 @@ var _default = runtimeVersion => {
|
||||
Date: {
|
||||
now: "date/now"
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.default = _default;
|
||||
+7
-12
@@ -88,7 +88,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
version: runtimeVersion = "7.0.0-beta.0",
|
||||
absoluteRuntime = false
|
||||
} = options;
|
||||
const definitions = (0, _definitions.default)(runtimeVersion);
|
||||
|
||||
if (typeof useRuntimeRegenerator !== "boolean") {
|
||||
throw new Error("The 'regenerator' option must be undefined, or a boolean.");
|
||||
@@ -107,11 +106,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
}
|
||||
|
||||
if (corejsVersion !== false && (typeof corejsVersion !== "number" || corejsVersion !== 2) && (typeof corejsVersion !== "string" || corejsVersion !== "2")) {
|
||||
throw new Error(`The 'corejs' option must be undefined, false, 2 or '2', ` + `but got ${JSON.stringify(corejsVersion)}.`);
|
||||
}
|
||||
|
||||
if (typeof runtimeVersion !== "string") {
|
||||
throw new Error(`The 'version' option must be a version string.`);
|
||||
throw new Error(`The 'corejs' option must be undefined, false, or 2, or '2', ` + `but got ${JSON.stringify(corejsVersion)}.`);
|
||||
}
|
||||
|
||||
function has(obj, key) {
|
||||
@@ -200,9 +195,9 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
|
||||
if (!injectCoreJS2) return;
|
||||
if (_core().types.isMemberExpression(parent)) return;
|
||||
if (!has(definitions.builtins, node.name)) return;
|
||||
if (!has(_definitions.default.builtins, node.name)) return;
|
||||
if (scope.getBindingIdentifier(node.name)) return;
|
||||
path.replaceWith(this.addDefaultImport(`${modulePath}/core-js/${definitions.builtins[node.name]}`, node.name));
|
||||
path.replaceWith(this.addDefaultImport(`${modulePath}/core-js/${_definitions.default.builtins[node.name]}`, node.name));
|
||||
},
|
||||
|
||||
CallExpression(path) {
|
||||
@@ -237,8 +232,8 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
const prop = node.property;
|
||||
if (!_core().types.isReferenced(obj, node)) return;
|
||||
if (node.computed) return;
|
||||
if (!has(definitions.methods, obj.name)) return;
|
||||
const methods = definitions.methods[obj.name];
|
||||
if (!has(_definitions.default.methods, obj.name)) return;
|
||||
const methods = _definitions.default.methods[obj.name];
|
||||
if (!has(methods, prop.name)) return;
|
||||
if (path.scope.getBindingIdentifier(obj.name)) return;
|
||||
|
||||
@@ -260,9 +255,9 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
node
|
||||
} = path;
|
||||
const obj = node.object;
|
||||
if (!has(definitions.builtins, obj.name)) return;
|
||||
if (!has(_definitions.default.builtins, obj.name)) return;
|
||||
if (path.scope.getBindingIdentifier(obj.name)) return;
|
||||
path.replaceWith(_core().types.memberExpression(this.addDefaultImport(`${modulePath}/core-js/${definitions.builtins[obj.name]}`, obj.name), node.property, node.computed));
|
||||
path.replaceWith(_core().types.memberExpression(this.addDefaultImport(`${modulePath}/core-js/${_definitions.default.builtins[obj.name]}`, obj.name), node.property, node.computed));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-6
@@ -1,12 +1,9 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-runtime",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
@@ -14,8 +11,7 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"resolve": "^1.8.1",
|
||||
"semver": "^5.5.1"
|
||||
"resolve": "^1.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ const es = {
|
||||
"es6.string.from-code-point": "String static methods / String.fromCodePoint",
|
||||
"es6.string.includes": "String.prototype methods / String.prototype.includes",
|
||||
"es6.string.italics": "String.prototype HTML methods",
|
||||
"es6.string.iterator": "String.prototype methods / String.prototype[Symbol.iterator]",
|
||||
"es6.string.iterator": "String properties and methods / Property access on strings",
|
||||
"es6.string.link": "String.prototype HTML methods",
|
||||
// "String.prototype methods / String.prototype.normalize" not implemented
|
||||
"es7.string.pad-start": "String padding / String.prototype.padStart",
|
||||
|
||||
+9
-7
@@ -1183,14 +1183,16 @@
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.string.iterator": {
|
||||
"chrome": "38",
|
||||
"chrome": "5",
|
||||
"opera": "10.10",
|
||||
"edge": "12",
|
||||
"firefox": "36",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"ie": "8",
|
||||
"android": "4.0",
|
||||
"ios": "6",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.string.link": {
|
||||
"chrome": "5",
|
||||
|
||||
+11
-14
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"name": "@babel/preset-env",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"description": "A Babel preset for each environment.",
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
@@ -16,7 +13,7 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.1.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.0.0",
|
||||
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "^7.0.0",
|
||||
@@ -25,25 +22,25 @@
|
||||
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "^7.0.0",
|
||||
"@babel/plugin-transform-arrow-functions": "^7.0.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.1.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.0.0",
|
||||
"@babel/plugin-transform-block-scoped-functions": "^7.0.0",
|
||||
"@babel/plugin-transform-block-scoping": "^7.0.0",
|
||||
"@babel/plugin-transform-classes": "^7.1.0",
|
||||
"@babel/plugin-transform-classes": "^7.0.0",
|
||||
"@babel/plugin-transform-computed-properties": "^7.0.0",
|
||||
"@babel/plugin-transform-destructuring": "^7.0.0",
|
||||
"@babel/plugin-transform-dotall-regex": "^7.0.0",
|
||||
"@babel/plugin-transform-duplicate-keys": "^7.0.0",
|
||||
"@babel/plugin-transform-exponentiation-operator": "^7.1.0",
|
||||
"@babel/plugin-transform-exponentiation-operator": "^7.0.0",
|
||||
"@babel/plugin-transform-for-of": "^7.0.0",
|
||||
"@babel/plugin-transform-function-name": "^7.1.0",
|
||||
"@babel/plugin-transform-function-name": "^7.0.0",
|
||||
"@babel/plugin-transform-literals": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-amd": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-amd": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-systemjs": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-umd": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-umd": "^7.0.0",
|
||||
"@babel/plugin-transform-new-target": "^7.0.0",
|
||||
"@babel/plugin-transform-object-super": "^7.1.0",
|
||||
"@babel/plugin-transform-parameters": "^7.1.0",
|
||||
"@babel/plugin-transform-object-super": "^7.0.0",
|
||||
"@babel/plugin-transform-parameters": "^7.0.0",
|
||||
"@babel/plugin-transform-regenerator": "^7.0.0",
|
||||
"@babel/plugin-transform-shorthand-properties": "^7.0.0",
|
||||
"@babel/plugin-transform-spread": "^7.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-4
@@ -1,11 +1,8 @@
|
||||
{
|
||||
"name": "@babel/runtime-corejs2",
|
||||
"version": "7.1.2",
|
||||
"version": "7.0.0",
|
||||
"description": "babel's modular runtime helpers with core-js@2 polyfilling",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime-corejs2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@ case `uname` in
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
"$basedir/node" "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
node "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
node "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
)
|
||||
+2
-2
@@ -6,10 +6,10 @@ case `uname` in
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
"$basedir/node" "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
node "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
node "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
)
|
||||
+1
-1
@@ -68,7 +68,7 @@ export function sortSectionMetadata(m) {
|
||||
throw new Error("Section id not found");
|
||||
}
|
||||
|
||||
return aId - bId;
|
||||
return aId > bId;
|
||||
});
|
||||
}
|
||||
export function orderedInsertNode(m, n) {
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ function sortSectionMetadata(m) {
|
||||
throw new Error("Section id not found");
|
||||
}
|
||||
|
||||
return aId - bId;
|
||||
return aId > bId;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+8
-9
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/ast",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "AST utils for webassemblyjs",
|
||||
"keywords": [
|
||||
"webassembly",
|
||||
@@ -12,9 +12,10 @@
|
||||
"author": "Sven Sauleau",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@webassemblyjs/helper-module-context": "1.7.11",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.7.11",
|
||||
"@webassemblyjs/wast-parser": "1.7.11"
|
||||
"@webassemblyjs/helper-module-context": "1.7.6",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.7.6",
|
||||
"@webassemblyjs/wast-parser": "1.7.6",
|
||||
"mamacro": "^0.0.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -24,10 +25,8 @@
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webassemblyjs/helper-test-framework": "1.7.11",
|
||||
"@webassemblyjs/helper-test-framework": "1.7.6",
|
||||
"array.prototype.flatmap": "^1.2.1",
|
||||
"dump-exports": "^0.1.0",
|
||||
"mamacro": "^0.0.3"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
"dump-exports": "^0.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -10,7 +10,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "A function to parse floating point hexadecimal strings as defined by the WebAssembly specification",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -19,6 +19,5 @@
|
||||
"floating-point"
|
||||
],
|
||||
"author": "Mauro Bringolf",
|
||||
"license": "MIT",
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-api-error",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "Common API errors",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -8,6 +8,5 @@
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-buffer",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "Buffer manipulation utility",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -17,8 +17,7 @@
|
||||
"author": "Sven Sauleau",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@webassemblyjs/wasm-parser": "1.7.11",
|
||||
"@webassemblyjs/wasm-parser": "1.7.6",
|
||||
"jest-diff": "^22.4.0"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-code-frame",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -14,10 +14,9 @@
|
||||
"author": "Sven Sauleau",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@webassemblyjs/wast-printer": "1.7.11"
|
||||
"@webassemblyjs/wast-printer": "1.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webassemblyjs/ast": "1.7.11"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
"@webassemblyjs/ast": "1.7.6"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-fsm",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "FSM implementation",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -8,6 +8,5 @@
|
||||
"license": "ISC",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-module-context",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -11,14 +11,15 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/xtuc/webassemblyjs.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webassemblyjs/wast-parser": "1.7.11",
|
||||
"dependencies": {
|
||||
"mamacro": "^0.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webassemblyjs/wast-parser": "1.7.6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"author": "Sven Sauleau",
|
||||
"license": "MIT",
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@webassemblyjs/helper-wasm-bytecode",
|
||||
"version": "1.7.11",
|
||||
"version": "1.7.6",
|
||||
"description": "WASM's Bytecode constants",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
@@ -15,6 +15,5 @@
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4291990bfc4648bc6676091a955d12dc3c7e5909"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user