Merge branch '7.0'
This commit is contained in:
commit
0f982799b6
51
.travis.yml
51
.travis.yml
@ -1,48 +1,43 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "4"
|
||||
- "5"
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
before_install:
|
||||
# Rollup doesn't support node < 4.x. Switch to latest for build
|
||||
- . $HOME/.nvm/nvm.sh
|
||||
- nvm install stable && nvm use stable
|
||||
env:
|
||||
- JOB=test
|
||||
|
||||
before_script:
|
||||
- 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi'
|
||||
- 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi'
|
||||
- 'BABEL_ENV=test npm run build'
|
||||
# Switch back to node version currently being tested prior to test run
|
||||
- 'nvm use $TRAVIS_NODE_VERSION;'
|
||||
- 'if [ "$JOB" = "babel-test" ]; then make bootstrap-babel ; fi'
|
||||
- 'if [ "$JOB" = "flow-test" ]; then make bootstrap-flow ; fi'
|
||||
- 'if [ "$JOB" = "test" ]; then yarn run build; fi'
|
||||
|
||||
script:
|
||||
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
|
||||
- 'if [ -n "${FLOW-}" ]; then npm run flow ; fi'
|
||||
- 'if [ -n "${FLOWTESTS-}" ]; then make test-flow ; fi'
|
||||
- 'if [ -n "${BABEL-}" ]; then make test-babel ; fi'
|
||||
- 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${BABEL-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run test-ci ; fi'
|
||||
- 'if [ "$JOB" = "test" ]; then yarn test-only; fi'
|
||||
- 'if [ "$JOB" = "lint" ]; then yarn run lint && yarn run flow; fi'
|
||||
- 'if [ "$JOB" = "flow-test" ]; then make test-flow; fi'
|
||||
- 'if [ "$JOB" = "babel-test" ]; then make test-babel; fi'
|
||||
- 'if [ "$JOB" = "test-coverage" ]; then yarn run test-coverage; fi'
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: LINT=true
|
||||
- node_js: "node"
|
||||
env: FLOW=true
|
||||
- node_js: "node"
|
||||
env: BABEL=true
|
||||
- node_js: "node"
|
||||
env: FLOWTESTS=true
|
||||
- node_js: "lts/*"
|
||||
env: JOB=test-coverage
|
||||
- node_js: "lts/*"
|
||||
env: JOB=lint
|
||||
- node_js: "lts/*"
|
||||
env: JOB=babel-test
|
||||
- node_js: "lts/*"
|
||||
env: JOB=flow-test
|
||||
allow_failures:
|
||||
- node_js: "node"
|
||||
env: FLOWTESTS=true
|
||||
- node_js: "lts/*"
|
||||
env: JOB=flow-test
|
||||
|
||||
after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run coverage ; fi'
|
||||
after_success:
|
||||
- 'if [ "$JOB" = "babel-test" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babel ; fi'
|
||||
- 'if [ "$JOB" = "test-coverage" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babylon ; fi'
|
||||
|
||||
notifications:
|
||||
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK
|
||||
|
||||
48
CHANGELOG.md
48
CHANGELOG.md
@ -15,6 +15,54 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
||||
|
||||
See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog.
|
||||
|
||||
## 7.0.0-beta.4 (2017-03-01)
|
||||
|
||||
* Don't consume async when checking for async func decl (#377) (Brian Ng)
|
||||
* add `ranges` option [skip ci] (Henry Zhu)
|
||||
* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)
|
||||
|
||||
## 7.0.0-beta.3 (2017-02-28)
|
||||
|
||||
- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
|
||||
- Merge changes from 6.x
|
||||
|
||||
## 7.0.0-beta.2 (2017-02-20)
|
||||
|
||||
- estree: correctly change literals in all cases (#368) (Daniel Tschinder)
|
||||
|
||||
## 7.0.0-beta.1 (2017-02-20)
|
||||
|
||||
- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
|
||||
- Update contributing with more test info [skip ci] (#355) (Brian Ng)
|
||||
|
||||
## 7.0.0-beta.0 (2017-02-15)
|
||||
|
||||
- Reintroduce Variance node (#333) (Daniel Tschinder)
|
||||
- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
|
||||
- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
|
||||
- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
|
||||
- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
|
||||
- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
|
||||
- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
|
||||
- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
|
||||
- Remove classConstructorCall plugin (#291) (Brian Ng)
|
||||
- Update yarn.lock (Daniel Tschinder)
|
||||
- Update cross-env to 3.x (Daniel Tschinder)
|
||||
- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
|
||||
- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)
|
||||
|
||||
## 6.16.1 (2017-02-23)
|
||||
|
||||
### :bug: Regression
|
||||
|
||||
- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))
|
||||
|
||||
Need to modify Babel for this AST node change, so moving to 7.0.
|
||||
|
||||
- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376))
|
||||
|
||||
[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.
|
||||
|
||||
## 6.16.0 (2017-02-23)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
@ -6,10 +6,14 @@ contributing, please read the
|
||||
|
||||
## Setup local env
|
||||
|
||||
> Install yarn beforehand: https://yarnpkg.com/en/docs/install
|
||||
|
||||
To start developing on Babylon you only need to install its dependencies:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
git clone https://github.com/babel/babylon
|
||||
cd babylon
|
||||
yarn
|
||||
```
|
||||
|
||||
## Tests
|
||||
@ -31,6 +35,26 @@ npm run test-only
|
||||
Note, this does not actually run a build, so you may have to call `npm run build` after
|
||||
performing any changes.
|
||||
|
||||
### Running one test
|
||||
|
||||
To run only a single test, add `"only": true` to the `options.json` inside any test fixture folder (you may have to create the file if it doesn't exist).
|
||||
For example, let's say we want to only run the test for the [`test/fixtures/comments/basic/shebang-import`](https://github.com/babel/babylon/tree/7.0/test/fixtures/comments/basic/shebang-import) fixture.
|
||||
|
||||
Add `"only": true` to its `options.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"sourceType": "module",
|
||||
"only": true
|
||||
}
|
||||
```
|
||||
|
||||
Then, run the tests using the same command as before:
|
||||
|
||||
```bash
|
||||
npm run test-only
|
||||
```
|
||||
|
||||
### Checking code coverage locally
|
||||
|
||||
To generate code coverage, be sure to set `BABEL_ENV=test` so that code is instrumented during
|
||||
|
||||
7
Makefile
7
Makefile
@ -8,19 +8,18 @@ clean: ; rm -rf ./build
|
||||
|
||||
bootstrap-babel: clean
|
||||
mkdir ./build
|
||||
git clone --depth=1 --branch=master https://github.com/babel/babel.git ./build/babel
|
||||
git clone --depth=1 --branch=7.0 https://github.com/babel/babel.git ./build/babel
|
||||
cd ./build/babel; \
|
||||
make bootstrap
|
||||
find ./build/babel/packages -type d -name 'babylon' -prune -exec rm -rf '{}' \; -exec ln -s '../../../../../' '{}' \;
|
||||
|
||||
test-babel:
|
||||
BABEL_ENV=test npm run build
|
||||
BABEL_ENV=test yarn run build
|
||||
# in case babel ever switches to nyc: filter its config out of package.json
|
||||
cd ./build/babel; \
|
||||
jq "del(.nyc)" package.json > package.nonyc.json; \
|
||||
mv -f package.nonyc.json package.json; \
|
||||
../../node_modules/.bin/nyc --no-instrument --no-source-map --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \
|
||||
mv .nyc_output ../../.nyc_output
|
||||
../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \
|
||||
|
||||
bootstrap-flow: clean
|
||||
mkdir ./build
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/babylon"><img alt="NPM Version" src="https://img.shields.io/npm/v/babylon.svg?style=flat"></a>
|
||||
<a href="https://travis-ci.org/babel/babylon"><img alt="Travis Status" src="https://img.shields.io/travis/babel/babylon/master.svg?style=flat&label=travis"></a>
|
||||
<a href="https://codecov.io/gh/babel/babylon"><img alt="Codecov Status" src="https://img.shields.io/codecov/c/github/babel/babylon/master.svg?style=flat"></a>
|
||||
</p>
|
||||
@ -56,6 +57,8 @@ mind. When in doubt, use `.parse()`.
|
||||
|
||||
- **strictMode**: TODO
|
||||
|
||||
- **ranges**: Adds a `ranges` property to each node: `[node.start, node.end]`
|
||||
|
||||
### Output
|
||||
|
||||
Babylon generates AST according to [Babel AST format][].
|
||||
|
||||
58
ast/spec.md
58
ast/spec.md
@ -1,6 +1,7 @@
|
||||
These are the core Babylon AST node types.
|
||||
|
||||
- [Node objects](#node-objects)
|
||||
- [Changes](#changes)
|
||||
- [Identifier](#identifier)
|
||||
- [Literals](#literals)
|
||||
- [RegExpLiteral](#regexpliteral)
|
||||
@ -35,7 +36,6 @@ These are the core Babylon AST node types.
|
||||
- [ForStatement](#forstatement)
|
||||
- [ForInStatement](#forinstatement)
|
||||
- [ForOfStatement](#forofstatement)
|
||||
- [ForAwaitStatement](#forawaitstatement)
|
||||
- [Declarations](#declarations)
|
||||
- [FunctionDeclaration](#functiondeclaration)
|
||||
- [VariableDeclaration](#variabledeclaration)
|
||||
@ -56,8 +56,6 @@ These are the core Babylon AST node types.
|
||||
- [ObjectMember](#objectmember)
|
||||
- [ObjectProperty](#objectproperty)
|
||||
- [ObjectMethod](#objectmethod)
|
||||
- [RestProperty](#restproperty)
|
||||
- [SpreadProperty](#spreadproperty)
|
||||
- [FunctionExpression](#functionexpression)
|
||||
- [Unary operations](#unary-operations)
|
||||
- [UnaryExpression](#unaryexpression)
|
||||
@ -141,6 +139,22 @@ interface Position {
|
||||
}
|
||||
```
|
||||
|
||||
# Changes
|
||||
|
||||
### Babylon 7
|
||||
|
||||
Flow: Node renamed from `ExistentialTypeParam` to `ExistsTypeAnnotation` [#322](https://github.com/babel/babylon/pull/322)
|
||||
|
||||
Flow: Node renamed from `NumericLiteralTypeAnnotation` to `NumberLiteralTypeAnnotation` [babel/babylon#332](https://github.com/babel/babylon/pull/332)
|
||||
|
||||
Flow: Node `Variance` which replaces the string value of the `variance` field on several nodes [babel/babylon#333](https://github.com/babel/babylon/pull/333)
|
||||
|
||||
Flow: `ObjectTypeIndexer` location info matches Flow's better [babel/babylon#228](https://github.com/babel/babylon/pull/228)
|
||||
|
||||
Node `ForAwaitStatement` has been removed [#349](https://github.com/babel/babylon/pull/349) in favor of modifying `ForOfStatement`
|
||||
|
||||
`RestProperty` and `SpreadProperty` have been dropped in favor of `RestElement` and `SpreadElement`.
|
||||
|
||||
# Identifier
|
||||
|
||||
```js
|
||||
@ -479,16 +493,7 @@ A `for`/`in` statement.
|
||||
```js
|
||||
interface ForOfStatement <: ForInStatement {
|
||||
type: "ForOfStatement";
|
||||
}
|
||||
```
|
||||
|
||||
A `for`/`await` statement.
|
||||
|
||||
## ForAwaitStatement
|
||||
|
||||
```js
|
||||
interface ForAwaitStatement <: ForInStatement {
|
||||
type: "ForAwaitStatement";
|
||||
await: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
@ -652,7 +657,7 @@ An array expression.
|
||||
```js
|
||||
interface ObjectExpression <: Expression {
|
||||
type: "ObjectExpression";
|
||||
properties: [ ObjectProperty | ObjectMethod | SpreadProperty ];
|
||||
properties: [ ObjectProperty | ObjectMethod | SpreadElement ];
|
||||
}
|
||||
```
|
||||
|
||||
@ -664,7 +669,6 @@ An object expression.
|
||||
interface ObjectMember <: Node {
|
||||
key: Expression;
|
||||
computed: boolean;
|
||||
value: Expression;
|
||||
decorators: [ Decorator ];
|
||||
}
|
||||
```
|
||||
@ -675,6 +679,7 @@ interface ObjectMember <: Node {
|
||||
interface ObjectProperty <: ObjectMember {
|
||||
type: "ObjectProperty";
|
||||
shorthand: boolean;
|
||||
value: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
@ -687,24 +692,6 @@ interface ObjectMethod <: ObjectMember, Function {
|
||||
}
|
||||
```
|
||||
|
||||
## RestProperty
|
||||
|
||||
```js
|
||||
interface RestProperty <: Node {
|
||||
type: "RestProperty";
|
||||
argument: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
## SpreadProperty
|
||||
|
||||
```js
|
||||
interface SpreadProperty <: Node {
|
||||
type: "SpreadProperty";
|
||||
argument: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
## FunctionExpression
|
||||
|
||||
```js
|
||||
@ -980,7 +967,7 @@ interface AssignmentProperty <: ObjectProperty {
|
||||
|
||||
interface ObjectPattern <: Pattern {
|
||||
type: "ObjectPattern";
|
||||
properties: [ AssignmentProperty | RestProperty ];
|
||||
properties: [ AssignmentProperty | RestElement ];
|
||||
}
|
||||
```
|
||||
|
||||
@ -1035,10 +1022,9 @@ interface ClassBody <: Node {
|
||||
## ClassMethod
|
||||
|
||||
```js
|
||||
interface ClassMethod <: Node {
|
||||
interface ClassMethod <: Function {
|
||||
type: "ClassMethod";
|
||||
key: Expression;
|
||||
value: FunctionExpression;
|
||||
kind: "constructor" | "method" | "get" | "set";
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
|
||||
34
package.json
34
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "babylon",
|
||||
"version": "6.16.1",
|
||||
"version": "7.0.0-beta.5",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@ -17,19 +17,21 @@
|
||||
"bin",
|
||||
"lib"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.17.0",
|
||||
"ava": "^0.18.0",
|
||||
"babel-cli": "^6.14.0",
|
||||
"babel-eslint": "^7.0.0",
|
||||
"babel-helper-fixtures": "^6.9.0",
|
||||
"babel-plugin-external-helpers": "^6.18.0",
|
||||
"babel-plugin-istanbul": "^3.0.0",
|
||||
"babel-plugin-istanbul": "^4.0.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.14.0",
|
||||
"babel-preset-es2015": "^6.14.0",
|
||||
"babel-preset-stage-0": "^6.5.0",
|
||||
"chalk": "^1.1.3",
|
||||
"codecov": "^1.0.1",
|
||||
"cross-env": "^2.0.0",
|
||||
"cross-env": "^3.1.4",
|
||||
"eslint": "^3.7.1",
|
||||
"eslint-config-babel": "^6.0.0",
|
||||
"eslint-plugin-flowtype": "^2.20.0",
|
||||
@ -46,18 +48,17 @@
|
||||
"babylon": "./bin/babylon.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && rollup -c",
|
||||
"coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
||||
"lint": "eslint src bin",
|
||||
"build": "yarn run clean && rollup -c",
|
||||
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
|
||||
"clean": "rimraf lib",
|
||||
"flow": "flow",
|
||||
"prepublish": "cross-env BABEL_ENV=production npm run build",
|
||||
"preversion": "npm run test && npm run changelog",
|
||||
"test": "npm run lint && npm run flow && npm run build -- -m && npm run test-only",
|
||||
"lint": "eslint src bin",
|
||||
"prepublish": "cross-env BABEL_ENV=production yarn run build",
|
||||
"preversion": "yarn run test && npm run changelog",
|
||||
"test": "yarn run lint && yarn run flow && yarn run build -- -m && yarn run test-only",
|
||||
"test-only": "ava",
|
||||
"test-ci": "nyc npm run test-only",
|
||||
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
|
||||
"watch": "npm run clean && rollup -c --watch"
|
||||
"test-coverage": "cross-env BABEL_ENV=test yarn run build && nyc --reporter=json --reporter=text yarn run test-only",
|
||||
"watch": "yarn run clean && rollup -c --watch"
|
||||
},
|
||||
"nyc": {
|
||||
"include": [
|
||||
@ -75,10 +76,5 @@
|
||||
"src/**/*.js",
|
||||
"bin/**/*.js"
|
||||
]
|
||||
},
|
||||
"greenkeeper": {
|
||||
"ignore": [
|
||||
"cross-env"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
24
scripts/rmExpected.js
Normal file
24
scripts/rmExpected.js
Normal file
@ -0,0 +1,24 @@
|
||||
// Use this to remove all "expected.json" in all tests.
|
||||
|
||||
const { existsSync, readdirSync, statSync, unlinkSync } = require("fs");
|
||||
const { join } = require("path");
|
||||
|
||||
const rootPath = join(__dirname, "..", "test", "fixtures");
|
||||
|
||||
for (const fixtureName of readdirSync(rootPath)) {
|
||||
const fixturePath = join(rootPath, fixtureName);
|
||||
for (const suiteName of readdirSync(fixturePath)) {
|
||||
const suitePath = join(fixturePath, suiteName);
|
||||
if (!statSync(suitePath).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const testName of readdirSync(suitePath)) {
|
||||
const testPath = join(suitePath, testName);
|
||||
const expectedPath = join(testPath, "expected.json");
|
||||
if (existsSync(expectedPath)) {
|
||||
unlinkSync(expectedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,8 @@ export const defaultOptions: {
|
||||
allowImportExportEverywhere: boolean,
|
||||
allowSuperOutsideMethod: boolean,
|
||||
plugins: Array<string>,
|
||||
strictMode: any
|
||||
strictMode: any,
|
||||
ranges: boolean,
|
||||
} = {
|
||||
// Source type ("script" or "module") for different semantics
|
||||
sourceType: "script",
|
||||
@ -30,6 +31,15 @@ export const defaultOptions: {
|
||||
plugins: [],
|
||||
// TODO
|
||||
strictMode: null,
|
||||
// Nodes have their start and end characters offsets recorded in
|
||||
// `start` and `end` properties (directly on the node, rather than
|
||||
// the `loc` object, which holds line/column data. To also add a
|
||||
// [semi-standardized][range] `range` property holding a `[start,
|
||||
// end]` array with the same numbers, set the `ranges` option to
|
||||
// `true`.
|
||||
//
|
||||
// [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
|
||||
ranges: false,
|
||||
};
|
||||
|
||||
// Interpret and default an options object
|
||||
|
||||
@ -752,7 +752,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
|
||||
|
||||
if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) {
|
||||
prop = this.parseSpread(isPattern ? { start: 0 } : undefined);
|
||||
prop.type = isPattern ? "RestProperty" : "SpreadProperty";
|
||||
prop.type = isPattern ? "RestElement" : "SpreadElement";
|
||||
if (isPattern) this.toAssignable(prop.argument, true, "object pattern");
|
||||
node.properties.push(prop);
|
||||
if (isPattern) {
|
||||
@ -762,9 +762,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
|
||||
} else if (this.eat(tt.braceR)) {
|
||||
break;
|
||||
} else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) {
|
||||
// TODO: temporary rollback
|
||||
// this.unexpected(position, "A trailing comma is not permitted after the rest element");
|
||||
continue;
|
||||
this.unexpected(position, "A trailing comma is not permitted after the rest element");
|
||||
} else {
|
||||
firstRestLocation = position;
|
||||
continue;
|
||||
|
||||
@ -3,19 +3,6 @@ import { getOptions } from "../options";
|
||||
import Tokenizer from "../tokenizer";
|
||||
|
||||
export const plugins = {};
|
||||
const frozenDeprecatedWildcardPluginList = [
|
||||
"jsx",
|
||||
"doExpressions",
|
||||
"objectRestSpread",
|
||||
"decorators",
|
||||
"classProperties",
|
||||
"exportExtensions",
|
||||
"asyncGenerators",
|
||||
"functionBind",
|
||||
"functionSent",
|
||||
"dynamicImport",
|
||||
"flow"
|
||||
];
|
||||
|
||||
export default class Parser extends Tokenizer {
|
||||
constructor(options: Object, input: string) {
|
||||
@ -43,10 +30,6 @@ export default class Parser extends Tokenizer {
|
||||
}
|
||||
|
||||
hasPlugin(name: string): boolean {
|
||||
if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !!this.plugins[name];
|
||||
}
|
||||
|
||||
@ -54,25 +37,7 @@ export default class Parser extends Tokenizer {
|
||||
this[name] = f(this[name]);
|
||||
}
|
||||
|
||||
loadAllPlugins() {
|
||||
// ensure flow plugin loads last, also ensure estree is not loaded with *
|
||||
const pluginNames = Object.keys(plugins).filter((name) => name !== "flow" && name !== "estree");
|
||||
pluginNames.push("flow");
|
||||
|
||||
pluginNames.forEach((name) => {
|
||||
const plugin = plugins[name];
|
||||
if (plugin) plugin(this);
|
||||
});
|
||||
}
|
||||
|
||||
loadPlugins(pluginList: Array<string>): { [key: string]: boolean } {
|
||||
// TODO: Deprecate "*" option in next major version of Babylon
|
||||
if (pluginList.indexOf("*") >= 0) {
|
||||
this.loadAllPlugins();
|
||||
|
||||
return { "*": true };
|
||||
}
|
||||
|
||||
const pluginMap = {};
|
||||
|
||||
if (pluginList.indexOf("flow") >= 0) {
|
||||
|
||||
@ -34,8 +34,8 @@ pp.toAssignable = function (node, isBinding, contextDescription) {
|
||||
this.toAssignable(node.value, isBinding, contextDescription);
|
||||
break;
|
||||
|
||||
case "SpreadProperty":
|
||||
node.type = "RestProperty";
|
||||
case "SpreadElement":
|
||||
node.type = "RestElement";
|
||||
break;
|
||||
|
||||
case "ArrayExpression":
|
||||
@ -85,6 +85,8 @@ pp.toAssignableList = function (exprList, isBinding, contextDescription) {
|
||||
}
|
||||
for (let i = 0; i < end; i++) {
|
||||
const elt = exprList[i];
|
||||
if (elt && elt.type === "SpreadElement")
|
||||
this.raise(elt.start, "The rest element has to be the last element when destructuring");
|
||||
if (elt) this.toAssignable(elt, isBinding, contextDescription);
|
||||
}
|
||||
return exprList;
|
||||
@ -246,10 +248,6 @@ pp.checkLVal = function (expr, isBinding, checkClashes, contextDescription) {
|
||||
this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern");
|
||||
break;
|
||||
|
||||
case "RestProperty":
|
||||
this.checkLVal(expr.argument, isBinding, checkClashes, "rest property");
|
||||
break;
|
||||
|
||||
case "RestElement":
|
||||
this.checkLVal(expr.argument, isBinding, checkClashes, "rest element");
|
||||
break;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Parser from "./index";
|
||||
import { SourceLocation } from "../util/location";
|
||||
import { SourceLocation, type Position } from "../util/location";
|
||||
|
||||
// Start an AST node, attaching a start offset.
|
||||
|
||||
@ -7,12 +7,13 @@ const pp = Parser.prototype;
|
||||
const commentKeys = ["leadingComments", "trailingComments", "innerComments"];
|
||||
|
||||
class Node {
|
||||
constructor(pos?: number, loc?: number, filename?: string) {
|
||||
constructor(parser?: Parser, pos?: number, loc?: Position) {
|
||||
this.type = "";
|
||||
this.start = pos;
|
||||
this.end = 0;
|
||||
this.loc = new SourceLocation(loc);
|
||||
if (filename) this.loc.filename = filename;
|
||||
if (parser && parser.options.ranges) this.range = [pos, 0];
|
||||
if (parser && parser.filename) this.loc.filename = parser.filename;
|
||||
}
|
||||
|
||||
type: string;
|
||||
@ -34,17 +35,18 @@ class Node {
|
||||
}
|
||||
|
||||
pp.startNode = function () {
|
||||
return new Node(this.state.start, this.state.startLoc, this.filename);
|
||||
return new Node(this, this.state.start, this.state.startLoc);
|
||||
};
|
||||
|
||||
pp.startNodeAt = function (pos, loc) {
|
||||
return new Node(pos, loc, this.filename);
|
||||
return new Node(this, pos, loc);
|
||||
};
|
||||
|
||||
function finishNodeAt(node, type, pos, loc) {
|
||||
node.type = type;
|
||||
node.end = pos;
|
||||
node.loc.end = loc;
|
||||
if (this.options.ranges) node.range[1] = pos;
|
||||
this.processComment(node);
|
||||
return node;
|
||||
}
|
||||
@ -60,3 +62,15 @@ pp.finishNode = function (node, type) {
|
||||
pp.finishNodeAt = function (node, type, pos, loc) {
|
||||
return finishNodeAt.call(this, node, type, pos, loc);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Reset the start location of node to the start location of locationNode
|
||||
*/
|
||||
pp.resetStartLocationFromNode = function (node, locationNode) {
|
||||
node.start = locationNode.start;
|
||||
node.loc.start = locationNode.loc.start;
|
||||
if (this.options.ranges) node.range[0] = locationNode.range[0];
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
@ -529,14 +529,13 @@ pp.parseFor = function (node, init) {
|
||||
// same from parser's perspective.
|
||||
|
||||
pp.parseForIn = function (node, init, forAwait) {
|
||||
let type;
|
||||
const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement";
|
||||
if (forAwait) {
|
||||
this.eatContextual("of");
|
||||
type = "ForAwaitStatement";
|
||||
} else {
|
||||
type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement";
|
||||
this.next();
|
||||
}
|
||||
node.await = !!forAwait;
|
||||
node.left = init;
|
||||
node.right = this.parseExpression();
|
||||
this.expect(tt.parenR);
|
||||
@ -644,7 +643,6 @@ pp.parseClassBody = function (node) {
|
||||
const oldStrict = this.state.strict;
|
||||
this.state.strict = true;
|
||||
|
||||
let hadConstructorCall = false;
|
||||
let hadConstructor = false;
|
||||
let decorators = [];
|
||||
const classBody = this.startNode();
|
||||
@ -750,17 +748,6 @@ pp.parseClassBody = function (node) {
|
||||
}
|
||||
this.parseClassMethod(classBody, method, false, false);
|
||||
this.checkGetterSetterParamCount(method);
|
||||
} else if (this.hasPlugin("classConstructorCall") && isSimple && key.name === "call" && this.match(tt.name) && this.state.value === "constructor") {
|
||||
// a (deprecated) call constructor
|
||||
if (hadConstructorCall) {
|
||||
this.raise(method.start, "Duplicate constructor call in the same class");
|
||||
} else if (method.decorators) {
|
||||
this.raise(method.start, "You can't attach decorators to a class constructor");
|
||||
}
|
||||
hadConstructorCall = true;
|
||||
method.kind = "constructorCall";
|
||||
this.parsePropertyName(method); // consume "constructor" and make it the method's name
|
||||
this.parseClassMethod(classBody, method, false, false);
|
||||
} else if (this.isLineTerminator()) {
|
||||
// an uninitialized class property (due to ASI, since we don't otherwise recognize the next token)
|
||||
if (this.isNonstaticConstructor(method)) {
|
||||
@ -783,8 +770,13 @@ pp.parseClassBody = function (node) {
|
||||
};
|
||||
|
||||
pp.parseClassProperty = function (node) {
|
||||
const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled.";
|
||||
if (!node.typeAnnotation && !this.hasPlugin("classProperties")) {
|
||||
this.raise(node.start, noPluginMsg);
|
||||
}
|
||||
|
||||
if (this.match(tt.eq)) {
|
||||
if (!this.hasPlugin("classProperties")) this.unexpected();
|
||||
if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg);
|
||||
this.next();
|
||||
node.value = this.parseMaybeAssign();
|
||||
} else {
|
||||
@ -852,6 +844,13 @@ pp.parseExport = function (node) {
|
||||
let needsSemi = false;
|
||||
if (this.eat(tt._function)) {
|
||||
expr = this.parseFunction(expr, true, false, false, true);
|
||||
} else if (
|
||||
this.isContextual("async") &&
|
||||
this.lookahead().type === tt._function
|
||||
) { // async function declaration
|
||||
this.eatContextual("async");
|
||||
this.eat(tt._function);
|
||||
expr = this.parseFunction(expr, true, false, true, true);
|
||||
} else if (this.match(tt._class)) {
|
||||
expr = this.parseClass(expr, true, true);
|
||||
} else {
|
||||
@ -969,7 +968,7 @@ pp.checkDeclaration = function(node) {
|
||||
}
|
||||
} else if (node.type === "ObjectProperty") {
|
||||
this.checkDeclaration(node.value);
|
||||
} else if (node.type === "RestElement" || node.type === "RestProperty") {
|
||||
} else if (node.type === "RestElement") {
|
||||
this.checkDeclaration(node.argument);
|
||||
} else if (node.type === "Identifier") {
|
||||
this.checkDuplicateExports(node, node.name);
|
||||
|
||||
@ -352,8 +352,11 @@ pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) {
|
||||
node.value = this.flowParseTypeInitialiser();
|
||||
node.variance = variance;
|
||||
|
||||
// Finish node first to not include a possible semicolon in the locations
|
||||
const indexer = this.finishNode(node, "ObjectTypeIndexer");
|
||||
this.flowObjectTypeSemicolon();
|
||||
return this.finishNode(node, "ObjectTypeIndexer");
|
||||
|
||||
return indexer;
|
||||
};
|
||||
|
||||
pp.flowParseObjectTypeMethodish = function (node) {
|
||||
@ -437,14 +440,13 @@ pp.flowParseObjectType = function (allowStatic, allowExact) {
|
||||
isStatic = true;
|
||||
}
|
||||
|
||||
const variancePos = this.state.start;
|
||||
const variance = this.flowParseVariance();
|
||||
|
||||
if (this.match(tt.bracketL)) {
|
||||
nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
|
||||
} else if (this.match(tt.parenL) || this.isRelational("<")) {
|
||||
if (variance) {
|
||||
this.unexpected(variancePos);
|
||||
this.unexpected(variance.start);
|
||||
}
|
||||
nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
|
||||
} else {
|
||||
@ -452,7 +454,7 @@ pp.flowParseObjectType = function (allowStatic, allowExact) {
|
||||
if (this.isRelational("<") || this.match(tt.parenL)) {
|
||||
// This is a method property
|
||||
if (variance) {
|
||||
this.unexpected(variancePos);
|
||||
this.unexpected(variance.start);
|
||||
}
|
||||
nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey));
|
||||
} else {
|
||||
@ -716,12 +718,12 @@ pp.flowParsePrimaryType = function () {
|
||||
this.next();
|
||||
if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number");
|
||||
|
||||
return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start);
|
||||
return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start);
|
||||
}
|
||||
|
||||
this.unexpected();
|
||||
case tt.num:
|
||||
return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation");
|
||||
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
||||
|
||||
case tt._null:
|
||||
node.value = this.match(tt._null);
|
||||
@ -735,7 +737,7 @@ pp.flowParsePrimaryType = function () {
|
||||
|
||||
case tt.star:
|
||||
this.next();
|
||||
return this.finishNode(node, "ExistentialTypeParam");
|
||||
return this.finishNode(node, "ExistsTypeAnnotation");
|
||||
|
||||
default:
|
||||
if (this.state.type.keyword === "typeof") {
|
||||
@ -847,12 +849,14 @@ pp.typeCastToParameter = function (node) {
|
||||
pp.flowParseVariance = function() {
|
||||
let variance = null;
|
||||
if (this.match(tt.plusMin)) {
|
||||
variance = this.startNode();
|
||||
if (this.state.value === "+") {
|
||||
variance = "plus";
|
||||
} else if (this.state.value === "-") {
|
||||
variance = "minus";
|
||||
variance.kind = "plus";
|
||||
} else {
|
||||
variance.kind = "minus";
|
||||
}
|
||||
this.next();
|
||||
this.finishNode(variance, "Variance");
|
||||
}
|
||||
return variance;
|
||||
};
|
||||
@ -1101,7 +1105,6 @@ export default function (instance) {
|
||||
// parse class property type annotations
|
||||
instance.extend("parseClassProperty", function (inner) {
|
||||
return function (node) {
|
||||
delete node.variancePos;
|
||||
if (this.match(tt.colon)) {
|
||||
node.typeAnnotation = this.flowParseTypeAnnotation();
|
||||
}
|
||||
@ -1127,10 +1130,9 @@ export default function (instance) {
|
||||
instance.extend("parseClassMethod", function (inner) {
|
||||
return function (classBody, method, ...args) {
|
||||
if (method.variance) {
|
||||
this.unexpected(method.variancePos);
|
||||
this.unexpected(method.variance.start);
|
||||
}
|
||||
delete method.variance;
|
||||
delete method.variancePos;
|
||||
if (this.isRelational("<")) {
|
||||
method.typeParameters = this.flowParseTypeParameterDeclaration();
|
||||
}
|
||||
@ -1165,11 +1167,9 @@ export default function (instance) {
|
||||
|
||||
instance.extend("parsePropertyName", function (inner) {
|
||||
return function (node) {
|
||||
const variancePos = this.state.start;
|
||||
const variance = this.flowParseVariance();
|
||||
const key = inner.call(this, node);
|
||||
node.variance = variance;
|
||||
node.variancePos = variancePos;
|
||||
return key;
|
||||
};
|
||||
});
|
||||
@ -1178,10 +1178,9 @@ export default function (instance) {
|
||||
instance.extend("parseObjPropValue", function (inner) {
|
||||
return function (prop) {
|
||||
if (prop.variance) {
|
||||
this.unexpected(prop.variancePos);
|
||||
this.unexpected(prop.variance.start);
|
||||
}
|
||||
delete prop.variance;
|
||||
delete prop.variancePos;
|
||||
|
||||
let typeParameters;
|
||||
|
||||
@ -1389,8 +1388,7 @@ export default function (instance) {
|
||||
|
||||
arrowExpression = inner.apply(this, args);
|
||||
arrowExpression.typeParameters = typeParameters;
|
||||
arrowExpression.start = typeParameters.start;
|
||||
arrowExpression.loc.start = typeParameters.loc.start;
|
||||
this.resetStartLocationFromNode(arrowExpression, typeParameters);
|
||||
} catch (err) {
|
||||
throw jsxError || err;
|
||||
}
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
// Adapted from String.fromcodepoint to export the function without modifying String
|
||||
/*! https://mths.be/fromcodepoint v0.2.1 by @mathias */
|
||||
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) Mathias Bynens
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
||||
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
let fromCodePoint = String.fromCodePoint;
|
||||
|
||||
if (!fromCodePoint) {
|
||||
const stringFromCharCode = String.fromCharCode;
|
||||
const floor = Math.floor;
|
||||
fromCodePoint = function() {
|
||||
const MAX_SIZE = 0x4000;
|
||||
const codeUnits = [];
|
||||
let highSurrogate;
|
||||
let lowSurrogate;
|
||||
let index = -1;
|
||||
const length = arguments.length;
|
||||
if (!length) {
|
||||
return "";
|
||||
}
|
||||
let result = "";
|
||||
while (++index < length) {
|
||||
let codePoint = Number(arguments[index]);
|
||||
if (
|
||||
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
|
||||
codePoint < 0 || // not a valid Unicode code point
|
||||
codePoint > 0x10FFFF || // not a valid Unicode code point
|
||||
floor(codePoint) != codePoint // not an integer
|
||||
) {
|
||||
throw RangeError("Invalid code point: " + codePoint);
|
||||
}
|
||||
if (codePoint <= 0xFFFF) { // BMP code point
|
||||
codeUnits.push(codePoint);
|
||||
} else { // Astral code point; split in surrogate halves
|
||||
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
codePoint -= 0x10000;
|
||||
highSurrogate = (codePoint >> 10) + 0xD800;
|
||||
lowSurrogate = (codePoint % 0x400) + 0xDC00;
|
||||
codeUnits.push(highSurrogate, lowSurrogate);
|
||||
}
|
||||
if (index + 1 == length || codeUnits.length > MAX_SIZE) {
|
||||
result += stringFromCharCode.apply(null, codeUnits);
|
||||
codeUnits.length = 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
export default fromCodePoint;
|
||||
@ -1,5 +1,3 @@
|
||||
import fromCodePoint from "./fromCodePoint";
|
||||
|
||||
import XHTMLEntities from "./xhtml";
|
||||
import { TokenType, types as tt } from "../../tokenizer/types";
|
||||
import { TokContext, types as tc } from "../../tokenizer/context";
|
||||
@ -136,11 +134,11 @@ pp.jsxReadEntity = function() {
|
||||
if (str[1] === "x") {
|
||||
str = str.substr(2);
|
||||
if (HEX_NUMBER.test(str))
|
||||
entity = fromCodePoint(parseInt(str, 16));
|
||||
entity = String.fromCodePoint(parseInt(str, 16));
|
||||
} else {
|
||||
str = str.substr(1);
|
||||
if (DECIMAL_NUMBER.test(str))
|
||||
entity = fromCodePoint(parseInt(str, 10));
|
||||
entity = String.fromCodePoint(parseInt(str, 10));
|
||||
}
|
||||
} else {
|
||||
entity = XHTMLEntities[str];
|
||||
|
||||
@ -4,14 +4,14 @@ import { lineBreakG } from "./whitespace";
|
||||
// `startLoc` and `endLoc` properties.
|
||||
|
||||
export class Position {
|
||||
constructor(line, col) {
|
||||
constructor(line: number, col: number) {
|
||||
this.line = line;
|
||||
this.column = col;
|
||||
}
|
||||
}
|
||||
|
||||
export class SourceLocation {
|
||||
constructor(start, end) {
|
||||
constructor(start: Position, end?: Position) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
3
test/fixtures/comments/basic/block-trailing-comment/expected.json
vendored
Executable file → Normal file
3
test/fixtures/comments/basic/block-trailing-comment/expected.json
vendored
Executable file → Normal file
@ -83,7 +83,8 @@
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
|
||||
3
test/fixtures/comments/basic/comment-within-condition/expected.json
vendored
Executable file → Normal file
3
test/fixtures/comments/basic/comment-within-condition/expected.json
vendored
Executable file → Normal file
@ -54,7 +54,8 @@
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a",
|
||||
"leadingComments": [
|
||||
|
||||
6
test/fixtures/comments/basic/export-default-anonymous-class/expected.json
vendored
Executable file → Normal file
6
test/fixtures/comments/basic/export-default-anonymous-class/expected.json
vendored
Executable file → Normal file
@ -87,6 +87,7 @@
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"static": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
@ -100,16 +101,17 @@
|
||||
"end": {
|
||||
"line": 8,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "method1"
|
||||
},
|
||||
"name": "method1",
|
||||
"leadingComments": null
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
|
||||
@ -69,9 +69,11 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "spawn"
|
||||
},
|
||||
"name": "spawn"
|
||||
"name": "spawn",
|
||||
"leadingComments": null
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
@ -85,10 +87,12 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "spawn"
|
||||
},
|
||||
"name": "spawn"
|
||||
}
|
||||
},
|
||||
"leadingComments": null
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
@ -151,4 +155,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -101,9 +101,11 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "spawn"
|
||||
},
|
||||
"name": "spawn"
|
||||
"name": "spawn",
|
||||
"leadingComments": null
|
||||
},
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
@ -117,15 +119,18 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "spawn"
|
||||
},
|
||||
"name": "spawn"
|
||||
},
|
||||
"leadingComments": null,
|
||||
"extra": {
|
||||
"shorthand": true
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"leadingComments": null
|
||||
},
|
||||
"init": {
|
||||
"type": "Identifier",
|
||||
@ -139,10 +144,12 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
}
|
||||
},
|
||||
"leadingComments": null
|
||||
}
|
||||
],
|
||||
"kind": "var",
|
||||
@ -186,4 +193,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
7
test/fixtures/comments/basic/surrounding-call-comments/expected.json
vendored
Executable file → Normal file
7
test/fixtures/comments/basic/surrounding-call-comments/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
@ -116,7 +118,8 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo",
|
||||
"leadingComments": null
|
||||
|
||||
4
test/fixtures/comments/basic/surrounding-debugger-comments/expected.json
vendored
Executable file → Normal file
4
test/fixtures/comments/basic/surrounding-debugger-comments/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
|
||||
4
test/fixtures/comments/basic/surrounding-return-comments/expected.json
vendored
Executable file → Normal file
4
test/fixtures/comments/basic/surrounding-return-comments/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
|
||||
4
test/fixtures/comments/basic/surrounding-throw-comments/expected.json
vendored
Executable file → Normal file
4
test/fixtures/comments/basic/surrounding-throw-comments/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
|
||||
7
test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json
vendored
Executable file → Normal file
7
test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "f"
|
||||
},
|
||||
"name": "f"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
@ -204,7 +206,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 65
|
||||
}
|
||||
},
|
||||
"identifierName": "each"
|
||||
},
|
||||
"name": "each",
|
||||
"leadingComments": null
|
||||
|
||||
13
test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json
vendored
Executable file → Normal file
13
test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
@ -73,7 +75,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
}
|
||||
@ -119,7 +122,8 @@
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -252,7 +256,8 @@
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"identifierName": "doIt"
|
||||
},
|
||||
"name": "doIt"
|
||||
},
|
||||
|
||||
6
test/fixtures/comments/basic/switch-fallthrough-comment/expected.json
vendored
Executable file → Normal file
6
test/fixtures/comments/basic/switch-fallthrough-comment/expected.json
vendored
Executable file → Normal file
@ -54,7 +54,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -187,7 +188,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"identifierName": "doIt"
|
||||
},
|
||||
"name": "doIt"
|
||||
},
|
||||
|
||||
10
test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json
vendored
Executable file → Normal file
10
test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json
vendored
Executable file → Normal file
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
@ -73,7 +75,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
}
|
||||
@ -119,7 +122,8 @@
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
|
||||
43
test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json
vendored
Executable file → Normal file
43
test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json
vendored
Executable file → Normal file
@ -83,7 +83,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"identifierName": "module"
|
||||
},
|
||||
"name": "module"
|
||||
},
|
||||
@ -99,7 +100,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"identifierName": "exports"
|
||||
},
|
||||
"name": "exports"
|
||||
},
|
||||
@ -122,6 +124,7 @@
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
@ -135,7 +138,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 33
|
||||
}
|
||||
},
|
||||
"identifierName": "context"
|
||||
},
|
||||
"name": "context"
|
||||
}
|
||||
@ -181,12 +185,14 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"identifierName": "isConstant"
|
||||
},
|
||||
"name": "isConstant"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
@ -200,7 +206,8 @@
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"identifierName": "node"
|
||||
},
|
||||
"name": "node"
|
||||
}
|
||||
@ -260,7 +267,8 @@
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"identifierName": "node"
|
||||
},
|
||||
"name": "node"
|
||||
},
|
||||
@ -276,7 +284,8 @@
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"identifierName": "type"
|
||||
},
|
||||
"name": "type"
|
||||
},
|
||||
@ -338,7 +347,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 33
|
||||
}
|
||||
},
|
||||
"identifierName": "isConstant"
|
||||
},
|
||||
"name": "isConstant"
|
||||
},
|
||||
@ -383,7 +393,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"identifierName": "node"
|
||||
},
|
||||
"name": "node"
|
||||
},
|
||||
@ -399,7 +410,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 50
|
||||
}
|
||||
},
|
||||
"identifierName": "expressions"
|
||||
},
|
||||
"name": "expressions"
|
||||
},
|
||||
@ -459,7 +471,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 55
|
||||
}
|
||||
},
|
||||
"identifierName": "node"
|
||||
},
|
||||
"name": "node"
|
||||
},
|
||||
@ -475,7 +488,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 67
|
||||
}
|
||||
},
|
||||
"identifierName": "expressions"
|
||||
},
|
||||
"name": "expressions"
|
||||
},
|
||||
@ -493,7 +507,8 @@
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 74
|
||||
}
|
||||
},
|
||||
"identifierName": "length"
|
||||
},
|
||||
"name": "length"
|
||||
},
|
||||
@ -631,4 +646,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
3
test/fixtures/comments/basic/switch-no-default-comment/expected.json
vendored
Executable file → Normal file
3
test/fixtures/comments/basic/switch-no-default-comment/expected.json
vendored
Executable file → Normal file
@ -54,7 +54,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
|
||||
@ -74,7 +74,8 @@
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
"filename": "path/to/input-file.js",
|
||||
"identifierName": "node"
|
||||
},
|
||||
"name": "node",
|
||||
"leadingComments": null
|
||||
|
||||
@ -68,4 +68,4 @@
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,292 +168,5 @@
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
},
|
||||
"comments": [],
|
||||
"tokens": [
|
||||
{
|
||||
"type": {
|
||||
"label": "name",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"value": "call",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "(",
|
||||
"beforeExpr": true,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "num",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null,
|
||||
"updateContext": null
|
||||
},
|
||||
"value": 1,
|
||||
"start": 5,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": ")",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": false,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": ";",
|
||||
"beforeExpr": true,
|
||||
"startsExpr": false,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null,
|
||||
"updateContext": null
|
||||
},
|
||||
"start": 7,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "name",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"value": "run",
|
||||
"start": 9,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "(",
|
||||
"beforeExpr": true,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "num",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": true,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null,
|
||||
"updateContext": null
|
||||
},
|
||||
"value": 2,
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": ")",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": false,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null
|
||||
},
|
||||
"start": 14,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": ";",
|
||||
"beforeExpr": true,
|
||||
"startsExpr": false,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null,
|
||||
"updateContext": null
|
||||
},
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"label": "eof",
|
||||
"beforeExpr": false,
|
||||
"startsExpr": false,
|
||||
"rightAssociative": false,
|
||||
"isLoop": false,
|
||||
"isAssign": false,
|
||||
"prefix": false,
|
||||
"postfix": false,
|
||||
"binop": null,
|
||||
"updateContext": null
|
||||
},
|
||||
"start": 16,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
3
test/fixtures/core/opts/ranges-false/actual.js
vendored
Normal file
3
test/fixtures/core/opts/ranges-false/actual.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
var a = 1;
|
||||
|
||||
var b = a + 1;
|
||||
207
test/fixtures/core/opts/ranges-false/expected.json
vendored
Normal file
207
test/fixtures/core/opts/ranges-false/expected.json
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 12,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 16,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "b"
|
||||
},
|
||||
"name": "b"
|
||||
},
|
||||
"init": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 20,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"operator": "+",
|
||||
"right": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 24,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/core/opts/ranges-true/actual.js
vendored
Normal file
3
test/fixtures/core/opts/ranges-true/actual.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
var a = 1;
|
||||
|
||||
var b = a + 1;
|
||||
255
test/fixtures/core/opts/ranges-true/expected.json
vendored
Normal file
255
test/fixtures/core/opts/ranges-true/expected.json
vendored
Normal file
@ -0,0 +1,255 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
26
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
26
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
10
|
||||
],
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
9
|
||||
],
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
5
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
9
|
||||
],
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 12,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
12,
|
||||
26
|
||||
],
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 16,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
25
|
||||
],
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "b"
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
17
|
||||
],
|
||||
"name": "b"
|
||||
},
|
||||
"init": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 20,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
20,
|
||||
25
|
||||
],
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"range": [
|
||||
20,
|
||||
21
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"operator": "+",
|
||||
"right": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 24,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
25
|
||||
],
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/core/opts/ranges-true/options.json
vendored
Normal file
3
test/fixtures/core/opts/ranges-true/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"ranges": true
|
||||
}
|
||||
@ -54,12 +54,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
@ -117,7 +119,8 @@
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -58,6 +58,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -68,13 +68,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "Button"
|
||||
},
|
||||
"name": "Button"
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -68,13 +68,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "Button"
|
||||
},
|
||||
"name": "Button"
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -91,6 +92,7 @@
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -91,6 +92,7 @@
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -96,7 +96,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -114,7 +115,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
@ -123,6 +125,7 @@
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -98,7 +99,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
@ -107,6 +109,7 @@
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -98,7 +99,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
@ -107,6 +109,7 @@
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -96,13 +96,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"arguments": [],
|
||||
"extra": {
|
||||
"parenthesized": true
|
||||
"parenthesized": true,
|
||||
"parenStart": 0
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
@ -117,7 +119,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
@ -85,7 +86,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
@ -101,13 +103,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"identifierName": "baz"
|
||||
},
|
||||
"name": "baz"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,11 +68,13 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo",
|
||||
"extra": {
|
||||
"parenthesized": true
|
||||
"parenthesized": true,
|
||||
"parenStart": 0
|
||||
}
|
||||
},
|
||||
"arguments": []
|
||||
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"identifierName": "milkyway"
|
||||
},
|
||||
"name": "milkyway"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -98,7 +99,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"identifierName": "milkyway"
|
||||
},
|
||||
"name": "milkyway"
|
||||
},
|
||||
@ -116,13 +118,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"identifierName": "solarsystem"
|
||||
},
|
||||
"name": "solarsystem"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -96,7 +96,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -112,7 +113,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"identifierName": "milkyway"
|
||||
},
|
||||
"name": "milkyway"
|
||||
},
|
||||
@ -130,7 +132,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"identifierName": "solarsystem"
|
||||
},
|
||||
"name": "solarsystem"
|
||||
},
|
||||
@ -148,13 +151,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"identifierName": "Earth"
|
||||
},
|
||||
"name": "Earth"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -99,7 +100,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"identifierName": "galaxyName"
|
||||
},
|
||||
"name": "galaxyName"
|
||||
},
|
||||
@ -115,7 +117,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"identifierName": "otherUselessName"
|
||||
},
|
||||
"name": "otherUselessName"
|
||||
}
|
||||
@ -124,6 +127,7 @@
|
||||
"computed": true
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"identifierName": "galaxyName"
|
||||
},
|
||||
"name": "galaxyName"
|
||||
},
|
||||
"computed": true
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -120,7 +121,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"identifierName": "galaxies"
|
||||
},
|
||||
"name": "galaxies"
|
||||
},
|
||||
|
||||
@ -82,7 +82,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -121,7 +122,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"identifierName": "galaxies"
|
||||
},
|
||||
"name": "galaxies"
|
||||
},
|
||||
|
||||
@ -110,7 +110,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -149,7 +150,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"identifierName": "galaxies"
|
||||
},
|
||||
"name": "galaxies"
|
||||
},
|
||||
@ -230,7 +232,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"identifierName": "milkyway"
|
||||
},
|
||||
"name": "milkyway"
|
||||
},
|
||||
|
||||
@ -110,7 +110,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "earth"
|
||||
},
|
||||
"name": "earth"
|
||||
},
|
||||
@ -126,7 +127,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"identifierName": "asia"
|
||||
},
|
||||
"name": "asia"
|
||||
},
|
||||
@ -144,7 +146,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"identifierName": "Indonesia"
|
||||
},
|
||||
"name": "Indonesia"
|
||||
},
|
||||
@ -162,7 +165,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
}
|
||||
},
|
||||
"identifierName": "prepareForElection"
|
||||
},
|
||||
"name": "prepareForElection"
|
||||
},
|
||||
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "if"
|
||||
},
|
||||
"name": "if"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "true"
|
||||
},
|
||||
"name": "true"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"identifierName": "false"
|
||||
},
|
||||
"name": "false"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "universe"
|
||||
},
|
||||
"name": "universe"
|
||||
},
|
||||
@ -84,13 +85,15 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"identifierName": "null"
|
||||
},
|
||||
"name": "null"
|
||||
},
|
||||
"computed": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"identifierName": "eval"
|
||||
},
|
||||
"name": "eval"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"identifierName": "eval"
|
||||
},
|
||||
"name": "eval"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"identifierName": "arguments"
|
||||
},
|
||||
"name": "arguments"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"identifierName": "arguments"
|
||||
},
|
||||
"name": "arguments"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"identifierName": "日本語"
|
||||
},
|
||||
"name": "日本語"
|
||||
},
|
||||
@ -91,6 +92,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"identifierName": "eval"
|
||||
},
|
||||
"name": "eval"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"identifierName": "eval"
|
||||
},
|
||||
"name": "eval"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "arguments"
|
||||
},
|
||||
"name": "arguments"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"identifierName": "arguments"
|
||||
},
|
||||
"name": "arguments"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"identifierName": "T‿"
|
||||
},
|
||||
"name": "T‿"
|
||||
},
|
||||
@ -91,6 +92,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -70,12 +70,17 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"extra": {
|
||||
"parenthesizedArgument": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
@ -85,12 +86,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "y"
|
||||
},
|
||||
"name": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,8 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
@ -85,12 +86,14 @@
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"identifierName": "y"
|
||||
},
|
||||
"name": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user