bazel: compiler codegen test
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import 'reflect-metadata';
|
||||
|
||||
import {writeFileSync} from 'fs';
|
||||
|
||||
import {emit as typedEmit} from './output_emitter_codegen_typed';
|
||||
import {emit as untypedEmit} from './output_emitter_codegen_untyped';
|
||||
|
||||
// Usage:
|
||||
// node path/to/output_emitter_codegen [typed output file] [untyped output file]
|
||||
function main(argv: string[]) {
|
||||
const [typed, untyped] = argv;
|
||||
writeFileSync(typed, typedEmit());
|
||||
writeFileSync(untyped, untypedEmit());
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main(process.argv.slice(2));
|
||||
}
|
@ -13,16 +13,8 @@ import {TypeScriptEmitter} from '@angular/compiler/src/output/ts_emitter';
|
||||
import {print} from '@angular/facade/src/lang';
|
||||
import {assetUrl} from '@angular/compiler/src/util';
|
||||
|
||||
function unimplemented(): any {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
import {SimpleJsImportGenerator, codegenExportsVars, codegenStmts} from './output_emitter_util';
|
||||
|
||||
export function getExpressions(): any {
|
||||
return unimplemented();
|
||||
}
|
||||
|
||||
// Generator
|
||||
export function emit() {
|
||||
const emitter = new TypeScriptEmitter(new SimpleJsImportGenerator());
|
||||
|
@ -14,10 +14,6 @@ import {assetUrl} from '@angular/compiler/src/util';
|
||||
|
||||
import {SimpleJsImportGenerator, codegenExportsVars, codegenStmts} from './output_emitter_util';
|
||||
|
||||
export function getExpressions(): any {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
// Generator
|
||||
export function emit() {
|
||||
var emitter = new JavaScriptEmitter(new SimpleJsImportGenerator());
|
||||
|
9
modules/@angular/compiler/test/output/output_emitter_generated_typed.d.ts
vendored
Normal file
9
modules/@angular/compiler/test/output/output_emitter_generated_typed.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export function getExpressions(): any;
|
9
modules/@angular/compiler/test/output/output_emitter_generated_untyped.d.ts
vendored
Normal file
9
modules/@angular/compiler/test/output/output_emitter_generated_untyped.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export function getExpressions(): any;
|
@ -15,8 +15,8 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {browserDetection} from '@angular/platform-browser/testing/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import * as typed from './output_emitter_codegen_typed';
|
||||
import * as untyped from './output_emitter_codegen_untyped';
|
||||
import * as typed from './output_emitter_generated_typed';
|
||||
import * as untyped from './output_emitter_generated_untyped';
|
||||
import {ExternalClass, codegenStmts} from './output_emitter_util';
|
||||
|
||||
export function main() {
|
||||
|
Reference in New Issue
Block a user