Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of Js Files #5471

Merged
merged 105 commits into from
Nov 20, 2015
Merged

Compilation of Js Files #5471

merged 105 commits into from
Nov 20, 2015

Conversation

sheetalkamat
Copy link
Member

Changes same as #5345 with few modifications and against master
Here is the list of items this PR supports:

  • Allow javascript files to be compiled on command line or through references/imports
  • tsconfig.json can take javascript files as file names to be compiled
  • If filenames are not specified in tsconfig.json, javascript files in the folder and not part of compilation
  • compiler options now have a flag named "allowJs" which when true will pick up javascript files in the folder for compilation if tscconfig.json doesn't supply file name list
  • Moved reporting of usage of typescript syntax in javascript file from services to compiler
  • Reports error if output is overwriting any of the input files (TypeScript should error on duplicate output locations #4424)
  • Reports error if output is not unique location and multiple input files overwrite same output file (TypeScript should error on duplicate output locations #4424)
  • .ts, .tsx and .d.ts files take precedence over .js files when creating list of files for compilation
  • Project runner options cleanup
  • Project runner to accept tsconfig.json tests
  • Bundle js files into --out and copy into --outDir
  • Transpilation of javascript files
  • JavaScript files do not emit declaration files and it is error to specify --allowJs and --declaration together

…sent and tsconfig doesnt specify any filenames
- Command line now takes --jsExtension multiple times or comma separated list of extensions
- tsconfig accepts array of extension strings
…fig.json

Since we dont support arbitary list of extensions to treat as .js,
it becomes easier to simplify code based on the assumptions
…pported javascript extensions instead of just .js
@@ -12033,7 +12034,11 @@ namespace ts {
const symbol = getSymbolOfNode(node);
const localSymbol = node.localSymbol || symbol;

const firstDeclaration = getDeclarationOfKind(localSymbol, node.kind);
const firstDeclaration = forEach(symbol.declarations,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a comment

  • why we are not picking the first declaration if it originates in javascript file
  • why we are using symbol instead of localSymbol
    ?

@vladima
Copy link
Contributor

vladima commented Nov 17, 2015

looks good modulo few comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants