feat: typescript 2.9 support (#24652)

PR Close #24652
This commit is contained in:
Igor Minar
2018-06-25 11:11:22 +02:00
committed by Miško Hevery
parent 0c3738a780
commit e3064d5432
38 changed files with 293 additions and 204 deletions

View File

@ -11,11 +11,11 @@
"dependencies": {
"reflect-metadata": "^0.1.2",
"minimist": "^1.2.0",
"tsickle": "^0.29.0",
"tsickle": "^0.30.0",
"chokidar": "^1.4.2"
},
"peerDependencies": {
"typescript": ">=2.7.2 <2.9",
"typescript": ">=2.7.2 <2.10",
"@angular/compiler": "0.0.0-PLACEHOLDER"
},
"engines" : {

View File

@ -109,7 +109,7 @@ const MIN_TS_VERSION = '2.7.2';
* ∀ supported typescript version v, v < MAX_TS_VERSION
* MAX_TS_VERSION is not considered as a supported TypeScript version
*/
const MAX_TS_VERSION = '2.9.0';
const MAX_TS_VERSION = '2.10.0';
class AngularCompilerProgram implements Program {
private rootNames: string[];

View File

@ -974,7 +974,7 @@ describe('Collector', () => {
});
});
describe('regerssion', () => {
describe('regression', () => {
it('should be able to collect a short-hand property value', () => {
const metadata = collectSource(`
const children = { f1: 1 };
@ -1040,37 +1040,6 @@ describe('Collector', () => {
.not.toBeUndefined('typeGuard was not collected');
});
it('should be able to collect an invalid access expression', () => {
const source = createSource(`
import {Component} from '@angular/core';
const value = [];
@Component({
provider: [{provide: 'some token', useValue: value[]}]
})
export class MyComponent {}
`);
const metadata = collector.getMetadata(source) !;
expect(metadata.metadata.MyComponent).toEqual({
__symbolic: 'class',
decorators: [{
__symbolic: 'call',
expression: {
__symbolic: 'reference',
module: '@angular/core',
name: 'Component',
line: 4,
character: 9
},
arguments: [{
__symbolic: 'error',
message: 'Expression form not supported',
line: 5,
character: 55
}]
}]
});
});
});
describe('references', () => {