3058 Commits

Author SHA1 Message Date
Cyrus Najmabadi
f5ad79fe7a Remove the dependency that TypeChecker and Emitter have on Program.
Instead, these layers explicitly specify the functionality they need, and don't take in anything extra.
2014-12-16 14:12:17 -08:00
Cyrus Najmabadi
b665323d45 Make the emitter no longer depend on the Program.
This breaks layering.  Also, it means the emitter depends on too large a surface area.
Now the emitter declares exactly what it needs, and only gets that.
2014-12-16 13:52:47 -08:00
Cyrus Najmabadi
96c3c90d9a Rename typechecker parameter related to whether or not we produce diagnostics.
Comment what the flag means.
2014-12-16 13:30:34 -08:00
Cyrus Najmabadi
4aa361d4bf Layer the compiler so that every layer only depends on hte layers below it.
The layering is now:

types
core
scanner
parser
binder
checker
emitter
program
2014-12-16 13:14:14 -08:00
Mohamed Hegazy
5c4c08a667 Merge pull request #1500 from Arnavion/exec-process-stderr-number
Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.
2014-12-16 10:09:43 -08:00
Arnavion
f042044fce Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.
The original error was because process.stderr only allows writing Strings or Buffers, but status is a Number.

Also, the message parameter of the "error" handler is just the amalgam of all output written to stderr. This is already logged by the "stderr" handler, so there's no need to write it to process.stderr again.
2014-12-16 02:45:17 -08:00
Vladimir Matveev
59c73c5f34 Merge pull request #1466 from Microsoft/linked_imports
defer decision whether import used on the right side of import declarati...
2014-12-16 00:46:26 -08:00
Vladimir Matveev
5b38cb9a69 harden 'get import declaration' logic 2014-12-16 00:34:51 -08:00
CyrusNajmabadi
1eba8db465 Merge pull request #1498 from Microsoft/bindingElementContxt
Do not pass context flags downward while parsing binding elements.
2014-12-15 22:00:26 -08:00
Cyrus Najmabadi
30f9a5ca2a Do not pass context flags downward while parsing binding elements.
This prevents an unnecessary allocation, simplifies parsing code, and prevents
an issue where parsing depends on context flags not stored in the final tree.
This is an issue for incremental parsing that can lead to nodes being reused
inappropriately.
2014-12-15 21:41:02 -08:00
CyrusNajmabadi
539300bc5a Merge pull request #1496 from Microsoft/bindingContainers
Simplify how we set container.nextContainer now that we don't double recurse during binding.
2014-12-15 18:26:19 -08:00
Cyrus Najmabadi
cb8d2f28ae Simplify how we set container.nextContainer now that we don't double recurse. 2014-12-15 14:43:31 -08:00
CyrusNajmabadi
9bb6cee923 Merge pull request #1491 from Microsoft/binderDoubleRecurse
Simplify the binder so it does not need to double recurse down constructor parameter nodes.
2014-12-15 13:59:18 -08:00
Cyrus Najmabadi
d3bfed13f8 Simplify the binder so it does not need to double recurse down constructor parameter nodes. 2014-12-15 13:23:06 -08:00
CyrusNajmabadi
5237ed7bed Merge pull request #1482 from Microsoft/typingHighFidelity
Move test helpers into the harness Utils module.
2014-12-15 00:33:25 -08:00
Cyrus Najmabadi
b09e92e848 Up timeout to 20 seconds.
A specific test "genericRespecialization1" takes quite some time on travis (though only a couple
of seconds locally).
2014-12-15 00:24:03 -08:00
Cyrus Najmabadi
14883cb18e Merge branch 'master' into typingHighFidelity 2014-12-14 23:46:05 -08:00
Cyrus Najmabadi
115a2d33b7 Update timeout to 6 seconds. 2014-12-14 23:23:18 -08:00
Cyrus Najmabadi
1bfe500897 Formatting. 2014-12-14 23:22:19 -08:00
CyrusNajmabadi
c3ad5b2b3a Merge pull request #1485 from Microsoft/noDebuggerInTests
Remove calls to "debugger;" in our fourslash tests.
2014-12-14 23:05:25 -08:00
Cyrus Najmabadi
0ec9f0d3bb Check tree invariants during fourslash tests. 2014-12-14 22:43:26 -08:00
Cyrus Najmabadi
b4a21686c1 Remove calls to "debugger;" in our fourslash tests. 2014-12-14 12:22:36 -08:00
Cyrus Najmabadi
2bb0eb604b Ensure the 'hasParseErrors' bit is the same between trees. 2014-12-14 12:04:18 -08:00
Cyrus Najmabadi
0e01e48d0e Always run all fourslash tests in high fidelity typing mode.
We want to verify after every edit that our incremental data is correct.
2014-12-14 11:34:15 -08:00
Cyrus Najmabadi
6d9bfda3e5 Check post edit invariants after every edit. 2014-12-14 11:20:50 -08:00
Cyrus Najmabadi
bd4aed25da Don't convert the tree to JSON before checking it. Just check it directly. 2014-12-14 11:16:50 -08:00
Cyrus Najmabadi
f5d622f0c9 Move test helpers into the harness Utils module. 2014-12-14 10:57:34 -08:00
CyrusNajmabadi
fbfb94f776 Merge pull request #1470 from Microsoft/flagAggregation
Make utility method names clearer.
2014-12-12 15:50:03 -08:00
Cyrus Najmabadi
ea3e509154 Make utility mehtod names clearer. 2014-12-12 15:29:52 -08:00
CyrusNajmabadi
7d2009ab64 Merge pull request #1469 from Microsoft/262baselines
Simplify 262 baselines.
2014-12-12 14:46:28 -08:00
CyrusNajmabadi
102cb2f406 Merge pull request #1468 from Microsoft/LKG
Update LKG.
2014-12-12 14:34:24 -08:00
Cyrus Najmabadi
9f59cf6e19 Simplify 262 baselines. 2014-12-12 14:26:31 -08:00
Cyrus Najmabadi
cf8afc3124 Update LKG. 2014-12-12 14:16:35 -08:00
CyrusNajmabadi
dacbd982cf Merge pull request #1467 from Microsoft/postEditInvariants
Resurrect the post edit invariants checking for fourslash.
2014-12-12 13:52:19 -08:00
CyrusNajmabadi
126aaf949d Merge pull request #1465 from Microsoft/labeledStatement
Avoid lookahead when parsing a statement.
2014-12-12 13:45:06 -08:00
Cyrus Najmabadi
183c80a81a Merge branch 'master' into postEditInvariants
Conflicts:
	src/harness/test262Runner.ts
2014-12-12 13:42:39 -08:00
Cyrus Najmabadi
26badc686f Avoid lookahead when parsing a statement.
If a statement started with an identifier, then we'd normally lookahead to see if the next token
was a colon.  Lookahead is expensive (as it has to rescan tokens).  Instead, we do the same thing
we do for arrow-functions.  We just parse out the identifier, and afterwards we check if there is
a colon as the current token.  Now, no lookahead is required.
2014-12-12 13:32:54 -08:00
Cyrus Najmabadi
f6aaa84146 In Fourslash: Compare ASTs for files produced incrementally versus files produced with a full parse. 2014-12-12 13:26:43 -08:00
Cyrus Najmabadi
0aa3f6e607 Rename some locals. 2014-12-12 13:09:50 -08:00
Cyrus Najmabadi
6ff58e3028 Don't emit error flags in the 262 baselines unless the node actually had an error.
This helps reduce clutter.
2014-12-12 12:41:59 -08:00
Cyrus Najmabadi
f8dd19ed1c Resurrect the post edit invariants checking for fourslash. 2014-12-12 12:01:27 -08:00
Vladimir Matveev
c24f75fd73 defer decision whether import used on the right side of import declaration should be considered referenced 2014-12-12 11:48:46 -08:00
CyrusNajmabadi
7b528ddd2b Merge pull request #1464 from Microsoft/void0
Properly emit 'void 0' when emitting destructuring assignments.
2014-12-12 11:36:47 -08:00
Cyrus Najmabadi
83f0c91999 Properly emit 'void 0' when emitting destructuring assignments. 2014-12-12 11:28:05 -08:00
Mohamed Hegazy
90a9b3472a Merge pull request #1460 from Arnavion/compilefile-fail-task-on-error
Actually fail the surrounding jake task on errors in compileFile()
2014-12-12 09:02:09 -08:00
Arnavion
f6fd263cbd Actually fail the surrounding jake task on errors in compileFile() 2014-12-12 08:49:21 -08:00
Daniel Rosenwasser
001e29cd75 Merge pull request #1461 from Microsoft/fixProcessDiagMessagesProbWith1.4Merge
Fix processDiagnosticMessages script issue in master with a 1.4 merge
2014-12-12 00:31:16 -08:00
Daniel Rosenwasser
854586e824 Merge branch 'release-1.4' into fixProcessDiagMessagesProbWith1.4Merge
Conflicts:
	tests/baselines/reference/APISample_node_compile.js
	tests/baselines/reference/APISample_node_compile.types
	tests/baselines/reference/APISample_standalone_compile.js
	tests/baselines/reference/APISample_standalone_compile.types
	tests/cases/compiler/APISample_node_compile.ts
	tests/cases/compiler/APISample_standalone_compile.ts
2014-12-12 00:09:23 -08:00
Daniel Rosenwasser
87b7ddd51b Merge pull request #1453 from Microsoft/fixSysDependencyForDiagnostics
Fix sys dependency for processDiagnosticMessages.ts
2014-12-12 00:03:43 -08:00
Daniel Rosenwasser
c5943de3cd Just temporarily removing the tests until we can get back into a good state. 2014-12-11 23:54:33 -08:00