Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dynamic Imports and BigInt as ES2020 #198

Merged
merged 5 commits into from Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions es2020.md
@@ -0,0 +1,43 @@
This document specifies the extensions to the core ESTree AST types to support the ES2020 grammar.

# Literal

```js
extend interface Literal <: Expression {
type: "Literal";
value: string | boolean | null | number | RegExp | bigint;
}
```

- `value` property can be a `BigInt` value to represent `BigInt` literals
such as `100n`.

## BigIntLiteral

```js
interface BigIntLiteral <: Literal {
bigint: string;
}
```

- `bigint` property is the string representation of the `BigInt` value.
It doesn't include the suffix `n`.
- In environments that don't support `BigInt` values, `value` property will be
mysticatea marked this conversation as resolved.
Show resolved Hide resolved
`null` as the `BigInt` value can't be represented natively.

# Expressions

## ImportExpression

```js
interface ImportExpression <: Expression {
type: "ImportExpression";
source: Expression;
}
```

- `ImportExpression` node represents Dynamic Imports such as `import(source)`.
The `source` property is the importing source as similar to [ImportExpression]
node, but it can be an arbitrary expression node.

[ImportExpression]: es2015.md#importdeclaration
13 changes: 0 additions & 13 deletions experimental/import-expression.md

This file was deleted.