* Use merge2, gulp-if, gulp-newer, and more projects * Add watch task * Working non-inline sourcemaps for runtests * browser tests now also loads sourcemaps from disk * Lazypipes and better services stream management * export interface used by other exported functions * Make goto-definition work for `this` parameter * Add new error for rest parameters * Add error message for rest parameter properties * Fix case when a document contains multiple script blocks with different base indentations. Use the base indent size if it is greater that the indentation of the inherited predecessor * Fix rwc-runner from breaking change in compiler (#9284) * Signatures use JSDoc to determine optionality * Changed implementation to use closure * Updated tests * Fixed linting error * Adding Code of Conduct notice * Don't crash when JS class property is self-referential. Fixes #9293 * Remove stale baselines * For optionality, check question token before JSDoc * Accept rest parameter properties error baselines * Change binding pattern parameter property error * Accept binding pattern properties error baselines * Lint * Port the sync version diagnostics API from tsserverVS-WIP branch to 2.0 * Do copyright without gulp-if and lazypipe * Change test comment and accept baseline * Remove tsd scripts task from gulpfile * Make use of module compiler option explicit, add strip internal to tsconfigs * Remove Signature#thisType and use Signature#thisParameter everywhere * Add Gulpfile lint to jake, fix lints * Change reference tests to verify actual ranges referenced and not just their count * Respond to PR comments * Add new lint rule * Fix object whitespace lints * Fix case of gulpfile dependencies * 1. pass subshell args 2. fix build order in services 1. /bin/sh requires its arguments joined into a single string unlike cmd. 2. services/ depends on a couple of files from server/ but the order was implicit, and changed from jakefile. Now the order is explicit in the tsconfig. * Fix single-quote lint * Check for exactly one space * Fix excess whitespace issues * Add matchFiles test to Gulpfile This was merged while the gulpfile was still in-progress * Fix LKG useDebug task and newLine flag * Update LKG * Clean before LKG in Gulpfile * Fix lint * Correct the api string name * Allow space in exec cmds * Fix typo * Add new APIs to protocol * Fix bug where `exports.` was prepended to namespace export accesses * Remove unnecessary parameter * extract expression into function * Add fourslash tests & address CR comments * Fix 8549: Using variable as Jsx tagname (#9337) * Parse JSXElement's name as property access instead of just entity name. So when one accesses property of the class through this, checker will check correctly * wip - just resolve to any type for now * Resolve string type to anytype and look up property in intrinsicElementsType of Jsx * Add tests and update baselines * Remove unneccessary comment * wip-address PR * Address PR * Add tets and update baselines * Fix linting error * Unused identifiers compiler code (#9200) * Code changes to update references of the Identifiers * Added code for handling function, method and coonstructor level local variables and parameters * Rebased with origin master * Code changes to handle unused private variables, private methods and typed parameters * Code changes to handle namespace level elements * Code changes to handle unimplemented interfaces * Code to optimize the d.ts check * Correct Code change to handle the parameters for methods inside interfaces * Fix for lint error * Remove Trailing whitespace * Code changes to handle interface implementations * Changes to display the error position correctly * Compiler Test Cases * Adding condition to ignore constructor parameters * Removing unnecessary tests * Additional changes for compiler code * Additional changes to handle constructor scenario * Fixing the consolidated case * Changed logic to search for private instead of public * Response to PR Comments * Changed the error code in test cases as result of merge with master * Adding the missing file * Adding the missing file II * Response to PR comments * Code changes for checking unused imports * Test Cases for Unused Imports * Response to PR comments * Code change specific to position of Import Declaration * Code change for handling the position for unused import * New scenarios for handling parameters in lambda function, type parameters in methods, etc. * Additional scenarios based on PR comments * Removing a redundant check * Added ambient check to imports and typeparatmeter reporting * Added one more scenario to handle type parameters * Added new scenario for TypeParameter on Interface * Refactoring the code * Added scenario to handle private class elements declared in constructor. * Minor change to erro reporting * Fix 8355: Fix emit metadata different between transpile and tsc --isolatedModule (#9232) * Instead of returning undefined for unknownSymbol return itself * Add Transpile unittest * Wip - Add project tests * Add project tests and baselines * Update existed tests * Add tests for emitting metadata with module targetting system * Fix 8467: Fix incorrect emit for accessing static property in static propertyDeclaration (#8551) * Fix incorrect emit for accessing static property in static propertyDeclaration * Update tests and baselines * Update function name * Fix when accessing static property inside arrow function * Add tests and baselines * do not format comma/closeparen in jsxelement * format jsx expression * Remove extra baselines * Fixed bugs and linting * Added project tests for node_modules JavaScript searches * Removed old TODO comment * make rules optional * Fixed the regexp for removing full paths * Fix type of the disableSizeLimit option * Update version to 2.0.0 * Remove upper boilerplate from issue template Our issue stats did not improve appreciably when we added the issue template. Reduce upper boilerplate text and try to make it more action-oriented * Remove unused compiler option (#9381) * Update LKG * Added emitHost method to return source from node modules * Marked new method internal * Update issue_template.md * new options should be optional for compatibility * Add getCurrentDirectory to ServerHost * Add nullchecks for typeRoots, remove getCurrentDirectory from ServerHost as it is always the installation location * VarDate interface and relevant Date.prototype members * Port 9396 to release 2.0 * Fix 9363: Object destructuring broken-variables are bound to the wrong object (#9383) * Fix emit incorrect destructuring mapping in var declaration * Add tests and baselines * Add additional tests and baselines * Fix crash in async functions when targetting ES5. When targetting ES5 and with --noImplicitReturns, an async function whose return type could not be determined would cause a compiler crash. * Add This type to lib * Merge master into release-2.0 (#9400) * do not format comma/closeparen in jsxelement * format jsx expression * make rules optional * Remove upper boilerplate from issue template Our issue stats did not improve appreciably when we added the issue template. Reduce upper boilerplate text and try to make it more action-oriented * Update issue_template.md * new options should be optional for compatibility * Add getCurrentDirectory to ServerHost * Add nullchecks for typeRoots, remove getCurrentDirectory from ServerHost as it is always the installation location * VarDate interface and relevant Date.prototype members * Fix 9363: Object destructuring broken-variables are bound to the wrong object (#9383) * Fix emit incorrect destructuring mapping in var declaration * Add tests and baselines * Add additional tests and baselines * Fix #9402: Do not report unused identifier errors for catch variables * getVarDate should be on the Date interface * Defere checking unsed identifier checks * Do not scan nodes preceding formatted region, just skip over them * Don't emit source files found under node_modules * Destructuring assignment removes undefined from type when default value is given * Add nullcheck when calculating indentations for implort clause * Use a deferred list to check for unused identifiers * push checks to checkUnusedIdentifiersDeferred * use isParameterPropertyDeclaration to test for paramter propoerties * runtests-parallel skips empty buckets Previously, it would enter them as buckets with no tests, which would make our test runners run *every* test. This was very obvious on machines with lots of cores. * Report unused identifiers in for statements * Do not check ambients, and overloads * Add tests * Consolidate type reference marking in getTypeFromTypeReference * Handel type aliases * Add tests * Add test * Dont load JavaScript if types packages are present * Renamed API * Use checkExpression, not checkExpressionCached * Do not report unused errors for module augmentations * Consolidate refernce marking in resolveName to allow marking aliases correctelly * add tests * Code review comments * Only mark symbols found in a local symbol table * Show "<unknown>" if the name of a declaration is unavailable * Parse `export default async function` as a declaration * Respond to PR comments * Better name for test * handel private properties correctelly * Port 9426 to release 2.0 * Handel Swtich statements check for locals on for statments only mark private properties * Removed one error to avoid full path issues * Don't emit source files found under node_modules (cherry picked from commit5f8cf1af3e
) * Dont load JavaScript if types packages are present (cherry picked from commit5a45c44eb7
) * Renamed API (cherry picked from commitd8047b607f
) * Removed one error to avoid full path issues (cherry picked from commit5e4f13f342
) * Fix incorrectly-saved quote symbols in ThirdPartyNoticeText.txt * Fix #9458: exclude parameters starting with underscore from unusedParamter checks * change variable name for strict mode * Increase timeout from running RWC. As UWDWeb takes slightly longer now (#9454) * Handle relative paths in tsconfig exclude and include globs * Merge master into release branch 06/30 (#9447) * do not format comma/closeparen in jsxelement * format jsx expression * make rules optional * Remove upper boilerplate from issue template Our issue stats did not improve appreciably when we added the issue template. Reduce upper boilerplate text and try to make it more action-oriented * Update issue_template.md * new options should be optional for compatibility * Add getCurrentDirectory to ServerHost * Add nullchecks for typeRoots, remove getCurrentDirectory from ServerHost as it is always the installation location * VarDate interface and relevant Date.prototype members * Fix 9363: Object destructuring broken-variables are bound to the wrong object (#9383) * Fix emit incorrect destructuring mapping in var declaration * Add tests and baselines * Add additional tests and baselines * Fix crash in async functions when targetting ES5. When targetting ES5 and with --noImplicitReturns, an async function whose return type could not be determined would cause a compiler crash. * Add This type to lib * getVarDate should be on the Date interface * Don't emit source files found under node_modules * Destructuring assignment removes undefined from type when default value is given * Add nullcheck when calculating indentations for implort clause * Add test * Dont load JavaScript if types packages are present * Renamed API * Use checkExpression, not checkExpressionCached * Show "<unknown>" if the name of a declaration is unavailable * Parse `export default async function` as a declaration * Removed one error to avoid full path issues * Fix incorrectly-saved quote symbols in ThirdPartyNoticeText.txt * Improve names of whitespace functions * Handle relative paths in tsconfig exclude and include globs Port 9475 to release 2.0 * add new method getEmitOutputObject to return result of the emit as object with properties instead of json string * fix linter * Fix PromiseLike to be compatible with es6-promise (#9484) * Fix reading files from IOLog because previous our API captures (#9483) * Fix reading files from IOLog because previous our API captures * Refactoring the ioLog * Exclude FlowSwitchClause from flow graph for case expressions * Add regression test * Update LKG * Update language in comment * Add .mailmap file * Add authors script to generate authors from repo * Update AUTHORS.md for release-2.0 * Update script to pass more than one argument * Remove the unused text buffer from ScriptInfo * Fix #9531: account for async as an contextual keyword when parsing export assignments * Update LKG * Swap q from a reference to an import * Fix #9550: exclude 'this' type parameters from unusedParameters checks. * Update comment to reflect new dependency * Avoid putting children tags in jsdoccomment * Parse the result of getDirectories call * Update harness getDirectories implementation for shims * Fix multiple Salsa assignment-declarations Previously, all assignment-declarations needed to be of the same kind: either all `this.p = ...` assignments or `C.prototype.p = ...` assignments. * Test for multiple salsa assignment-declarations * Add test for parsed @typedef tag node shape * Provide a symbol for salsa-inferred class types * Update .mailmap * Fix module tracking * Updated test with relative import * Fixed the node tracking and a harness bug * fixed lint error * Fixed implicit any * Added missing test files * Removed duplicate logic * Update conflicting baseline. PR #9574 added a baseline that #9578 caused to be changed. The two PRs went in so close to each other that the CI build didn't catch the change to the new test's baseline. * Fix type of JSXTagName * Update baselines to use double-quote * Update baselines when emitting metadata decorator * Update baselines for async-await function * Update baselines for comment in capturing down-level for...of and for...in * Add missing Transpile tests * Remove old JS transpile baselines * Passing program as argument in emitWorker * Port PR#9607 transforms * Port new JSDOC tests to use baseline * substitute alias for class expression in statics * Address new lint warnings * Change name for substitution function.
871 lines
53 KiB
Plaintext
871 lines
53 KiB
Plaintext
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(15,44): error TS2304: Cannot find name 'SymbolScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(17,15): error TS2304: Cannot find name 'Type'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(18,20): error TS2304: Cannot find name 'Type'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(19,14): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(21,25): error TS2304: Cannot find name 'ScopeChain'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(32,40): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(32,51): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(41,43): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(47,41): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(47,52): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(47,62): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(48,46): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(50,24): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(56,26): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(69,48): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(70,27): error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(71,26): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(72,23): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(85,27): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(89,24): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(99,47): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(100,26): error TS2304: Cannot find name 'InterfaceDeclaration'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(101,26): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(102,23): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(112,28): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(114,28): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(122,28): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(125,28): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(136,51): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(137,30): error TS2304: Cannot find name 'InterfaceDeclaration'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(138,26): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(139,23): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(146,24): error TS2304: Cannot find name 'SymbolTableScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(148,24): error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(155,46): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(156,25): error TS2304: Cannot find name 'WithStatement'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(159,27): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(159,45): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(159,69): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(159,92): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(160,34): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(160,52): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(160,76): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(160,99): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(162,28): error TS2304: Cannot find name 'Type'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(163,30): error TS2304: Cannot find name 'WithSymbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(170,40): error TS2339: Property 'SymbolScopeBuilder' does not exist on type 'typeof TypeScript'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(176,50): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(177,25): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(179,24): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(180,29): error TS2304: Cannot find name 'Symbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(185,24): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(185,51): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(195,41): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(195,68): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(198,40): error TS2304: Cannot find name 'TypeFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(198,63): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(198,90): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(210,85): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(211,23): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(231,38): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(231,74): error TS2304: Cannot find name 'SymbolFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(237,27): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(239,24): error TS2304: Cannot find name 'TypeSymbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(246,47): error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(246,68): error TS2304: Cannot find name 'TypeSymbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(256,51): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(257,23): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(284,38): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(286,55): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(292,43): error TS2304: Cannot find name 'SymbolFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(309,29): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(310,31): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(310,49): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(310,84): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(311,36): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(312,38): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(312,56): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(312,98): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(313,35): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(314,37): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(314,55): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(314,96): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(315,42): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(316,44): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(316,62): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(316,110): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(321,26): error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(322,27): error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(353,26): error TS2304: Cannot find name 'TypeSymbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(354,39): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(354,62): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(363,35): error TS2304: Cannot find name 'ParameterSymbol'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(372,40): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(372,67): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(373,55): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(373,82): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(378,47): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(379,27): error TS2304: Cannot find name 'Catch'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(381,34): error TS2304: Cannot find name 'ScopedMembers'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(381,52): error TS2304: Cannot find name 'DualStringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(381,76): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(381,99): error TS2304: Cannot find name 'StringHashTable'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(382,35): error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(389,42): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(389,55): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(389,68): error TS2304: Cannot find name 'IAstWalker'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(394,33): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(395,29): error TS2304: Cannot find name 'ASTList'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(398,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(401,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(404,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(407,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(410,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(413,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(416,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(424,43): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(424,56): error TS2304: Cannot find name 'AST'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(424,69): error TS2304: Cannot find name 'IAstWalker'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(428,33): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(429,36): error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(438,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(441,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(444,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(447,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(448,33): error TS2304: Cannot find name 'FuncDecl'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(449,49): error TS2304: Cannot find name 'hasFlag'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(449,76): error TS2304: Cannot find name 'FncFlags'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'.
|
|
tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(454,35): error TS2304: Cannot find name 'Catch'.
|
|
|
|
|
|
==== tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts (134 errors) ====
|
|
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
|
|
// See LICENSE.txt in the project root for complete license information.
|
|
|
|
///<reference path='typescript.ts' />
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
|
|
|
module TypeScript {
|
|
|
|
export class AssignScopeContext {
|
|
constructor (public scopeChain: ScopeChain,
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopeChain'.
|
|
public typeFlow: TypeFlow,
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'TypeFlow'.
|
|
public modDeclChain: ModuleDeclaration[]) {
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
}
|
|
}
|
|
|
|
export function pushAssignScope(scope: SymbolScope,
|
|
~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolScope'.
|
|
context: AssignScopeContext,
|
|
type: Type,
|
|
~~~~
|
|
!!! error TS2304: Cannot find name 'Type'.
|
|
classType: Type,
|
|
~~~~
|
|
!!! error TS2304: Cannot find name 'Type'.
|
|
fnc: FuncDecl) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
|
|
var chain = new ScopeChain(null, context.scopeChain, scope);
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopeChain'.
|
|
chain.thisType = type;
|
|
chain.classType = classType;
|
|
chain.fnc = fnc;
|
|
context.scopeChain = chain;
|
|
}
|
|
|
|
export function popAssignScope(context: AssignScopeContext) {
|
|
context.scopeChain = context.scopeChain.previous;
|
|
}
|
|
|
|
export function instanceCompare(a: Symbol, b: Symbol) {
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
if (((a == null) || (!a.isInstanceProperty()))) {
|
|
return b;
|
|
}
|
|
else {
|
|
return a;
|
|
}
|
|
}
|
|
|
|
export function instanceFilterStop(s: Symbol) {
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
return s.isInstanceProperty();
|
|
}
|
|
|
|
export class ScopeSearchFilter {
|
|
|
|
constructor (public select: (a: Symbol, b: Symbol) =>Symbol,
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
public stop: (s: Symbol) =>boolean) { }
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
|
|
public result: Symbol = null;
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
|
|
public reset() {
|
|
this.result = null;
|
|
}
|
|
|
|
public update(b: Symbol): boolean {
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
this.result = this.select(this.result, b);
|
|
if (this.result) {
|
|
return this.stop(this.result);
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
export var instanceFilter = new ScopeSearchFilter(instanceCompare, instanceFilterStop);
|
|
|
|
export function preAssignModuleScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var moduleDecl = <ModuleDeclaration>ast;
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
var memberScope: SymbolTableScope = null;
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
var aggScope: SymbolAggregateScope = null;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
|
|
if (moduleDecl.name && moduleDecl.mod) {
|
|
moduleDecl.name.sym = moduleDecl.mod.symbol;
|
|
}
|
|
|
|
var mod = moduleDecl.mod;
|
|
|
|
// We're likely here because of error recovery
|
|
if (!mod) {
|
|
return;
|
|
}
|
|
|
|
memberScope = new SymbolTableScope(mod.members, mod.ambientMembers, mod.enclosedTypes, mod.ambientEnclosedTypes, mod.symbol);
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
mod.memberScope = memberScope;
|
|
context.modDeclChain.push(moduleDecl);
|
|
context.typeFlow.checker.currentModDecl = moduleDecl;
|
|
aggScope = new SymbolAggregateScope(mod.symbol);
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
aggScope.addParentScope(memberScope);
|
|
aggScope.addParentScope(context.scopeChain.scope);
|
|
pushAssignScope(aggScope, context, null, null, null);
|
|
mod.containedScope = aggScope;
|
|
if (mod.symbol) {
|
|
context.typeFlow.addLocalsFromScope(mod.containedScope, mod.symbol, moduleDecl.vars, mod.members.privateMembers, true);
|
|
}
|
|
}
|
|
|
|
export function preAssignClassScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var classDecl = <InterfaceDeclaration>ast;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'InterfaceDeclaration'.
|
|
var memberScope: SymbolTableScope = null;
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
var aggScope: SymbolAggregateScope = null;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
|
|
if (classDecl.name && classDecl.type) {
|
|
classDecl.name.sym = classDecl.type.symbol;
|
|
}
|
|
|
|
var classType = ast.type;
|
|
|
|
if (classType) {
|
|
var classSym = classType.symbol;
|
|
memberScope = <SymbolTableScope>context.typeFlow.checker.scopeOf(classType);
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
|
|
aggScope = new SymbolAggregateScope(classType.symbol);
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
aggScope.addParentScope(memberScope);
|
|
aggScope.addParentScope(context.scopeChain.scope);
|
|
|
|
classType.containedScope = aggScope;
|
|
classType.memberScope = memberScope;
|
|
|
|
var instanceType = classType.instanceType;
|
|
memberScope = <SymbolTableScope>context.typeFlow.checker.scopeOf(instanceType);
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
instanceType.memberScope = memberScope;
|
|
|
|
aggScope = new SymbolAggregateScope(instanceType.symbol);
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
aggScope.addParentScope(context.scopeChain.scope);
|
|
|
|
pushAssignScope(aggScope, context, instanceType, classType, null);
|
|
instanceType.containedScope = aggScope;
|
|
}
|
|
else {
|
|
ast.type = context.typeFlow.anyType;
|
|
}
|
|
}
|
|
|
|
export function preAssignInterfaceScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var interfaceDecl = <InterfaceDeclaration>ast;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'InterfaceDeclaration'.
|
|
var memberScope: SymbolTableScope = null;
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
var aggScope: SymbolAggregateScope = null;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
|
|
if (interfaceDecl.name && interfaceDecl.type) {
|
|
interfaceDecl.name.sym = interfaceDecl.type.symbol;
|
|
}
|
|
|
|
var interfaceType = ast.type;
|
|
memberScope = <SymbolTableScope>context.typeFlow.checker.scopeOf(interfaceType);
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolTableScope'.
|
|
interfaceType.memberScope = memberScope;
|
|
aggScope = new SymbolAggregateScope(interfaceType.symbol);
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
|
|
aggScope.addParentScope(memberScope);
|
|
aggScope.addParentScope(context.scopeChain.scope);
|
|
pushAssignScope(aggScope, context, null, null, null);
|
|
interfaceType.containedScope = aggScope;
|
|
}
|
|
|
|
export function preAssignWithScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var withStmt = <WithStatement>ast;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'WithStatement'.
|
|
var withType = withStmt.type;
|
|
|
|
var members = new ScopedMembers(new DualStringHashTable(new StringHashTable(), new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var ambientMembers = new ScopedMembers(new DualStringHashTable(new StringHashTable(), new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
|
|
var withType = new Type();
|
|
~~~~
|
|
!!! error TS2304: Cannot find name 'Type'.
|
|
var withSymbol = new WithSymbol(withStmt.minChar, context.typeFlow.checker.locationInfo.unitIndex, withType);
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'WithSymbol'.
|
|
withType.members = members;
|
|
withType.ambientMembers = ambientMembers;
|
|
withType.symbol = withSymbol;
|
|
withType.setHasImplementation();
|
|
withStmt.type = withType;
|
|
|
|
var withScope = new TypeScript.SymbolScopeBuilder(withType.members, withType.ambientMembers, null, null, context.scopeChain.scope, withType.symbol);
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'SymbolScopeBuilder' does not exist on type 'typeof TypeScript'.
|
|
|
|
pushAssignScope(withScope, context, null, null, null);
|
|
withType.containedScope = withScope;
|
|
}
|
|
|
|
export function preAssignFuncDeclScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var funcDecl = <FuncDecl>ast;
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
|
|
var container: Symbol = null;
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
var localContainer: Symbol = null;
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'Symbol'.
|
|
if (funcDecl.type) {
|
|
localContainer = ast.type.symbol;
|
|
}
|
|
|
|
var isStatic = hasFlag(funcDecl.fncFlags, FncFlags.Static);
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
var isInnerStatic = isStatic && context.scopeChain.fnc != null;
|
|
// for inner static functions, use the parent's member scope, so local vars cannot be captured
|
|
var parentScope = isInnerStatic ? context.scopeChain.fnc.type.memberScope : context.scopeChain.scope;
|
|
|
|
// if this is not a method, but enclosed by class, use constructor as
|
|
// the enclosing scope
|
|
// REVIEW: Some twisted logic here - this needs to be cleaned up once old classes are removed
|
|
// - if it's a new class, always use the contained scope, since we initialize the constructor scope below
|
|
if (context.scopeChain.thisType &&
|
|
(!funcDecl.isConstructor || hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod))) {
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
var instType = context.scopeChain.thisType;
|
|
|
|
if (!(instType.typeFlags & TypeFlags.IsClass) && !hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod)) {
|
|
~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'TypeFlags'.
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
if (!funcDecl.isMethod() || isStatic) {
|
|
parentScope = instType.constructorScope;
|
|
}
|
|
else {
|
|
// use constructor scope if a method as well
|
|
parentScope = instType.containedScope;
|
|
}
|
|
}
|
|
else {
|
|
if (context.scopeChain.previous.scope.container &&
|
|
context.scopeChain.previous.scope.container.declAST &&
|
|
context.scopeChain.previous.scope.container.declAST.nodeType == NodeType.FuncDecl &&
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
(<FuncDecl>context.scopeChain.previous.scope.container.declAST).isConstructor) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
|
|
// if the parent is the class constructor, use the constructor scope
|
|
parentScope = instType.constructorScope;
|
|
}
|
|
else if (isStatic && context.scopeChain.classType) {
|
|
parentScope = context.scopeChain.classType.containedScope;
|
|
}
|
|
else {
|
|
// else, use the contained scope
|
|
parentScope = instType.containedScope;
|
|
}
|
|
}
|
|
container = instType.symbol;
|
|
}
|
|
else if (funcDecl.isConstructor && context.scopeChain.thisType) {
|
|
// sets the container to the class type's symbol (which is shared by the instance type)
|
|
container = context.scopeChain.thisType.symbol;
|
|
}
|
|
|
|
if (funcDecl.type == null || hasFlag(funcDecl.type.symbol.flags, SymbolFlags.TypeSetDuringScopeAssignment)) {
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolFlags'.
|
|
if (context.scopeChain.fnc && context.scopeChain.fnc.type) {
|
|
container = context.scopeChain.fnc.type.symbol;
|
|
}
|
|
|
|
var funcScope = null;
|
|
var outerFnc: FuncDecl = context.scopeChain.fnc;
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
var nameText = funcDecl.name ? funcDecl.name.actualText : null;
|
|
var fgSym: TypeSymbol = null;
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'TypeSymbol'.
|
|
|
|
if (isStatic) {
|
|
// In the case of function-nested statics, no member list will have bee initialized for the function, so we need
|
|
// to copy it over. We don't set this by default because having a non-null member list will throw off assignment
|
|
// compatibility tests
|
|
if (outerFnc.type.members == null && container.getType().memberScope) {
|
|
outerFnc.type.members = (<SymbolScopeBuilder>(<TypeSymbol>container).type.memberScope).valueMembers;
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'TypeSymbol'.
|
|
}
|
|
funcScope = context.scopeChain.fnc.type.memberScope;
|
|
outerFnc.innerStaticFuncs[outerFnc.innerStaticFuncs.length] = funcDecl;
|
|
}
|
|
else {
|
|
|
|
if (!funcDecl.isConstructor &&
|
|
container &&
|
|
container.declAST &&
|
|
container.declAST.nodeType == NodeType.FuncDecl &&
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
(<FuncDecl>container.declAST).isConstructor &&
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
!funcDecl.isMethod()) {
|
|
funcScope = context.scopeChain.thisType.constructorScope;//locals;
|
|
}
|
|
else {
|
|
funcScope = context.scopeChain.scope;
|
|
}
|
|
}
|
|
|
|
// REVIEW: We don't search for another sym for accessors to prevent us from
|
|
// accidentally coalescing function signatures with the same name (E.g., a function
|
|
// 'f' the outer scope and a setter 'f' in an object literal within that scope)
|
|
if (nameText && nameText != "__missing" && !funcDecl.isAccessor()) {
|
|
if (isStatic) {
|
|
fgSym = funcScope.findLocal(nameText, false, false);
|
|
}
|
|
else {
|
|
// REVIEW: This logic should be symmetric with preCollectClassTypes
|
|
fgSym = funcScope.findLocal(nameText, false, false);
|
|
}
|
|
}
|
|
|
|
context.typeFlow.checker.createFunctionSignature(funcDecl, container,
|
|
funcScope, fgSym, fgSym == null);
|
|
|
|
// it's a getter or setter for a class property
|
|
if (!funcDecl.accessorSymbol &&
|
|
(funcDecl.fncFlags & FncFlags.ClassMethod) &&
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
container &&
|
|
((!fgSym || fgSym.declAST.nodeType != NodeType.FuncDecl) && funcDecl.isAccessor()) ||
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
(fgSym && fgSym.isAccessor()))
|
|
{
|
|
funcDecl.accessorSymbol = context.typeFlow.checker.createAccessorSymbol(funcDecl, fgSym, container.getType(), (funcDecl.isMethod() && isStatic), true, funcScope, container);
|
|
}
|
|
|
|
funcDecl.type.symbol.flags |= SymbolFlags.TypeSetDuringScopeAssignment;
|
|
~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolFlags'.
|
|
}
|
|
|
|
// Set the symbol for functions and their overloads
|
|
if (funcDecl.name && funcDecl.type) {
|
|
funcDecl.name.sym = funcDecl.type.symbol;
|
|
}
|
|
|
|
// Keep track of the original scope type, because target typing might override
|
|
// the "type" member. We need the original "Scope type" for completion list, etc.
|
|
funcDecl.scopeType = funcDecl.type;
|
|
|
|
// Overloads have no scope, so bail here
|
|
if (funcDecl.isOverload) {
|
|
return;
|
|
}
|
|
|
|
var funcTable = new StringHashTable();
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var funcMembers = new ScopedMembers(new DualStringHashTable(funcTable, new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var ambientFuncTable = new StringHashTable();
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var ambientFuncMembers = new ScopedMembers(new DualStringHashTable(ambientFuncTable, new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var funcStaticTable = new StringHashTable();
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var funcStaticMembers = new ScopedMembers(new DualStringHashTable(funcStaticTable, new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var ambientFuncStaticTable = new StringHashTable();
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var ambientFuncStaticMembers = new ScopedMembers(new DualStringHashTable(ambientFuncStaticTable, new StringHashTable()));
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
|
|
// REVIEW: Is it a problem that this is being set twice for properties and constructors?
|
|
funcDecl.unitIndex = context.typeFlow.checker.locationInfo.unitIndex;
|
|
|
|
var locals = new SymbolScopeBuilder(funcMembers, ambientFuncMembers, null, null, parentScope, localContainer);
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
var statics = new SymbolScopeBuilder(funcStaticMembers, ambientFuncStaticMembers, null, null, parentScope, null);
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
|
|
if (funcDecl.isConstructor && context.scopeChain.thisType) {
|
|
context.scopeChain.thisType.constructorScope = locals;
|
|
}
|
|
|
|
// basically, there are two problems
|
|
// - Above, for new classes, we were overwriting the constructor scope with the containing scope. This caused constructor params to be
|
|
// in scope everywhere
|
|
// - Below, we're setting the contained scope table to the same table we were overwriting the constructor scope with, which we need to
|
|
// fish lambda params, etc, out (see funcTable below)
|
|
//
|
|
// A good first approach to solving this would be to change addLocalsFromScope to take a scope instead of a table, and add to the
|
|
// constructor scope as appropriate
|
|
|
|
funcDecl.symbols = funcTable;
|
|
|
|
if (!funcDecl.isSpecialFn()) {
|
|
var group = funcDecl.type;
|
|
var signature = funcDecl.signature;
|
|
|
|
if (!funcDecl.isConstructor) {
|
|
group.containedScope = locals;
|
|
locals.container = group.symbol;
|
|
|
|
group.memberScope = statics;
|
|
statics.container = group.symbol;
|
|
}
|
|
funcDecl.enclosingFnc = context.scopeChain.fnc;
|
|
group.enclosingType = isStatic ? context.scopeChain.classType : context.scopeChain.thisType;
|
|
// for mapping when type checking
|
|
var fgSym = <TypeSymbol>ast.type.symbol;
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'TypeSymbol'.
|
|
if (((funcDecl.fncFlags & FncFlags.Signature) == FncFlags.None) && funcDecl.vars) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
context.typeFlow.addLocalsFromScope(locals, fgSym, funcDecl.vars,
|
|
funcTable, false);
|
|
context.typeFlow.addLocalsFromScope(statics, fgSym, funcDecl.statics,
|
|
funcStaticTable, false);
|
|
}
|
|
if (signature.parameters) {
|
|
var len = signature.parameters.length;
|
|
for (var i = 0; i < len; i++) {
|
|
var paramSym: ParameterSymbol = signature.parameters[i];
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ParameterSymbol'.
|
|
context.typeFlow.checker.resolveTypeLink(locals,
|
|
paramSym.parameter.typeLink, true);
|
|
}
|
|
}
|
|
context.typeFlow.checker.resolveTypeLink(locals, signature.returnType,
|
|
funcDecl.isSignature());
|
|
}
|
|
|
|
if (!funcDecl.isConstructor || hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod)) {
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
var thisType = (funcDecl.isConstructor && hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod)) ? context.scopeChain.thisType : null;
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
pushAssignScope(locals, context, thisType, null, funcDecl);
|
|
}
|
|
}
|
|
|
|
export function preAssignCatchScopes(ast: AST, context: AssignScopeContext) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
var catchBlock = <Catch>ast;
|
|
~~~~~
|
|
!!! error TS2304: Cannot find name 'Catch'.
|
|
if (catchBlock.param) {
|
|
var catchTable = new ScopedMembers(new DualStringHashTable(new StringHashTable(), new StringHashTable())); // REVIEW: Should we be allocating a public table instead of a private one?
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ScopedMembers'.
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'DualStringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'StringHashTable'.
|
|
var catchLocals = new SymbolScopeBuilder(catchTable, null, null, null, context.scopeChain.scope,
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'SymbolScopeBuilder'.
|
|
context.scopeChain.scope.container);
|
|
catchBlock.containedScope = catchLocals;
|
|
pushAssignScope(catchLocals, context, context.scopeChain.thisType, context.scopeChain.classType, context.scopeChain.fnc);
|
|
}
|
|
}
|
|
|
|
export function preAssignScopes(ast: AST, parent: AST, walker: IAstWalker) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'IAstWalker'.
|
|
var context:AssignScopeContext = walker.state;
|
|
var go = true;
|
|
|
|
if (ast) {
|
|
if (ast.nodeType == NodeType.List) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
var list = <ASTList>ast;
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ASTList'.
|
|
list.enclosingScope = context.scopeChain.scope;
|
|
}
|
|
else if (ast.nodeType == NodeType.ModuleDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignModuleScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.ClassDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignClassScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.InterfaceDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignInterfaceScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.With) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignWithScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.FuncDecl) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignFuncDeclScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.Catch) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
preAssignCatchScopes(ast, context);
|
|
}
|
|
else if (ast.nodeType == NodeType.TypeRef) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
go = false;
|
|
}
|
|
}
|
|
walker.options.goChildren = go;
|
|
return ast;
|
|
}
|
|
|
|
export function postAssignScopes(ast: AST, parent: AST, walker: IAstWalker) {
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'AST'.
|
|
~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'IAstWalker'.
|
|
var context:AssignScopeContext = walker.state;
|
|
var go = true;
|
|
if (ast) {
|
|
if (ast.nodeType == NodeType.ModuleDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
var prevModDecl = <ModuleDeclaration>ast;
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'ModuleDeclaration'.
|
|
|
|
popAssignScope(context);
|
|
|
|
context.modDeclChain.pop();
|
|
if (context.modDeclChain.length >= 1) {
|
|
context.typeFlow.checker.currentModDecl = context.modDeclChain[context.modDeclChain.length - 1];
|
|
}
|
|
}
|
|
else if (ast.nodeType == NodeType.ClassDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
popAssignScope(context);
|
|
}
|
|
else if (ast.nodeType == NodeType.InterfaceDeclaration) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
popAssignScope(context);
|
|
}
|
|
else if (ast.nodeType == NodeType.With) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
popAssignScope(context);
|
|
}
|
|
else if (ast.nodeType == NodeType.FuncDecl) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
var funcDecl = <FuncDecl>ast;
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FuncDecl'.
|
|
if ((!funcDecl.isConstructor || hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod)) && !funcDecl.isOverload) {
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'hasFlag'.
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'FncFlags'.
|
|
popAssignScope(context);
|
|
}
|
|
}
|
|
else if (ast.nodeType == NodeType.Catch) {
|
|
~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'NodeType'.
|
|
var catchBlock = <Catch>ast;
|
|
~~~~~
|
|
!!! error TS2304: Cannot find name 'Catch'.
|
|
if (catchBlock.param) {
|
|
popAssignScope(context);
|
|
}
|
|
}
|
|
else {
|
|
go = false;
|
|
}
|
|
}
|
|
walker.options.goChildren = go;
|
|
return ast;
|
|
}
|
|
} |