diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2019-07-12 08:53:01 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-07-15 00:04:50 +0200 |
commit | 60a207f5f2cbfcaf1045726e87859c67cfdbd15b (patch) | |
tree | c2c8ded69bc1d62564c1e1bbbcee5c257c356661 /deps/acorn-plugins | |
parent | 00464b5282724a693582079244c09a1cba5d8e08 (diff) | |
download | node-new-60a207f5f2cbfcaf1045726e87859c67cfdbd15b.tar.gz |
deps: update acorn to 6.2.0
Includes support for bigint syntax so we can remove the acorn-bigint
plugin.
PR-URL: https://github.com/nodejs/node/pull/28649
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'deps/acorn-plugins')
-rw-r--r-- | deps/acorn-plugins/acorn-bigint/CHANGELOG.md | 21 | ||||
-rw-r--r-- | deps/acorn-plugins/acorn-bigint/LICENSE | 19 | ||||
-rw-r--r-- | deps/acorn-plugins/acorn-bigint/README.md | 21 | ||||
-rw-r--r-- | deps/acorn-plugins/acorn-bigint/index.js | 59 | ||||
-rw-r--r-- | deps/acorn-plugins/acorn-bigint/package.json | 65 |
5 files changed, 0 insertions, 185 deletions
diff --git a/deps/acorn-plugins/acorn-bigint/CHANGELOG.md b/deps/acorn-plugins/acorn-bigint/CHANGELOG.md deleted file mode 100644 index 1d12d708f2..0000000000 --- a/deps/acorn-plugins/acorn-bigint/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -## 0.4.0 (2019-04-04) - -* Make compatible with acorn-numeric-separator - -## 0.3.1 (2018-10-06) - -* Fix creation of BigInt values everywhere (Thanks, Gus Caplan!) - -## 0.3.0 (2018-09-14) - -* Update to new acorn 6 interface -* Actually support creating BigInt values in AST in Chrome -* Change license to MIT - -## 0.2.0 (2017-12-20) - -* Emit BigInt values in AST if supported by runtime engine - -## 0.1.0 (2017-12-19) - -Initial release diff --git a/deps/acorn-plugins/acorn-bigint/LICENSE b/deps/acorn-plugins/acorn-bigint/LICENSE deleted file mode 100644 index 7c2b27a19c..0000000000 --- a/deps/acorn-plugins/acorn-bigint/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2017-2018 by Adrian Heine - -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. diff --git a/deps/acorn-plugins/acorn-bigint/README.md b/deps/acorn-plugins/acorn-bigint/README.md deleted file mode 100644 index b0b6bb5554..0000000000 --- a/deps/acorn-plugins/acorn-bigint/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# BigInt support for Acorn - -[![NPM version](https://img.shields.io/npm/v/acorn-bigint.svg)](https://www.npmjs.org/package/acorn-bigint) - -This is a plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. - -It implements support for arbitrary precision integers as defined in the stage 3 proposal [BigInt: Arbitrary precision integers in JavaScript](https://github.com/tc39/proposal-bigint). The emitted AST follows [an ESTree proposal](https://github.com/estree/estree/blob/132be9b9ec376adbc082dd5f6ba78aefd7a1a864/experimental/bigint.md). - -## Usage - -This module provides a plugin that can be used to extend the Acorn `Parser` class: - -```javascript -const {Parser} = require('acorn'); -const bigInt = require('acorn-bigint'); -Parser.extend(bigInt).parse('100n'); -``` - -## License - -This plugin is released under an [MIT License](./LICENSE). diff --git a/deps/acorn-plugins/acorn-bigint/index.js b/deps/acorn-plugins/acorn-bigint/index.js deleted file mode 100644 index 8e63515e11..0000000000 --- a/deps/acorn-plugins/acorn-bigint/index.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict" - -const acorn = require('internal/deps/acorn/acorn/dist/acorn') -const tt = acorn.tokTypes -const isIdentifierStart = acorn.isIdentifierStart - -module.exports = function(Parser) { - return class extends Parser { - parseLiteral(value) { - const node = super.parseLiteral(value) - if (node.raw.charCodeAt(node.raw.length - 1) == 110) node.bigint = this.getNumberInput(node.start, node.end) - return node - } - - readRadixNumber(radix) { - let start = this.pos - this.pos += 2 // 0x - let val = this.readInt(radix) - if (val === null) this.raise(this.start + 2, `Expected number in radix ${radix}`) - if (this.input.charCodeAt(this.pos) == 110) { - let str = this.getNumberInput(start, this.pos) - val = typeof BigInt !== "undefined" ? BigInt(str) : null - ++this.pos - } else if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number") - return this.finishToken(tt.num, val) - } - - readNumber(startsWithDot) { - let start = this.pos - - // Not an int - if (startsWithDot) return super.readNumber(startsWithDot) - - // Legacy octal - if (this.input.charCodeAt(start) === 48 && this.input.charCodeAt(start + 1) !== 110) { - return super.readNumber(startsWithDot) - } - - if (this.readInt(10) === null) this.raise(start, "Invalid number") - - // Not a BigInt, reset and parse again - if (this.input.charCodeAt(this.pos) != 110) { - this.pos = start - return super.readNumber(startsWithDot) - } - - let str = this.getNumberInput(start, this.pos) - let val = typeof BigInt !== "undefined" ? BigInt(str) : null - ++this.pos - return this.finishToken(tt.num, val) - } - - // This is basically a hook for acorn-numeric-separator - getNumberInput(start, end) { - if (super.getNumberInput) return super.getNumberInput(start, end) - return this.input.slice(start, end) - } - } -} diff --git a/deps/acorn-plugins/acorn-bigint/package.json b/deps/acorn-plugins/acorn-bigint/package.json deleted file mode 100644 index 073cdfb86c..0000000000 --- a/deps/acorn-plugins/acorn-bigint/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "acorn-bigint", - "_id": "acorn-bigint@0.4.0", - "_inBundle": false, - "_integrity": "sha512-W9iaqWzqFo7ZBLmI9dMjHYGrN0Nm/ZgToqhvd3RELJux7RsX6k1/80h+bD9TtTpeKky/kYNbr3+vHWqI3hdyfA==", - "_location": "/acorn-bigint", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "acorn-bigint", - "name": "acorn-bigint", - "escapedName": "acorn-bigint", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/acorn-bigint/-/acorn-bigint-0.4.0.tgz", - "_shasum": "af3245ed8a7c3747387fca4680ae1960f617c4cd", - "_spec": "acorn-bigint", - "_where": "/home/ruben/repos/node/node", - "bugs": { - "url": "https://github.com/acornjs/acorn-bigint/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Adrian Heine", - "email": "mail@adrianheine.de" - } - ], - "deprecated": false, - "description": "Support for BigInt in acorn", - "devDependencies": { - "acorn": "^6.1.1", - "eslint": "^5.16.0", - "eslint-plugin-node": "^8.0.1", - "mocha": "^6.0.2", - "test262": "git+https://github.com/tc39/test262.git#611919174ffe060503691a0c7e3eb2a65b646124", - "test262-parser-runner": "^0.5.0" - }, - "engines": { - "node": ">=4.8.2" - }, - "homepage": "https://github.com/acornjs/acorn-bigint", - "license": "MIT", - "name": "acorn-bigint", - "peerDependencies": { - "acorn": "^6.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/acornjs/acorn-bigint.git" - }, - "scripts": { - "lint": "eslint -c .eslintrc.json .", - "test": "mocha", - "test:test262": "node run_test262.js" - }, - "version": "0.4.0" -} |