mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Add support for modern ECMAScript class
features
With ESLint 8 we should now finally be able to start using modern `class` features, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields However, while both ESLint and Acorn now support this, it unfortunately turns out that Escodegen (which we use during building) still lack the necessary support. Looking at https://github.com/estools/escodegen there's not been any updates since last year, and there's also open PRs adding support for these new `class` features. To avoid blocking usage of these `class` features in the PDF.js code-base, in particular *private* fields/methods, this patch thus proposes that we (hopefully temporarily) switch to an `escodegen` fork that has the necessary support; please see https://www.npmjs.com/package/@javascript-obfuscator/escodegen While I have no reason to doubt the security of the `escodegen` fork, this patch nonetheless pins the version number. Furthermore, I've also diffed the output of the two `.js`-files in this forked package against the original files without finding anything that looks immediately "dangerous".
This commit is contained in:
parent
38e5360533
commit
00f8fab8a5
8 changed files with 35 additions and 35 deletions
|
@ -1375,7 +1375,7 @@ gulp.task("jsdoc", function (done) {
|
|||
gulp.task("types", function (done) {
|
||||
console.log("### Generating TypeScript definitions using `tsc`");
|
||||
const args = [
|
||||
"target ES2020",
|
||||
"target ESNext",
|
||||
"allowJS",
|
||||
"declaration",
|
||||
`outDir ${TYPES_DIR}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue