mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
experimentalDecorators and emitDecoratorMetadata affect builder state (#36297)
* experimentalDecorators and emitDecoratorMetadata affect builder state * better test
This commit is contained in:
committed by
Sheetal Nandi
parent
2dd21a08f5
commit
bc1e7728df
@@ -743,12 +743,15 @@ namespace ts {
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Experimental_Options,
|
||||
description: Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
affectsSemanticDiagnostics: true,
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Experimental_Options,
|
||||
description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
},
|
||||
|
||||
@@ -243,6 +243,49 @@ namespace ts.tscWatch {
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "updates diagnostics and emit for decorators",
|
||||
commandLineArgs: ["-w"],
|
||||
sys: () => {
|
||||
const aTs: File = {
|
||||
path: "/a.ts",
|
||||
content: `import {B} from './b'
|
||||
@((_) => {})
|
||||
export class A {
|
||||
constructor(p: B) {}
|
||||
}`,
|
||||
};
|
||||
const bTs: File = {
|
||||
path: "/b.ts",
|
||||
content: `export class B {}`,
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: "/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { target: "es6", importsNotUsedAsValues: "error" }
|
||||
})
|
||||
};
|
||||
return createWatchedSystem([libFile, aTs, bTs, tsconfig]);
|
||||
},
|
||||
changes: [
|
||||
sys => {
|
||||
sys.modifyFile("/tsconfig.json", JSON.stringify({
|
||||
compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true }
|
||||
}));
|
||||
sys.checkTimeoutQueueLengthAndRun(1);
|
||||
return "Enable experimentalDecorators";
|
||||
},
|
||||
sys => {
|
||||
sys.modifyFile("/tsconfig.json", JSON.stringify({
|
||||
compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true, emitDecoratorMetadata: true }
|
||||
}));
|
||||
sys.checkTimeoutQueueLengthAndRun(1);
|
||||
return "Enable emitDecoratorMetadata";
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "files explicitly excluded in config file",
|
||||
|
||||
Reference in New Issue
Block a user