mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
Rename JS-specific concepts (#26795)
* Rename JS concepts 1. Assignment declaration -- an assignment that is treated like a declaration. Previously called [JS] special (assignment|declaration), among other things. 2. Expando -- a value that can be used as a target in assignment declarations. Currently, a class, function or empty object literal. Functions are allowed in Typescript, too. Previously called a JS container, JS initializer or expando object. 3. JavaScript -> Javascript. This is annoying to type, and looks like 'Java Script' in a camelCase world. Everything is a pure rename as far as I know. The only test change is the API baselines, which reflect the rename from SymbolFlags.JSContainer to SymbolFlags.Assignment. * Remove TODO * Rename Javascript->JS Note that this introduces a variable name collision in a couple of places, which I resolved like this: ```ts const isInJavascript = isInJSFile(node); ```
This commit is contained in:
committed by
GitHub
parent
371ffffc6d
commit
6bd1da20c9
@@ -122,7 +122,7 @@ namespace ts.JsTyping {
|
||||
// Only infer typings for .js and .jsx files
|
||||
fileNames = mapDefined(fileNames, fileName => {
|
||||
const path = normalizePath(fileName);
|
||||
if (hasJavaScriptFileExtension(path)) {
|
||||
if (hasJavascriptFileExtension(path)) {
|
||||
return path;
|
||||
}
|
||||
});
|
||||
@@ -218,7 +218,7 @@ namespace ts.JsTyping {
|
||||
*/
|
||||
function getTypingNamesFromSourceFileNames(fileNames: string[]) {
|
||||
const fromFileNames = mapDefined(fileNames, j => {
|
||||
if (!hasJavaScriptFileExtension(j)) return undefined;
|
||||
if (!hasJavascriptFileExtension(j)) return undefined;
|
||||
|
||||
const inferredTypingName = removeFileExtension(getBaseFileName(j.toLowerCase()));
|
||||
const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName);
|
||||
|
||||
Reference in New Issue
Block a user