style(lint): re-format modules/@angular
This commit is contained in:
@ -4,20 +4,16 @@ import {ReflectorHost, ReflectorHostContext} from '../src/reflector_host';
|
||||
|
||||
export type Entry = string | Directory;
|
||||
|
||||
export interface Directory {
|
||||
[name: string]: Entry;
|
||||
}
|
||||
export interface Directory { [name: string]: Entry; }
|
||||
|
||||
export class MockContext implements ReflectorHostContext {
|
||||
constructor (public currentDirectory: string, private files: Entry) {}
|
||||
constructor(public currentDirectory: string, private files: Entry) {}
|
||||
|
||||
exists(fileName: string): boolean {
|
||||
return this.getEntry(fileName) !== undefined;
|
||||
}
|
||||
exists(fileName: string): boolean { return this.getEntry(fileName) !== undefined; }
|
||||
|
||||
read(fileName: string): string | undefined {
|
||||
read(fileName: string): string|undefined {
|
||||
let data = this.getEntry(fileName);
|
||||
if (typeof data === "string") {
|
||||
if (typeof data === 'string') {
|
||||
return data;
|
||||
}
|
||||
return undefined;
|
||||
@ -27,13 +23,13 @@ export class MockContext implements ReflectorHostContext {
|
||||
let parts = fileName.split('/');
|
||||
let name = parts.pop();
|
||||
let entry = this.getEntry(parts);
|
||||
if (entry && typeof entry !== "string") {
|
||||
if (entry && typeof entry !== 'string') {
|
||||
entry[name] = data;
|
||||
}
|
||||
}
|
||||
|
||||
getEntry(fileName: string | string[]): Entry | undefined {
|
||||
let parts = typeof fileName === "string" ? fileName.split('/') : fileName;
|
||||
getEntry(fileName: string|string[]): Entry|undefined {
|
||||
let parts = typeof fileName === 'string' ? fileName.split('/') : fileName;
|
||||
if (parts[0]) {
|
||||
parts = this.currentDirectory.split('/').concat(parts);
|
||||
}
|
||||
@ -42,7 +38,7 @@ export class MockContext implements ReflectorHostContext {
|
||||
let current = this.files;
|
||||
while (parts.length) {
|
||||
let part = parts.shift();
|
||||
if (typeof current === "string") {
|
||||
if (typeof current === 'string') {
|
||||
return undefined;
|
||||
}
|
||||
let next = (<Directory>current)[part];
|
||||
@ -60,30 +56,30 @@ function normalize(parts: string[]): string[] {
|
||||
while (parts.length) {
|
||||
let part = parts.shift();
|
||||
switch (part) {
|
||||
case '.': break;
|
||||
case '..': result.pop(); break;
|
||||
default: result.push(part);
|
||||
case '.':
|
||||
break;
|
||||
case '..':
|
||||
result.pop();
|
||||
break;
|
||||
default:
|
||||
result.push(part);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export class MockCompilerHost implements ts.CompilerHost {
|
||||
constructor (private context: MockContext) {}
|
||||
constructor(private context: MockContext) {}
|
||||
|
||||
fileExists(fileName: string): boolean {
|
||||
return this.context.exists(fileName);
|
||||
}
|
||||
fileExists(fileName: string): boolean { return this.context.exists(fileName); }
|
||||
|
||||
readFile(fileName: string): string {
|
||||
return this.context.read(fileName);
|
||||
}
|
||||
readFile(fileName: string): string { return this.context.read(fileName); }
|
||||
|
||||
directoryExists(directoryName: string): boolean {
|
||||
return this.context.exists(directoryName);
|
||||
}
|
||||
directoryExists(directoryName: string): boolean { return this.context.exists(directoryName); }
|
||||
|
||||
getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void): ts.SourceFile {
|
||||
getSourceFile(
|
||||
fileName: string, languageVersion: ts.ScriptTarget,
|
||||
onError?: (message: string) => void): ts.SourceFile {
|
||||
let sourceText = this.context.read(fileName);
|
||||
if (sourceText) {
|
||||
return ts.createSourceFile(fileName, sourceText, languageVersion);
|
||||
@ -96,23 +92,15 @@ export class MockCompilerHost implements ts.CompilerHost {
|
||||
return ts.getDefaultLibFileName(options);
|
||||
}
|
||||
|
||||
writeFile: ts.WriteFileCallback = (fileName, text) => {
|
||||
this.context.write(fileName, text);
|
||||
}
|
||||
writeFile: ts.WriteFileCallback = (fileName, text) => { this.context.write(fileName, text); }
|
||||
|
||||
getCurrentDirectory(): string {
|
||||
return this.context.currentDirectory;
|
||||
}
|
||||
|
||||
getCanonicalFileName(fileName: string): string {
|
||||
return fileName;
|
||||
}
|
||||
getCanonicalFileName(fileName: string): string { return fileName; }
|
||||
|
||||
useCaseSensitiveFileNames(): boolean {
|
||||
return false;
|
||||
}
|
||||
useCaseSensitiveFileNames(): boolean { return false; }
|
||||
|
||||
getNewLine(): string {
|
||||
return '\n';
|
||||
}
|
||||
getNewLine(): string { return '\n'; }
|
||||
}
|
||||
|
@ -1,17 +1,9 @@
|
||||
import {beforeEach, ddescribe, describe, expect, iit, it} from '@angular/core/testing/testing_internal';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
iit,
|
||||
expect,
|
||||
ddescribe,
|
||||
beforeEach
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {ReflectorHost, ReflectorHostContext} from '../src/reflector_host';
|
||||
|
||||
import {Directory, Entry, MockContext, MockCompilerHost} from './mocks';
|
||||
import {Directory, Entry, MockCompilerHost, MockContext} from './mocks';
|
||||
|
||||
describe('reflector_host', () => {
|
||||
var context: MockContext;
|
||||
@ -22,25 +14,30 @@ describe('reflector_host', () => {
|
||||
beforeEach(() => {
|
||||
context = new MockContext('/tmp/src', clone(FILES));
|
||||
host = new MockCompilerHost(context)
|
||||
program = ts.createProgram(['main.ts'], {
|
||||
module: ts.ModuleKind.CommonJS,
|
||||
}, host);
|
||||
program = ts.createProgram(
|
||||
['main.ts'], {
|
||||
module: ts.ModuleKind.CommonJS,
|
||||
},
|
||||
host);
|
||||
// Force a typecheck
|
||||
let errors = program.getSemanticDiagnostics();
|
||||
if (errors && errors.length) {
|
||||
throw new Error('Expected no errors');
|
||||
}
|
||||
reflectorHost = new ReflectorHost(program, host, {
|
||||
genDir: '/tmp/dist',
|
||||
basePath: '/tmp/src',
|
||||
skipMetadataEmit: false,
|
||||
skipTemplateCodegen: false,
|
||||
trace: false
|
||||
}, context);
|
||||
reflectorHost = new ReflectorHost(
|
||||
program, host, {
|
||||
genDir: '/tmp/dist',
|
||||
basePath: '/tmp/src',
|
||||
skipMetadataEmit: false,
|
||||
skipTemplateCodegen: false,
|
||||
trace: false
|
||||
},
|
||||
context);
|
||||
});
|
||||
|
||||
it('should provide the import locations for angular', () => {
|
||||
let {coreDecorators, diDecorators, diMetadata, animationMetadata, provider} = reflectorHost.angularImportLocations();
|
||||
let {coreDecorators, diDecorators, diMetadata, animationMetadata, provider} =
|
||||
reflectorHost.angularImportLocations();
|
||||
expect(coreDecorators).toEqual('@angular/core/src/metadata');
|
||||
expect(diDecorators).toEqual('@angular/core/src/di/decorators');
|
||||
expect(diMetadata).toEqual('@angular/core/src/di/metadata');
|
||||
@ -49,7 +46,8 @@ describe('reflector_host', () => {
|
||||
});
|
||||
|
||||
it('should be able to produce an import from main @angular/core', () => {
|
||||
expect(reflectorHost.getImportPath('main.ts', 'node_modules/@angular/core.d.ts')).toEqual('@angular/core');
|
||||
expect(reflectorHost.getImportPath('main.ts', 'node_modules/@angular/core.d.ts'))
|
||||
.toEqual('@angular/core');
|
||||
});
|
||||
|
||||
it('should be ble to produce an import from main to a sub-directory', () => {
|
||||
@ -57,7 +55,8 @@ describe('reflector_host', () => {
|
||||
});
|
||||
|
||||
it('should be able to produce an import from to a peer file', () => {
|
||||
expect(reflectorHost.getImportPath('lib/utils.ts', 'lib/collections.ts')).toEqual('./collections');
|
||||
expect(reflectorHost.getImportPath('lib/utils.ts', 'lib/collections.ts'))
|
||||
.toEqual('./collections');
|
||||
});
|
||||
|
||||
it('should be able to produce an import from to a sibling directory', () => {
|
||||
@ -69,7 +68,8 @@ describe('reflector_host', () => {
|
||||
});
|
||||
|
||||
it('should be able to produce a symbol for values space only reference', () => {
|
||||
expect(reflectorHost.findDeclaration('@angular/router/src/providers', 'foo', 'main.ts')).toBeDefined();
|
||||
expect(reflectorHost.findDeclaration('@angular/router/src/providers', 'foo', 'main.ts'))
|
||||
.toBeDefined();
|
||||
});
|
||||
|
||||
it('should be produce the same symbol if asked twice', () => {
|
||||
@ -78,17 +78,10 @@ describe('reflector_host', () => {
|
||||
expect(foo1).toBe(foo2);
|
||||
});
|
||||
|
||||
it('should be able to read a metadata file', () => {
|
||||
expect(reflectorHost.getMetadataFor('node_modules/@angular/core.d.ts')).toEqual({
|
||||
__symbolic: "module",
|
||||
version: 1,
|
||||
metadata: {
|
||||
foo: {
|
||||
__symbolic: "class"
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
it('should be able to read a metadata file',
|
||||
() => {
|
||||
expect(reflectorHost.getMetadataFor('node_modules/@angular/core.d.ts'))
|
||||
.toEqual({__symbolic: 'module', version: 1, metadata: {foo: {__symbolic: 'class'}}})});
|
||||
});
|
||||
|
||||
const dummyModule = 'export let foo: any[];'
|
||||
@ -106,19 +99,13 @@ const FILES: Entry = {
|
||||
'utils.ts': dummyModule,
|
||||
'collections.ts': dummyModule,
|
||||
},
|
||||
'lib2': {
|
||||
'utils2.ts': dummyModule
|
||||
},
|
||||
'lib2': {'utils2.ts': dummyModule},
|
||||
'node_modules': {
|
||||
'@angular': {
|
||||
'core.d.ts': dummyModule,
|
||||
'core.metadata.json': `{"__symbolic":"module", "version": 1, "metadata": {"foo": {"__symbolic": "class"}}}`,
|
||||
'router': {
|
||||
'index.d.ts': dummyModule,
|
||||
'src': {
|
||||
'providers.d.ts': dummyModule
|
||||
}
|
||||
}
|
||||
'core.metadata.json':
|
||||
`{"__symbolic":"module", "version": 1, "metadata": {"foo": {"__symbolic": "class"}}}`,
|
||||
'router': {'index.d.ts': dummyModule, 'src': {'providers.d.ts': dummyModule}}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -126,7 +113,7 @@ const FILES: Entry = {
|
||||
}
|
||||
|
||||
function clone(entry: Entry): Entry {
|
||||
if (typeof entry === "string") {
|
||||
if (typeof entry === 'string') {
|
||||
return entry;
|
||||
} else {
|
||||
let result: Directory = {};
|
||||
|
@ -1,21 +1,8 @@
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
iit,
|
||||
expect,
|
||||
ddescribe,
|
||||
beforeEach
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {isBlank} from '@angular/facade/src/lang';
|
||||
import {StaticReflector, StaticReflectorHost, StaticSymbol} from '@angular/compiler-cli/src/static_reflector';
|
||||
import {animate, group, keyframes, sequence, state, style, transition, trigger} from '@angular/core';
|
||||
import {beforeEach, ddescribe, describe, expect, iit, it} from '@angular/core/testing/testing_internal';
|
||||
import {ListWrapper} from '@angular/facade/src/collection';
|
||||
|
||||
import {
|
||||
StaticReflector,
|
||||
StaticReflectorHost,
|
||||
StaticSymbol
|
||||
} from '@angular/compiler-cli/src/static_reflector';
|
||||
|
||||
import {transition, sequence, group, trigger, state, style, animate, keyframes} from '@angular/core';
|
||||
import {isBlank} from '@angular/facade/src/lang';
|
||||
|
||||
describe('StaticReflector', () => {
|
||||
let noContext = new StaticSymbol('', '');
|
||||
@ -51,8 +38,9 @@ describe('StaticReflector', () => {
|
||||
'angular2/src/core/change_detection/change_detector_ref', 'ChangeDetectorRef');
|
||||
|
||||
let parameters = reflector.parameters(NgFor);
|
||||
expect(parameters)
|
||||
.toEqual([[ViewContainerRef], [TemplateRef], [IterableDiffers], [ChangeDetectorRef]]);
|
||||
expect(parameters).toEqual([
|
||||
[ViewContainerRef], [TemplateRef], [IterableDiffers], [ChangeDetectorRef]
|
||||
]);
|
||||
});
|
||||
|
||||
it('should get annotations for HeroDetailComponent', () => {
|
||||
@ -62,26 +50,23 @@ describe('StaticReflector', () => {
|
||||
expect(annotations.length).toEqual(1);
|
||||
let annotation = annotations[0];
|
||||
expect(annotation.selector).toEqual('my-hero-detail');
|
||||
expect(annotation.directives)
|
||||
.toEqual([[host.findDeclaration('angular2/src/common/directives/ng_for', 'NgFor')]]);
|
||||
expect(annotation.animations).toEqual([
|
||||
trigger("myAnimation", [
|
||||
state("state1", style({ "background": "white" })),
|
||||
transition("* => *", sequence([
|
||||
group([
|
||||
animate("1s 0.5s", keyframes([
|
||||
style({ "background": "blue"}),
|
||||
style({ "background": "red"})
|
||||
]))
|
||||
])
|
||||
]))
|
||||
])
|
||||
]);
|
||||
expect(annotation.directives).toEqual([[host.findDeclaration(
|
||||
'angular2/src/common/directives/ng_for', 'NgFor')]]);
|
||||
expect(annotation.animations).toEqual([trigger('myAnimation', [
|
||||
state('state1', style({'background': 'white'})),
|
||||
transition(
|
||||
'* => *',
|
||||
sequence([group([animate(
|
||||
'1s 0.5s',
|
||||
keyframes([style({'background': 'blue'}), style({'background': 'red'})]))])]))
|
||||
])]);
|
||||
});
|
||||
|
||||
it('should throw and exception for unsupported metadata versions', () => {
|
||||
let e = host.findDeclaration('src/version-error', 'e');
|
||||
expect(() => reflector.annotations(e)).toThrow(new Error('Metadata version mismatch for module /tmp/src/version-error.d.ts, found version 100, expected 1'));
|
||||
expect(() => reflector.annotations(e))
|
||||
.toThrow(new Error(
|
||||
'Metadata version mismatch for module /tmp/src/version-error.d.ts, found version 100, expected 1'));
|
||||
});
|
||||
|
||||
it('should get and empty annotation list for an unknown class', () => {
|
||||
@ -111,17 +96,20 @@ describe('StaticReflector', () => {
|
||||
|
||||
it('should provide context for errors reported by the collector', () => {
|
||||
let SomeClass = host.findDeclaration('src/error-reporting', 'SomeClass');
|
||||
expect(() => reflector.annotations(SomeClass)).toThrow(new Error('Error encountered resolving symbol values statically. A reasonable error message (position 12:33 in the original .ts file), resolving symbol ErrorSym in /tmp/src/error-references.d.ts, resolving symbol Link2 in /tmp/src/error-references.d.ts, resolving symbol Link1 in /tmp/src/error-references.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts'));
|
||||
expect(() => reflector.annotations(SomeClass))
|
||||
.toThrow(new Error(
|
||||
'Error encountered resolving symbol values statically. A reasonable error message (position 12:33 in the original .ts file), resolving symbol ErrorSym in /tmp/src/error-references.d.ts, resolving symbol Link2 in /tmp/src/error-references.d.ts, resolving symbol Link1 in /tmp/src/error-references.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts'));
|
||||
});
|
||||
|
||||
it('should simplify primitive into itself', () => {
|
||||
expect(simplify(noContext, 1)).toBe(1);
|
||||
expect(simplify(noContext, true)).toBe(true);
|
||||
expect(simplify(noContext, "some value")).toBe("some value");
|
||||
expect(simplify(noContext, 'some value')).toBe('some value');
|
||||
});
|
||||
|
||||
it('should simplify an array into a copy of the array',
|
||||
() => { expect(simplify(noContext, [1, 2, 3])).toEqual([1, 2, 3]); });
|
||||
it('should simplify an array into a copy of the array', () => {
|
||||
expect(simplify(noContext, [1, 2, 3])).toEqual([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('should simplify an object to a copy of the object', () => {
|
||||
let expr = {a: 1, b: 2, c: 3};
|
||||
@ -129,137 +117,180 @@ describe('StaticReflector', () => {
|
||||
});
|
||||
|
||||
it('should simplify &&', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&&', left: true, right: true}))).toBe(true);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&&', left: true, right: false}))).toBe(false);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&&', left: false, right: true}))).toBe(false);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&&', left: false, right: false}))).toBe(false);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&&', left: true, right: true})))
|
||||
.toBe(true);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&&', left: true, right: false})))
|
||||
.toBe(false);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&&', left: false, right: true})))
|
||||
.toBe(false);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&&', left: false, right: false})))
|
||||
.toBe(false);
|
||||
});
|
||||
|
||||
it('should simplify ||', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '||', left: true, right: true}))).toBe(true);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '||', left: true, right: false}))).toBe(true);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '||', left: false, right: true}))).toBe(true);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '||', left: false, right: false}))).toBe(false);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '||', left: true, right: true})))
|
||||
.toBe(true);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '||', left: true, right: false})))
|
||||
.toBe(true);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '||', left: false, right: true})))
|
||||
.toBe(true);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '||', left: false, right: false})))
|
||||
.toBe(false);
|
||||
});
|
||||
|
||||
it('should simplify &', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&', left: 0x22, right: 0x0F}))).toBe(0x22 & 0x0F);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '&', left: 0x22, right: 0xF0}))).toBe(0x22 & 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&', left: 0x22, right: 0x0F})))
|
||||
.toBe(0x22 & 0x0F);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '&', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 & 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify |', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '|', left: 0x22, right: 0x0F}))).toBe(0x22 | 0x0F);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '|', left: 0x22, right: 0xF0}))).toBe(0x22 | 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '|', left: 0x22, right: 0x0F})))
|
||||
.toBe(0x22 | 0x0F);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '|', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 | 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify ^', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '|', left: 0x22, right: 0x0F}))).toBe(0x22 | 0x0F);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '|', left: 0x22, right: 0xF0}))).toBe(0x22 | 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '|', left: 0x22, right: 0x0F})))
|
||||
.toBe(0x22 | 0x0F);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '|', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 | 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify ==', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '==', left: 0x22, right: 0x22}))).toBe(0x22 == 0x22);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '==', left: 0x22, right: 0xF0}))).toBe(0x22 == 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0x22})))
|
||||
.toBe(0x22 == 0x22);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 == 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify !=', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '!=', left: 0x22, right: 0x22}))).toBe(0x22 != 0x22);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '!=', left: 0x22, right: 0xF0}))).toBe(0x22 != 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0x22})))
|
||||
.toBe(0x22 != 0x22);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 != 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify ===', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '===', left: 0x22, right: 0x22}))).toBe(0x22 === 0x22);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '===', left: 0x22, right: 0xF0}))).toBe(0x22 === 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0x22})))
|
||||
.toBe(0x22 === 0x22);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 === 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify !==', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '!==', left: 0x22, right: 0x22}))).toBe(0x22 !== 0x22);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '!==', left: 0x22, right: 0xF0}))).toBe(0x22 !== 0xF0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0x22})))
|
||||
.toBe(0x22 !== 0x22);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0xF0})))
|
||||
.toBe(0x22 !== 0xF0);
|
||||
});
|
||||
|
||||
it('should simplify >', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>', left: 1, right: 1}))).toBe(1 > 1);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>', left: 1, right: 0}))).toBe(1 > 0);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>', left: 0, right: 1}))).toBe(0 > 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>', left: 1, right: 1})))
|
||||
.toBe(1 > 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>', left: 1, right: 0})))
|
||||
.toBe(1 > 0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>', left: 0, right: 1})))
|
||||
.toBe(0 > 1);
|
||||
});
|
||||
|
||||
it('should simplify >=', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>=', left: 1, right: 1}))).toBe(1 >= 1);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>=', left: 1, right: 0}))).toBe(1 >= 0);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>=', left: 0, right: 1}))).toBe(0 >= 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>=', left: 1, right: 1})))
|
||||
.toBe(1 >= 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>=', left: 1, right: 0})))
|
||||
.toBe(1 >= 0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>=', left: 0, right: 1})))
|
||||
.toBe(0 >= 1);
|
||||
});
|
||||
|
||||
it('should simplify <=', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<=', left: 1, right: 1}))).toBe(1 <= 1);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<=', left: 1, right: 0}))).toBe(1 <= 0);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<=', left: 0, right: 1}))).toBe(0 <= 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<=', left: 1, right: 1})))
|
||||
.toBe(1 <= 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<=', left: 1, right: 0})))
|
||||
.toBe(1 <= 0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<=', left: 0, right: 1})))
|
||||
.toBe(0 <= 1);
|
||||
});
|
||||
|
||||
it('should simplify <', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<', left: 1, right: 1}))).toBe(1 < 1);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<', left: 1, right: 0}))).toBe(1 < 0);
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<', left: 0, right: 1}))).toBe(0 < 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<', left: 1, right: 1})))
|
||||
.toBe(1 < 1);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<', left: 1, right: 0})))
|
||||
.toBe(1 < 0);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<', left: 0, right: 1})))
|
||||
.toBe(0 < 1);
|
||||
});
|
||||
|
||||
it('should simplify <<', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '<<', left: 0x55, right: 2}))).toBe(0x55 << 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '<<', left: 0x55, right: 2})))
|
||||
.toBe(0x55 << 2);
|
||||
});
|
||||
|
||||
it('should simplify >>', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '>>', left: 0x55, right: 2}))).toBe(0x55 >> 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '>>', left: 0x55, right: 2})))
|
||||
.toBe(0x55 >> 2);
|
||||
});
|
||||
|
||||
it('should simplify +', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '+', left: 0x55, right: 2}))).toBe(0x55 + 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '+', left: 0x55, right: 2})))
|
||||
.toBe(0x55 + 2);
|
||||
});
|
||||
|
||||
it('should simplify -', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '-', left: 0x55, right: 2}))).toBe(0x55 - 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '-', left: 0x55, right: 2})))
|
||||
.toBe(0x55 - 2);
|
||||
});
|
||||
|
||||
it('should simplify *', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '*', left: 0x55, right: 2}))).toBe(0x55 * 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '*', left: 0x55, right: 2})))
|
||||
.toBe(0x55 * 2);
|
||||
});
|
||||
|
||||
it('should simplify /', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '/', left: 0x55, right: 2}))).toBe(0x55 / 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '/', left: 0x55, right: 2})))
|
||||
.toBe(0x55 / 2);
|
||||
});
|
||||
|
||||
it('should simplify %', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'binop', operator: '%', left: 0x55, right: 2}))).toBe(0x55 % 2);
|
||||
expect(simplify(noContext, ({__symbolic: 'binop', operator: '%', left: 0x55, right: 2})))
|
||||
.toBe(0x55 % 2);
|
||||
});
|
||||
|
||||
it('should simplify prefix -', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'pre', operator: '-', operand: 2}))).toBe(-2);
|
||||
expect(simplify(noContext, ({__symbolic: 'pre', operator: '-', operand: 2}))).toBe(-2);
|
||||
});
|
||||
|
||||
it('should simplify prefix ~', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'pre', operator: '~', operand: 2}))).toBe(~2);
|
||||
expect(simplify(noContext, ({__symbolic: 'pre', operator: '~', operand: 2}))).toBe(~2);
|
||||
});
|
||||
|
||||
it('should simplify prefix !', () => {
|
||||
expect(simplify(noContext, ({ __symbolic: 'pre', operator: '!', operand: true}))).toBe(!true);
|
||||
expect(simplify(noContext, ({ __symbolic: 'pre', operator: '!', operand: false}))).toBe(!false);
|
||||
expect(simplify(noContext, ({__symbolic: 'pre', operator: '!', operand: true}))).toBe(!true);
|
||||
expect(simplify(noContext, ({__symbolic: 'pre', operator: '!', operand: false}))).toBe(!false);
|
||||
});
|
||||
|
||||
it('should simplify an array index', () => {
|
||||
expect(simplify(noContext, ({__symbolic: "index", expression: [1, 2, 3], index: 2}))).toBe(3);
|
||||
expect(simplify(noContext, ({__symbolic: 'index', expression: [1, 2, 3], index: 2}))).toBe(3);
|
||||
});
|
||||
|
||||
it('should simplify an object index', () => {
|
||||
let expr = {__symbolic: "select", expression: {a: 1, b: 2, c: 3}, member: "b"};
|
||||
let expr = {__symbolic: 'select', expression: {a: 1, b: 2, c: 3}, member: 'b'};
|
||||
expect(simplify(noContext, expr)).toBe(2);
|
||||
});
|
||||
|
||||
it('should simplify a module reference', () => {
|
||||
expect(simplify(new StaticSymbol('/src/cases', ''),
|
||||
({__symbolic: "reference", module: "./extern", name: "s"})))
|
||||
.toEqual("s");
|
||||
expect(simplify(
|
||||
new StaticSymbol('/src/cases', ''),
|
||||
({__symbolic: 'reference', module: './extern', name: 's'})))
|
||||
.toEqual('s');
|
||||
});
|
||||
|
||||
it('should simplify a non existing reference as a static symbol', () => {
|
||||
expect(simplify(new StaticSymbol('/src/cases', ''),
|
||||
({__symbolic: "reference", module: "./extern", name: "nonExisting"})))
|
||||
expect(simplify(
|
||||
new StaticSymbol('/src/cases', ''),
|
||||
({__symbolic: 'reference', module: './extern', name: 'nonExisting'})))
|
||||
.toEqual(host.getStaticSymbol('/src/extern.d.ts', 'nonExisting'));
|
||||
});
|
||||
});
|
||||
@ -327,64 +358,64 @@ class MockReflectorHost implements StaticReflectorHost {
|
||||
getMetadataFor(moduleId: string): any {
|
||||
let data: {[key: string]: any} = {
|
||||
'/tmp/angular2/src/common/forms-deprecated/directives.d.ts': [{
|
||||
"__symbolic": "module",
|
||||
"version": 1,
|
||||
"metadata": {
|
||||
"FORM_DIRECTIVES": [
|
||||
'__symbolic': 'module',
|
||||
'version': 1,
|
||||
'metadata': {
|
||||
'FORM_DIRECTIVES': [
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"name": "NgFor",
|
||||
"module": "angular2/src/common/directives/ng_for"
|
||||
'__symbolic': 'reference',
|
||||
'name': 'NgFor',
|
||||
'module': 'angular2/src/common/directives/ng_for'
|
||||
}
|
||||
]
|
||||
}
|
||||
}],
|
||||
'/tmp/angular2/src/common/directives/ng_for.d.ts': {
|
||||
"__symbolic": "module",
|
||||
"version": 1,
|
||||
"metadata": {
|
||||
"NgFor": {
|
||||
"__symbolic": "class",
|
||||
"decorators": [
|
||||
'__symbolic': 'module',
|
||||
'version': 1,
|
||||
'metadata': {
|
||||
'NgFor': {
|
||||
'__symbolic': 'class',
|
||||
'decorators': [
|
||||
{
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "Directive",
|
||||
"module": "../../core/metadata"
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'Directive',
|
||||
'module': '../../core/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
'arguments': [
|
||||
{
|
||||
"selector": "[ngFor][ngForOf]",
|
||||
"inputs": ["ngForTrackBy", "ngForOf", "ngForTemplate"]
|
||||
'selector': '[ngFor][ngForOf]',
|
||||
'inputs': ['ngForTrackBy', 'ngForOf', 'ngForTemplate']
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"members": {
|
||||
"__ctor__": [
|
||||
'members': {
|
||||
'__ctor__': [
|
||||
{
|
||||
"__symbolic": "constructor",
|
||||
"parameters": [
|
||||
'__symbolic': 'constructor',
|
||||
'parameters': [
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"module": "../../core/linker/view_container_ref",
|
||||
"name": "ViewContainerRef"
|
||||
'__symbolic': 'reference',
|
||||
'module': '../../core/linker/view_container_ref',
|
||||
'name': 'ViewContainerRef'
|
||||
},
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"module": "../../core/linker/template_ref",
|
||||
"name": "TemplateRef"
|
||||
'__symbolic': 'reference',
|
||||
'module': '../../core/linker/template_ref',
|
||||
'name': 'TemplateRef'
|
||||
},
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"module": "../../core/change_detection/differs/iterable_differs",
|
||||
"name": "IterableDiffers"
|
||||
'__symbolic': 'reference',
|
||||
'module': '../../core/change_detection/differs/iterable_differs',
|
||||
'name': 'IterableDiffers'
|
||||
},
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"module": "../../core/change_detection/change_detector_ref",
|
||||
"name": "ChangeDetectorRef"
|
||||
'__symbolic': 'reference',
|
||||
'module': '../../core/change_detection/change_detector_ref',
|
||||
'name': 'ChangeDetectorRef'
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -394,119 +425,119 @@ class MockReflectorHost implements StaticReflectorHost {
|
||||
}
|
||||
},
|
||||
'/tmp/angular2/src/core/linker/view_container_ref.d.ts':
|
||||
{version: 1, "metadata": {"ViewContainerRef": {"__symbolic": "class"}}},
|
||||
{version: 1, 'metadata': {'ViewContainerRef': {'__symbolic': 'class'}}},
|
||||
'/tmp/angular2/src/core/linker/template_ref.d.ts':
|
||||
{version: 1, "module": "./template_ref", "metadata": {"TemplateRef": {"__symbolic": "class"}}},
|
||||
{version: 1, 'module': './template_ref', 'metadata': {'TemplateRef': {'__symbolic': 'class'}}},
|
||||
'/tmp/angular2/src/core/change_detection/differs/iterable_differs.d.ts':
|
||||
{version: 1, "metadata": {"IterableDiffers": {"__symbolic": "class"}}},
|
||||
{version: 1, 'metadata': {'IterableDiffers': {'__symbolic': 'class'}}},
|
||||
'/tmp/angular2/src/core/change_detection/change_detector_ref.d.ts':
|
||||
{version: 1, "metadata": {"ChangeDetectorRef": {"__symbolic": "class"}}},
|
||||
{version: 1, 'metadata': {'ChangeDetectorRef': {'__symbolic': 'class'}}},
|
||||
'/tmp/src/app/hero-detail.component.d.ts': {
|
||||
"__symbolic": "module",
|
||||
"version": 1,
|
||||
"metadata": {
|
||||
"HeroDetailComponent": {
|
||||
"__symbolic": "class",
|
||||
"decorators": [
|
||||
'__symbolic': 'module',
|
||||
'version': 1,
|
||||
'metadata': {
|
||||
'HeroDetailComponent': {
|
||||
'__symbolic': 'class',
|
||||
'decorators': [
|
||||
{
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "Component",
|
||||
"module": "angular2/src/core/metadata"
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'Component',
|
||||
'module': 'angular2/src/core/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
'arguments': [
|
||||
{
|
||||
"selector": "my-hero-detail",
|
||||
"template":
|
||||
"\n <div *ngIf=\"hero\">\n <h2>{{hero.name}} details!</h2>\n <div><label>id: </label>{{hero.id}}</div>\n <div>\n <label>name: </label>\n <input [(ngModel)]=\"hero.name\" placeholder=\"name\"/>\n </div>\n </div>\n",
|
||||
"directives": [
|
||||
'selector': 'my-hero-detail',
|
||||
'template':
|
||||
'\n <div *ngIf="hero">\n <h2>{{hero.name}} details!</h2>\n <div><label>id: </label>{{hero.id}}</div>\n <div>\n <label>name: </label>\n <input [(ngModel)]="hero.name" placeholder="name"/>\n </div>\n </div>\n',
|
||||
'directives': [
|
||||
{
|
||||
"__symbolic": "reference",
|
||||
"name": "FORM_DIRECTIVES",
|
||||
"module": "angular2/src/common/forms-deprecated/directives"
|
||||
'__symbolic': 'reference',
|
||||
'name': 'FORM_DIRECTIVES',
|
||||
'module': 'angular2/src/common/forms-deprecated/directives'
|
||||
}
|
||||
],
|
||||
"animations": [{
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "trigger",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'animations': [{
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'trigger',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
"myAnimation",
|
||||
[{ "__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "state",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments': [
|
||||
'myAnimation',
|
||||
[{ '__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'state',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
"state1",
|
||||
{ "__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "style",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments': [
|
||||
'state1',
|
||||
{ '__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'style',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
{ "background":"white" }
|
||||
'arguments': [
|
||||
{ 'background':'white' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"transition",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'transition',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments": [
|
||||
"* => *",
|
||||
'arguments': [
|
||||
'* => *',
|
||||
{
|
||||
"__symbolic":"call",
|
||||
"expression":{
|
||||
"__symbolic":"reference",
|
||||
"name":"sequence",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'__symbolic':'call',
|
||||
'expression':{
|
||||
'__symbolic':'reference',
|
||||
'name':'sequence',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[[{ "__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"group",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments':[[{ '__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'group',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[[{
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"animate",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments':[[{
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'animate',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[
|
||||
"1s 0.5s",
|
||||
{ "__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"keyframes",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments':[
|
||||
'1s 0.5s',
|
||||
{ '__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'keyframes',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[[{ "__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"style",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'arguments':[[{ '__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'style',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[ { "background": "blue"} ]
|
||||
'arguments':[ { 'background': 'blue'} ]
|
||||
}, {
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic":"reference",
|
||||
"name":"style",
|
||||
"module": "angular2/src/core/animation/metadata"
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic':'reference',
|
||||
'name':'style',
|
||||
'module': 'angular2/src/core/animation/metadata'
|
||||
},
|
||||
"arguments":[ { "background": "red"} ]
|
||||
'arguments':[ { 'background': 'red'} ]
|
||||
}]]
|
||||
}
|
||||
]
|
||||
@ -520,17 +551,17 @@ class MockReflectorHost implements StaticReflectorHost {
|
||||
}]
|
||||
}]
|
||||
}],
|
||||
"members": {
|
||||
"hero": [
|
||||
'members': {
|
||||
'hero': [
|
||||
{
|
||||
"__symbolic": "property",
|
||||
"decorators": [
|
||||
'__symbolic': 'property',
|
||||
'decorators': [
|
||||
{
|
||||
"__symbolic": "call",
|
||||
"expression": {
|
||||
"__symbolic": "reference",
|
||||
"name": "Input",
|
||||
"module": "angular2/src/core/metadata"
|
||||
'__symbolic': 'call',
|
||||
'expression': {
|
||||
'__symbolic': 'reference',
|
||||
'name': 'Input',
|
||||
'module': 'angular2/src/core/metadata'
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -540,29 +571,29 @@ class MockReflectorHost implements StaticReflectorHost {
|
||||
}
|
||||
}
|
||||
},
|
||||
'/src/extern.d.ts': {"__symbolic": "module", "version": 1, metadata: {s: "s"}},
|
||||
'/tmp/src/version-error.d.ts': {"__symbolic": "module", "version": 100, metadata: {e: "s"}},
|
||||
'/src/extern.d.ts': {'__symbolic': 'module', 'version': 1, metadata: {s: 's'}},
|
||||
'/tmp/src/version-error.d.ts': {'__symbolic': 'module', 'version': 100, metadata: {e: 's'}},
|
||||
'/tmp/src/error-reporting.d.ts': {
|
||||
__symbolic: "module",
|
||||
__symbolic: 'module',
|
||||
version: 1,
|
||||
metadata: {
|
||||
SomeClass: {
|
||||
__symbolic: "class",
|
||||
__symbolic: 'class',
|
||||
decorators: [
|
||||
{
|
||||
__symbolic: "call",
|
||||
__symbolic: 'call',
|
||||
expression: {
|
||||
__symbolic: "reference",
|
||||
name: "Component",
|
||||
module: "angular2/src/core/metadata"
|
||||
__symbolic: 'reference',
|
||||
name: 'Component',
|
||||
module: 'angular2/src/core/metadata'
|
||||
},
|
||||
arguments: [
|
||||
{
|
||||
directives: [
|
||||
{
|
||||
__symbolic: "reference",
|
||||
module: "src/error-references",
|
||||
name: "Link1",
|
||||
__symbolic: 'reference',
|
||||
module: 'src/error-references',
|
||||
name: 'Link1',
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -573,22 +604,22 @@ class MockReflectorHost implements StaticReflectorHost {
|
||||
}
|
||||
},
|
||||
'/tmp/src/error-references.d.ts': {
|
||||
__symbolic: "module",
|
||||
__symbolic: 'module',
|
||||
version: 1,
|
||||
metadata: {
|
||||
Link1: {
|
||||
__symbolic: "reference",
|
||||
module: "src/error-references",
|
||||
name: "Link2"
|
||||
__symbolic: 'reference',
|
||||
module: 'src/error-references',
|
||||
name: 'Link2'
|
||||
},
|
||||
Link2: {
|
||||
__symbolic: "reference",
|
||||
module: "src/error-references",
|
||||
name: "ErrorSym"
|
||||
__symbolic: 'reference',
|
||||
module: 'src/error-references',
|
||||
name: 'ErrorSym'
|
||||
},
|
||||
ErrorSym: {
|
||||
__symbolic: "error",
|
||||
message: "A reasonable error message",
|
||||
__symbolic: 'error',
|
||||
message: 'A reasonable error message',
|
||||
line: 12,
|
||||
character: 33
|
||||
}
|
||||
|
Reference in New Issue
Block a user