From 6acb9e5f2f4c916c6a9b65ef7e42668df455b082 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 19 Feb 2020 13:38:34 +0200 Subject: [PATCH] support TypeScript 3.8 --- package.json | 2 +- tests/typescript_class/standard_private_fields.ts | 11 +++++++++++ tests/typescript_export/export-as-ns.ts | 1 + tests/typescript_import_export/jsfmt.spec.js | 1 + tests/typescript_import_export/type-modifier.ts | 5 +++++ yarn.lock | 8 ++++---- 6 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 tests/typescript_class/standard_private_fields.ts create mode 100644 tests/typescript_export/export-as-ns.ts create mode 100644 tests/typescript_import_export/jsfmt.spec.js create mode 100644 tests/typescript_import_export/type-modifier.ts diff --git a/package.json b/package.json index 028c390318ac..17bbd21a6e82 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "semver": "7.1.3", "srcset": "2.0.1", "string-width": "4.2.0", - "typescript": "3.7.5", + "typescript": "3.8.1-rc", "unicode-regex": "3.0.0", "unified": "8.4.2", "vnopts": "1.0.2", diff --git a/tests/typescript_class/standard_private_fields.ts b/tests/typescript_class/standard_private_fields.ts new file mode 100644 index 000000000000..30c39cf207f1 --- /dev/null +++ b/tests/typescript_class/standard_private_fields.ts @@ -0,0 +1,11 @@ +class Square { + #sideLength: number; + + constructor(sideLength: number) { + this.#sideLength = sideLength; + } + + equals(other: any) { + return this.#sideLength === other.#sideLength; + } +} diff --git a/tests/typescript_export/export-as-ns.ts b/tests/typescript_export/export-as-ns.ts new file mode 100644 index 000000000000..18be0e6c74af --- /dev/null +++ b/tests/typescript_export/export-as-ns.ts @@ -0,0 +1 @@ +export * as utilities from "./utilities.js"; diff --git a/tests/typescript_import_export/jsfmt.spec.js b/tests/typescript_import_export/jsfmt.spec.js new file mode 100644 index 000000000000..2ea3bb6eb2e4 --- /dev/null +++ b/tests/typescript_import_export/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["typescript"]); diff --git a/tests/typescript_import_export/type-modifier.ts b/tests/typescript_import_export/type-modifier.ts new file mode 100644 index 000000000000..85727b127fb3 --- /dev/null +++ b/tests/typescript_import_export/type-modifier.ts @@ -0,0 +1,5 @@ +import type { SomeThing } from "./some-module.js"; +export type { SomeThing }; + +import type Foo from "./foo.js"; +export type Foo; diff --git a/yarn.lock b/yarn.lock index 10f41c7e079f..f894dbc47162 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7670,10 +7670,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.7.5: - version "3.7.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" - integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== +typescript@3.8.1-rc: + version "3.8.1-rc" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.1-rc.tgz#f94333c14da70927ccd887be2e91be652a9a09f6" + integrity sha512-aOIe066DyZn2uYIiND6fXMUUJ70nxwu/lKhA92QuQzXyC86fr0ywo1qvO8l2m0EnDcfjprYPuFRgNgDj7U2GlQ== uglify-js@^3.1.4: version "3.7.6"