TypeScript: temp fix for missing readonly keyword (#1865)
* fix(typescript): temp fix for missing readonly keyword, fixes #1845 * fix(typescript): use non-master commit from tsep
This commit is contained in:
1 parent
8511e798dc
commit
38eec13a03
8 files changed
+27
-7
No files matched your search
+1
-1
@@ -42,7 +42,7 @@
|
|||||||
"rollup-plugin-node-resolve": "2.0.0",
|
"rollup-plugin-node-resolve": "2.0.0",
|
||||||
"rollup-plugin-replace": "1.1.1",
|
"rollup-plugin-replace": "1.1.1",
|
||||||
"typescript": "2.3.2",
|
"typescript": "2.3.2",
|
||||||
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#3dcba7d53f61f51069ed84b57e053802c014d703",
|
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#32634f10b8c9bc4622762867d9d00e79ea1092fe",
|
||||||
"uglify-es": "mishoo/UglifyJS2#harmony",
|
"uglify-es": "mishoo/UglifyJS2#harmony",
|
||||||
"webpack": "2.6.1"
|
"webpack": "2.6.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1674,6 +1674,9 @@ function genericPrintNoParens(path, options, print, args) {
|
|||||||
if (n.type === "TSAbstractClassProperty") {
|
if (n.type === "TSAbstractClassProperty") {
|
||||||
parts.push("abstract ");
|
parts.push("abstract ");
|
||||||
}
|
}
|
||||||
|
if (n.readonly) {
|
||||||
|
parts.push("readonly ");
|
||||||
|
}
|
||||||
if (n.computed) {
|
if (n.computed) {
|
||||||
parts.push("[", path.call(print, "key"), "]");
|
parts.push("[", path.call(print, "key"), "]");
|
||||||
} else {
|
} else {
|
||||||
@@ -2237,6 +2240,7 @@ function genericPrintNoParens(path, options, print, args) {
|
|||||||
if (n.static) {
|
if (n.static) {
|
||||||
parts.push("static ");
|
parts.push("static ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.readonly) {
|
if (n.readonly) {
|
||||||
parts.push("readonly ");
|
parts.push("readonly ");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -413,7 +413,7 @@ class C {
|
|||||||
constructor(readonly readonly y: number) {}
|
constructor(readonly readonly y: number) {}
|
||||||
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
class C {
|
class C {
|
||||||
x: number;
|
readonly x: number;
|
||||||
constructor(readonly y: number) {}
|
constructor(readonly y: number) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class ViewTokensChangedEvent {
|
|||||||
}
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
export class ViewTokensChangedEvent {
|
export class ViewTokensChangedEvent {
|
||||||
public ranges: {
|
public readonly ranges: {
|
||||||
/**
|
/**
|
||||||
* Start line number of range
|
* Start line number of range
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`readonly.ts 1`] = `
|
||||||
|
class Foo {
|
||||||
|
public readonly foo = 'string';
|
||||||
|
}
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class Foo {
|
||||||
|
public readonly foo = "string";
|
||||||
|
}
|
||||||
|
|
||||||
|
`;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
run_spec(__dirname, { parser: "typescript" });
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
class Foo {
|
||||||
|
public readonly foo = 'string';
|
||||||
|
}
|
||||||
@@ -1293,7 +1293,7 @@ glob-parent@^2.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-glob "^2.0.0"
|
is-glob "^2.0.0"
|
||||||
|
|
||||||
glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1:
|
glob@7.1.1:
|
||||||
version "7.1.1"
|
version "7.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -1304,7 +1304,7 @@ glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1:
|
|||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
path-is-absolute "^1.0.0"
|
path-is-absolute "^1.0.0"
|
||||||
|
|
||||||
glob@7.1.2:
|
glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1:
|
||||||
version "7.1.2"
|
version "7.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3251,9 +3251,9 @@ typedarray@^0.0.6:
|
|||||||
version "0.0.6"
|
version "0.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
|
|
||||||
"typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#3dcba7d53f61f51069ed84b57e053802c014d703":
|
"typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#32634f10b8c9bc4622762867d9d00e79ea1092fe":
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "git://github.com/eslint/typescript-eslint-parser.git#3dcba7d53f61f51069ed84b57e053802c014d703"
|
resolved "git://github.com/eslint/typescript-eslint-parser.git#32634f10b8c9bc4622762867d9d00e79ea1092fe"
|
||||||
dependencies:
|
dependencies:
|
||||||
lodash.unescape "4.0.1"
|
lodash.unescape "4.0.1"
|
||||||
semver "5.3.0"
|
semver "5.3.0"
|
||||||
|
|||||||
Reference in new issue
Block a user